[APP] [HELP] Advice on writing a touch friendly UI - Windows Mobile Development and Hacking General

I am currently writing an application for my WM6.1 device (HTC TouchHD), and wondered if anyone had come across a site, or if someone could point me in the right direction for finding a nice way of writing 'finger friendly' applications. By finger friendly, i mean being able to scroll with my fingers and so on. Or if there are any open source applications that I can use as a reference?
I don't particularly want to say what application I'm writing just in case it falls to pieces, but rest assured once it's written it will be put up on here!
Thanks,
evorgevol

I have just found this page which does me for scrolling parts of my application. The main thing I'm having issues with is that I want the main menu interface to resemble windows 7 media center, see here for a video of what effect I'm trying to achieve.
I know it's quite complicated, and I'm not the best programmer in the world, but hopefully I should be able to do it??
Any help will be appreciated. Thanks,
evorgevol

If I understand, you're trying to create an UI with a scrolling list useable with fingers.
Each item in the list, once selected, let appears different choices about this item (IE : a "Appointment" item in the list, when you select it, you have the next appointment displayed....). It that right ?
Doesn't it look like the new WM6.5 today plugin ? If that's you're idea, I'm 100% on your side to develop a today plugin looking like these menus (WM6.5 / WM7 MC) !
(In fact, I'm already searching if somebody could develop something like this : http://forum.xda-developers.com/showthread.php?p=3375478)

The one I'm doing is not necessarily for a today page, more for my own application, tho it should be able to be easily used in any other application once the code has been written. I just need a push in the right direction for me to be able to write the code in the first place. I'm also deliberating what format to write my application in, and which ones are available. I will only be supporting from WM6 onwards, tho it could potentially be backwards compatible with 5. Ideal would be silverlight being able to be used, but unfortunately that hasnt been released for mobile yet (it would mean that my application should run on any platform that supports Silverlight).

Try iContact. I suppose the code is open. Also try PockeTwit from google code. Install these apps and if that is the effect you want to achieve, I suggest you grab the code and understand it (that's what I would do if I was in your position)

Related

"Wrap" a Today plugin

I have a little project in mind, but would like some input from the pros to cut research time:
Is it possible to "wrap" a Today plugin dll with another, providing a "pass through" for operations (such as screen taps, etc)?
What I'm trying to accomplish is this: Add selectability and other one-handed d-pad operation to an older plugin that is not selectable.
What do you think?
it's possible but the problem is that the plugin have to keep track on what plugins it include and which handles it have to pass to them
could end up big and slow
Rudegar said:
it's possible but the problem is that the plugin have to keep track on what plugins it include and which handles it have to pass to them
could end up big and slow
Click to expand...
Click to collapse
This is specific to a single plugin - it would only keep track of one.
Perhaps plan B would be easier - a plugin that manipulates another plugin. Such that it would "appear" the older plugin was selected, etc. I guess I'd better go study some more...
Actually its really simple.
Any plug-in DLL exports a function called InitCustomItem. In this function the plug-in does all its initialization, and creates its window. The return value is the handle to this window which you can subclass to add functionality.
as for selection, there is a value in the registry for each plug-in (HKLM\Software\Microsoft\Today\Items) which controls whether the system passes selection events to the plug-in or not.
it has three settings:
0 - non selectable, item will be skipped by the system.
1 - Automatic, the system will paint the item and handle selection on / off
2 - Manual, the system will pass the selection event to the item and the item will take care of the rest. In this mode the return value of the WM_ACTION determines whether the selection is moving on. This is good for multiline plug-ins that don't want to give up focus when arrow keys are pressed.
levenum said:
Actually its really simple.
Any plug-in DLL exports a function called InitCustomItem. In this function the plug-in does all its initialization, and creates its window. The return value is the handle to this window which you can subclass to add functionality.
as for selection, there is a value in the registry for each plug-in (HKLM\Software\Microsoft\Today\Items) which controls whether the system passes selection events to the plug-in or not.
it has three settings:
0 - non selectable, item will be skipped by the system.
1 - Automatic, the system will paint the item and handle selection on / off
2 - Manual, the system will pass the selection event to the item and the item will take care of the rest. In this mode the return value of the WM_ACTION determines whether the selection is moving on. This is good for multiline plug-ins that don't want to give up focus when arrow keys are pressed.
Click to expand...
Click to collapse
Hey, thanks for the response! I've set the Selectability registry item for the older plugin, and it's ignoring it - that's what started me on this little project.
I'm a software developer by trade, but not with C++, so I don't want to waste people's time here asking a lot of dumb questions. If you could point me in the right direction on a couple of things, I'll go off and learn:
1. If all I have is a dll and nothing else (no .defs, etc), can I determine all of the functions it exports (other than InitCustomItem)?
2. Process check: My custom plugin's InitCustomItem would call old-plugin's InitCustomItem, snagging old-plug's hwnd. New-plugin would then initialize it's own window - transparent(?) and pass that hwnd back to windows. Also, my custom plugin would pass all messages to old-plugin, etc. Theoretically, old-plug would look and operate like normal?
If this is already written, just sent me the code!
Well I am afraid it will be difficult to do all this without C++. As far as WM based devices are concerned you need to use something that translates in to native code to create system components like the plugins son ,no .NET languages, and embedded VB doesn't do well on anything never that WM 2003 (not even SE), plus I am not sure if you can make DLLs with it at all.
To your questions:
1) There is a tool which comes with VS 6 called Dependency Walker. It shows you what functions a given DLL exports, what it imports from other DLLs and what DLLs it is link to. Woks on EXE files as well.
If you can't get that, download a demo of IDA 5. It's the most powerful disassembler for WM devices out there.
2) Not sure, I never tried anything like that. The thing is, the system resizes the plugins, on initialization (it controls height) and when screen rotation changes so if you pass back HWND for a window other than the one visible, it might cause some problems.
I think what you should do is learn about subclassing. It's when you replace the procedure of an existing window with your own (just replace the function, not create new window). You then get all the messages for that window, you can do what you want and call the original function when you done.
By the way, if you want to learn about writing plugins there is an article with code samples on this site: www.pocketpcdn.com and a lot of other interesting stuff.
Good luck.
What plugin is it? It might be easiest just to rewrite the plugin if you've got the code.
V
levenum said:
Well I am afraid it will be difficult to do all this without C++.
Click to expand...
Click to collapse
I should have been more clear - I am using C++, I'm just have to learn how to program with it first!
vijay555 said:
What plugin is it? It might be easiest just to rewrite the plugin if you've got the code.
V
Click to expand...
Click to collapse
I don't have the old-plugin source code. My little project is to add some sort of d-pad operation to the WeatherPanel plugin, which you're probably familiar with.
Progress: I've written and deployed my first little plugin - based on the source code samples available in the internet.
Next step: In my InitializeCustomItem, I thought I'd try to call WeatherPanel's InitializeCustomItem (instead of creating my own window). Thing is, I don't yet know how to properly link the WeatherPanel dll to my project. As expected, it only exports two functions: InitializeCustomItem and CustomItemOptionsDlgProc (I used dumpbin.exe)
I'll keep plugging away - any input would be appreciated.
Thanks for your help!
It's real easy:
Use LoadLibrary and GetProcAddress functions to call functions in other DLLs without linking them.
levenum said:
It's real easy:
Use LoadLibrary and GetProcAddress functions to call functions in other DLLs without linking them.
Click to expand...
Click to collapse
What a coincidence! My studying led me to the same functions.
From within my plugin's InitializeCustomItem, I was able to successfully load the dll with LoadLibrayl, GepProcAddress of its InitializeCustomeItem (at ordinal 240) and call it. But it whacks the Today screen so that none of the plugins load.
Next I thought I'd try FindWindow and EnumChildWindows to find it and all it's children. Then manipulate them by sending messages...
storyr said:
What a coincidence! My studying led me to the same functions.
From within my plugin's InitializeCustomItem, I was able to successfully load the dll with LoadLibrayl, GepProcAddress of its InitializeCustomeItem (at ordinal 240) and call it. But it whacks the Today screen so that none of the plugins load.
Next I thought I'd try FindWindow and EnumChildWindows to find it and all it's children. Then manipulate them by sending messages...
Click to expand...
Click to collapse
Update: So far, so good. As it turns out, EnumChildWindows doesn't work on the PPC, so I used GetWindow to find the plugin's handle. I can successfully send messages to it and initiate various actions.
Question: I'd like to visually indicate (on the old-plugin) what's being clicked (such as drawing a box around it). Is it possible to draw things outside of my own window?
It is, but it's tricky.
You can always use the GetDC function to retrieve the DC for another window and paint on it, but the problem is that unless you subclass the window you have no way of knowing when it repaints it self and all your changes are erased.
levenum said:
It is, but it's tricky.
You can always use the GetDC function to retrieve the DC for another window and paint on it, but the problem is that unless you subclass the window you have no way of knowing when it repaints it self and all your changes are erased.
Click to expand...
Click to collapse
I tried that exact thing (GetDC) and drew a rectangle in it, but it didn't do anything. I realized the reason was the WM_Paint event wasn't firing on old-plugin, and when it did, my stuff was erased (just like you said).
Next idea - open my own dialog window than overlays old-plug. The entire window needs to be transparent - except for the visual indicators that I position where I want. When the user ok's, I close the window and send the click to old-plugin...
Thanks again for keeping tabs on my progress..
No offence, but with all these rather advanced programming tricks you are attempting just to "sup up" an old weather plugin it looks to me like you would be better off just writing the whole thing from scratch.
It you are familiar with WinInet and / or sockets this should be pretty easy and it will look and work much better than the hack you are attempting now.
Plus you can make it exactly the way you like.
levenum said:
No offence, but with all these rather advanced programming tricks you are attempting just to "sup up" an old weather plugin it looks to me like you would be better off just writing the whole thing from scratch.
It you are familiar with WinInet and / or sockets this should be pretty easy and it will look and work much better than the hack you are attempting now.
Plus you can make it exactly the way you like.
Click to expand...
Click to collapse
No offence taken. I thought of that, but I figured this would be a good way to cut my teeth a little. Once I complete this little project, I may pursue that route...
Question: Do you have a favorite forum (or forums) besides this site that you use for your research/programming questions?
This is my favorite forum
But here are couple more sites I found very valuable:
www.pocketpcdn.com - They have tips and tricks with code examples arranged in categories like how to make MFC dialogs not full screen or the one I used in LVMTime to put the clock back on the taskbar.
www.codeproject.com - It's not specific to WM development but has tons of interesting stuff including entire sources.
You should also check out www.buzdev.net If you're not familiar with the great work of buzz_lightyear you should see some of the stuff he did for this forum like grab_it - the invisible ROM dumper.
OT
Just a quick OT question:
If I would move some of the plugin-dll's from \Windows to \Storage Card, would it be enough to change the adress within the corresponding item in the registry entry HKLM/Software/Microsoft/Today/Items ?
Of course I'm not talking about plugins like tasks a.s.o but rather third party plugins
Cheers
hrb
It won't work.
The problem is that the SD card is mounted too late so if you put the plugins on it they will not be loaded when device boots up.
You can move them to the extended ROM this way or to a folder other than windows but there is no way to move start-up stuff to SD.
Thanks for the help with this "little" project. After many hours, the product is out for beta testing. When it's released, I'll post more info...
Finished!
It's finished. The app is called WP-Pilot and it provides one-handed operation of WeatherPanel. If anyone's interested, it can be found here. Here's how it ended up:
There's a plugin (WP-PilotPlugin.dll) with an options dialog, and an executable (WP-Pilot.exe).
When the plugin gets selected, it looks for Weatherpanel. If it finds it, it fires off WP-Pilot.exe
WP-Pilot.exe opens. It does this stuff:
Look for WeatherPanel, and get it's screen coordinates.
Read the registry and determine which layout file WeatherPanel is using.
Open the layout file and read it: Record the coordinates of each "clickable" item found. This was a real PITA because of Unicode.
Sort the coordinates for left-to-right, top-to-bottom order.
Select the first coordinate and position a tiny window (10x10) at that x-y position.
Draw a "pointer" in the window (the type and color depends on what's selected in the options).
Show the window and process input:
[*]Left/right pressed - selected the next/previous coordinate and move the window to that location.
[*]Up/down pressed - close WP-Pilot and tell the plugin we're done.
[*]Center button pushed:
[*]Send a mouse click to the WeatherPanel plugin at the coordinates
[*]Close WP-Pilot and tell the plugin we're done.​
Thanks again for your help!

Creating a tabbed interface in WM5\WM6

Hi
I'm trying to create a tabbed dialog for wm5\WM6 (something like BatteryStatus setttings). However I'm quite lost on how to do it. Umpteen searches on google cudnt get me anything specific. I have tried using the "Tab Control" in MFC, but coudnt figure out how to add things to tabs other than the first one..
I'm quite poor in U/I coding, so would appreciate a more wysiwyg kinda solution for adding things (After that I can manipulate them thru code no prob)..And moreover I need a solution in Native C++\MFC...
TIA
Hi shantzg,
I had use "Tab Control" in MFC App long back on PC but not in PPC.
I think it will still be similar.
The "Tab Control" only lets u define no of tabs and will also fire events on the basis of selection.
You hv to programatically show ur UI controls on the basis of these events.
you can look how they handled it in their source
https://sourceforge.net/projects/claunch/
http://www.nakka.com/soft/ptools/
Check out wxwidgets...
you can create the interface using a wysiwyg program like wxformbuilder, and you can try compiling it on windows using something like wxdevcpp. However to make it run on ppc, you'll need to install either .net professional ide, or embedded visual c++. Anyway, you'll have to spend a bit of time going through the wxwidgets wiki to get it working.
Thnx for the replies guys, I'll check out the recommended things and get back to u..
There are quite a few extras in there, but you can check out the code for LVMTime. I used tabbed dialog for its settings (using C++). Basically each tab is a separate dialog with its own handling function and I show the one needed when the parent dialog receives a message from the tab control.
Thnx for that levenum, ill take a look..havent been able to check out any of things suggested so far due to paucity of time..will do so arnd weekend..thnx a lot all u guys..

Developing applications for Windows Mobile w touch navigation

Hi! I am a beginner Windows Mobile developer.
I have a lot of application ideas on paper and I am starting to write the code next month. I have not yet decided on wether to use managed code (.net) or native code, but I am looking for suggestions from any Windows Mobile developer in here.
Since I am a frequent traveler I am going to write a travel companion to keep track of itineries and meetings. I am also a keen geocaching geek, so I am also writing a geocaching application. Apart from existing apps I want my apps to be finger friendly. No stylus, one handed operation.
I need some help. I already figured out basics of finger operations, but I also want to find out if there is any public API to use (maybe a HTC developed one) to speed up the code (and the writing).
I have also seen references to HTC using custom touchscreen technology to enhance finger operation. Is this documented somewhere?
Regards
/Fraudulent

For .NET developers

I am currently working on a new framework to use on top of CF, that allows for fingerfriendly development on Windows Mobile phones, and would like to hear your thoughts and ideas (of cause this is a really early version).
The idea is to mimic the way that you create winform applications, but since it is based on the GDI+, you have the possibility to use it all the way from throwing a few buttons in an application, all the way down to just using the graphical manager to take care of load balancing.
Have a bit more details on my blog along with the first sample video showing the scroll feature, and the transistion effect between panels (basicly the same as forms).
The video
The blog
So if there are any features that you would like, please write me.

Changes in SDK 1.x -> 2.x

Hi there
not THAT much threads here related to development questions. Now it's absolutly ironic that I ASK this, cause Im no dev and coded the last small tools in C some 10 yrs ago. I'm a complete and definite noob in C++ ... bada SDK is my first contact with C++. I though it's interesting to try some first steps in bada.
Started in SDK 2.0.2. I found out that code examples in Internet relate to bada SDK 1.x and things seem to have changed here and there. After 3 days I was able to understand structurally what I collected together or found in help.
Question: What did you guys face as difference in 2.0 compared to 1.x?
I wasn't able to invoke the app "terminate()" command. What do I need to include/declare? I'm puzzled. this is the most difficult exit function of all languages I know
I had trouble to insert a photo as the splash screen. You guys have difficulties too?
More philosophic question: What do you think of Samsung, that they gave you SDK 2.0 and even started a competition, while there's STILL NO bada 2.0 device ready? So you can only test in Emulator or Remote ... is it normal in this industry that you don't have access to the target platform while creating an app?
Oh, just want to mention: I'm no competition - I'm too uneducated to code - and no time for a serious app.
Ray
Its simple, alot of things gone easier.
CustomList, GroupedList, SllidableList, IconList, ... all collected to two types
ListView and GroupedListView, they both are using SimpleItems (Image, Text, Option) or a CustomItem as we devs them wish. GroupedItems are in GroupedListView and saying itself what they does, both lists have a fast scroll option and automatically relocating on need their items. The best autoscroll for bigger text in elements and of cousre the behind Context menu for each item which can be changed in different ways if user slides left or right and so on. Finally to update the list, only UpdateList() is needet not after every change every item as i used in badaSI before.
Than we have the powerfull Gallery that provides all featuers to show pictures as you all saw it in badas Gallary App.
Then header and footer, very nice, devs can so made a good basci gui that looks good integreted to the os, the best function of them are the back button option with its listener, it reduces a lot of time.
My pesonal favorit is the extension for animation class, there you can make every thinkable animation for forms, panels, controls and other stuff, with some code lines. So the UIx is improved and no extra code is needet.
I would rather say that the 2.0 sdk makes c++ a lot of easier to use also for beginners, the api itself is self explaining for what it stands, so it is not like old c++ stuff bada SDK makes many things alot of easier than people think. And of course it has more oportunities than other ... and so on.
Push Notifications and some old unaccessable System Privilegs are now free to use for every developer. Auto resolution takes a lot of work from us all devs.
PThread is addet so porting applications from other oses like ios are much easier, in my oppinion useless cause i am not porting i am writing from scratch.
In a whole overview of the new sdk, a lot of new stuff that makes everything easier, and the old stuff is still in there to support older applications. so no visible changes are there if you see an custom list or a listview in voluntas as example, but the behind things made it a lot of easier and better for memory.
And so on....................
ah, so push noti was there before, but only to priviledged partner dev's right?
Lari, you list is your favourites? What of them will help most often? Header/Footer? Auto Resolution to unite higher and lower lever Waves? Let's see if there's still two separate bada versions for the 2 familys.
Ray
So finally I got the Terminate() function up and running ...
In the form.cpp I had to add these:
#include "<myappname>.h"
... to get declaration of my app name
using namespace Osp::App;
... to enable the Terminate function (don't know if the include makes this unnecessary now ... in "<myappname>.h the public Osp::App::Application,
is used as class
<myappname>::GetInstance()->Terminate();
... only with this the function worked.
Is this standard in C++? Help didn't show me this way, and it seems quite complicated for me as a former ANSI C amateur
Ray
hello? zehn zoicha kaesdreck!

Categories

Resources