Looking for help to get started... - Windows Mobile Development and Hacking General

I'd like to develop a simple app that does this.
- It takes the paths to two or more other application (.lnk and .exe) as arguments.
- It parses the arguments and upon launch it shies a screen with buttons to the files given in the arguments.
- If one of those gets pushed, it runs that file and closes itself.
- If none gets pushed, it closes itself.
Here's my problems:
I only have experience in Java programing, and my research into windows programing with C#, c++ amd .NET hasn't really led anywhere.
I have Visual Studio 05 and the required SDKs installed and it's easy enough to parse the arguments, etc.
Questions:
- What language/framework native/managed would you suggest I do it in?
- In that environment, how can I:
- create a popup as opposed to a window that is anchored top and left
- run other files (.lnk and .exe)
- implement the timer functionality
If you could point me to what classes to use for those or even supply very short code examples, I guess I could take it from there.
Thanks in advance,
Cheers,
nc

have u had a look at MortScript, you should be able to do it with that.

mugglesquop said:
have u had a look at MortScript, you should be able to do it with that.
Click to expand...
Click to collapse
I hadn't thought of that.
Good point, thanks, I'll take a look.

No joy.
While executing files, parsing arguments and timer functions are possible,the windowing features in Mortskript are somewhat limited.
I guess it has to be C++, after all.

My suggestion would be to try and write a desktop application that does what you want first and then port it - makes testing etc loads easier and nothing sounds really WinMob specific. For this project, I'd think C# or C++ should be fine

Sounds plausible, uccellino, thanks!

Related

Absuluut newbie, help on eMbedded C++ 4.0 please

Hello,
I'm a Visual Basic programmer for some time now.
Made some useful stuff they tell me.
Used C++ (Borland) about 10 years ago, so that’s a bit rusty.
Now I've ordered a Qtek 9090, and I would want to develop some software for it to. So I downloaded and installed the SDK and eMbedded C++ 4.0.
I thought, I start out on the emulator......
I can't even get my own "Hello world" program to work........
I have downloaded a "Hello World" program which I stepped through in debug mode. I have NO idea what they are doing there.
It contains about 20 files, hundreds lines of code, just to put "Hello World" on the screen of the emulator.
And I hoped that:
Code:
#include <stdio.h>
main()
{
printf("Hello, world!\n");
return 0;
}
pleased in a form, would do the trick………
The help in the IDE does not work.
Re-install it tell's me. I have done so, but the help function does not work.
Where is the "visual" part in the embedded Visual C++?
How do I place forms and buttons e.g.?
I have no idea where to start now.
Searched a lot of forum's for starters-help, but I can not find anything that helps me on my way. I just hope I've not become stupid.....
Would somebody please help me on my way?
Can I wholeheartedly recommend the book "Programming Windows CE", by Douglas Boling? It's normally cheap (or the second edition is) on ebay and it really is good.
Failing that, you're writing a console based application for something that uses a windowing environment by default, so you'll either have to change what you're linking to, or have a winmain that makes use of a graphical UI rather than stdout. Call MessageBox perhaps? This is all made *so* much easier with a working help system that you need to get that working.
You can manage resource files visually, so it really is Visual development. Plus, for free, it's an excellent development tool. Well, it isn't bad.
The best advice I can give is to get your machine set up correctly with EVC2002, or EVC 4 with SP4 and the appropriate SDKs, and take it from there.
Good luck starting out.
Cheers,
Nick.
chiark said:
Can I wholeheartedly recommend the book "Programming Windows CE", by Douglas Boling?
Click to expand...
Click to collapse
Thanx. I'm going to order that book.
Failing that, you're writing a console based application for something that uses a windowing environment by default, so you'll either have to change what you're linking to, or have a winmain that makes use of a graphical UI rather than stdout. Call MessageBox perhaps?
Click to expand...
Click to collapse
Well, yes. I know. Like I sayed, I usualy work with VB. It was just me, trying to oversimplify things.
What I ment to express is that I'm pretty supprised I still have to write the message-loop and the main-loop and the jsadgkh-loop and....
I just hoped to put up some forms and attach code to it. But maybe I'm missing the clue on this.
This is all made *so* much easier with a working help system that you need to get that working.
Click to expand...
Click to collapse
I have set it up on an other machine yesterday, and there the help works.
Today I'm going to make use of it.
You can manage resource files visually, so it really is Visual development. Plus, for free, it's an excellent development tool. Well, it isn't bad.
Click to expand...
Click to collapse
Well.... That part, the visual part, I don't see yet, but like I sayed, I'm going to work throuhg the help, now that I've got that working.
And a 'free' tool. Well, that's allways nice. I think it is good for us, AND good for them. The more software there will be on the market, the better the devices sell.
The best advice I can give is to get your machine set up correctly with EVC2002, or EVC 4 with SP4 and the appropriate SDKs, and take it from there.
Good luck starting out.
Cheers,
Nick.
Click to expand...
Click to collapse
Thanks for you tips.
Rens
Dox, drop me a PM, I've got an old copy of the book you can have if it would help
Re the message loop stuff, you've indeed got options. You can either use the message loop approach hitting the API directly, or you can opt for using MFC to abstract the stuff away from you.
Personally, I prefer the straightforwardness of using the API rather than MFC. By the time you've written one application, you've got the bulk of the next . I also write for older machines, and the overhead of MFC is a consideration, but on the XDA it really isn't.
If the application is simple, it can all be handled by a DialogBox. You will need to write a DialogProc to handle the appropriate messages, but the need to register a window class, get messages off the queue etc is removed from you. Similarly, you can have multiple pages on a single dialog box using propertypages.
If you did want to write a console application, you can do this but you need to change the linker options within EVC.
Have a good look at the samples, too, there's some real good stuff in there.
Cheers, and good luck
Nick.

Reading the registry with Visual Studio 2003

I'm developing a small application for my HTC Wizard, which I'm programming with Visual Studio 2003.
I need to open the shell application for M3U files, which I've tracked down to HKCR\M3UFile\Shell\Open\Command... but now I can't figure out how to either read that key to open the relevant player, or to execute the m3u file directly.
Because I'm using VS2003, I don't have access to system.win32 with the compact framework, so what techniques have others of you used to read or write to the registry?
Also, just as a side note, how do you find the current path?
Thanks,
Jon
There is no real concept of current path in CE. If you want to know the path your EXE is in, use GetModuleHandle(NULL) -- it'll return the fully-qualified path name of that process's EXE, from which you can parse out a path.
I'd advise against using the compact framework; .Net is a loser on PPCs as it just slows things down, taking up extra memory & cycles on a platform where both are in short supply. Use the real Windows APIs instead -- i.e. call RegCreateKeyEx/RegSetValueEx.
And if you choose to use Win32 API you can just call ShellExecuteEx()
and not mess with the registry.
RegQueryValueEx is what you need. Just set the appropriate type and buffer.
V
I'm always willing to learn new stuff... are there any good resources on programming for PPC without using .net?
I know there's EVC++, but I've installed it, and now I don't know what to do with it!
Regards,
Jon
JonTheNiceGuy said:
I'm always willing to learn new stuff... are there any good resources on programming for PPC without using .net?
I know there's EVC++, but I've installed it, and now I don't know what to do with it!
Regards,
Jon
Click to expand...
Click to collapse
You can either use EVC++4, which is free but has an aged, not-so-standard C++ compiler (since it based on VC++6...but it only means a few quirks), or you can use Visual Studio 2005 which is supposed to replace EVC.
Jon, not to state the obvious, but there are many c++ tutorials for the PPC on the interweb.
What kind of experience do you have?
V
I have no prior experience with C++ - I bought the C++ For Dummies book in a charity shop a month or so ago, but it seems to refer to software that isn't available any more!
My core experience is with PHP, and recently I've been more interested in VB.NET for small apps at work, but most of what I want to do is with Windows Mobile - for which, all I have is Visual Studio 2003, and my co. won't fund me buying VS2005 as I got it for an old project that I still maintain, and anything new I need to write for work I can do with VS2005 Express...
That said, I'm not afraid of learning a new language, especially something as powerful as C++.
C++ for dummies is excellent, the best I've come across so far.
Have a read through this:
http://forum.xda-developers.com/viewtopic.php?p=209136#209136
I'm currently unlearning and then relearning my c++ - one thing I've learnt coming from other languages - c++ requires discipline. It's not about shortcuts, you build up from the basics and keep going steadily. But you need to be logical, and prepared to put in the effort. So discipline - it's been a long time since I've had to think about that!
V

"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!

I want to make an app :D

Hello.
Do you know a site or thread which has basic instructions about making a "hello world" app for PPC? Just to get me started.
What tools do you guys use? (doesn't matter if they are free or not)
How do you export/publish it as a .CAB?
Thanks.
PS. I searched and didn't find a thread like this and I don't want to use somebody else's thread.
Are you familiar with programming?
I use Visual Studio 2005 to create my apps. It has the ability to create a *.cab file as well
Visual Studio 2005 is not free.
You can find tons of info at the MSDN.
You can also use some library simplifying access to pocketPC by taking care of all necessary OS calls. Xflib looks good, especially if you want to code games, there are also some examples provided with lib download, and sources for most games hosted on their site are available. Might be a good place to start if you'd like to avoid learning winAPI and get right down to coding the actual app Another good thing is that it uses open source ceGCC compiler, so MS Visual C isn't needed. Also, you won't really need to make CABS to distribute programs coded this way, since they consist of one single exe file.
Go to www.xflib.net for downloads and install instructions.
And if you're a total beginner when it comes to programming, I'd try scripting out first. Have a look at mortscript (good because of it's multi-platform usage) or AutoIt (for windows desktop)
Thanks for the answears so far .
I'm not a programming noob, but not profesional. I've done some apps and games. I plan to start with easy things first as a coin toss app... it comes quite handy... or perhaps a handy stuff thing, inclusing the coin toss, unit converting (there are many), dices, chronometer, etc. All with stadistics and many options, like a random mode and a rigged mode ;D for dice and coin toss...
Then move on to something greater, who knows.
For something like that I suppose visual studio is best. I'll try both anyway. Any advise?
By the way is there an emulator like toolkit for J2me? Something a friend can download to run it without a programming software (or a phone).
Thanks again.
Edit: I believe I found an emulator, at least for XFlib (found there).
Device emulators
visual studio has its own device emulators you just have to download the proper SDK's like WM6 sdk or WM5 sdk to be more device specific, it's supports emulator debuging and device debuging but apps made with VS tend to slower and more memory hungry than apps implemented in C. But for me it's the easiest way to app development.
can you post the emulators link or better yet the whole thing itself here if its small enuff? im also working in xflib and would be much easier to use a standalone emulator rather than the one with vs2008. thanks

Getting into WM5/WM6 programming?

I am interested in dabbling a little in programming for my Kaiser. I have programming experience, mainly php / mysql, though I have done some C and lots of scripting in my time. My biggest project so far though was an open source google maps mod to put on your website - thousands of lines of php / js code, mysql backend and AJAX tieing it together, some graphics routines etc, so I am no drooling n00b when it comes to coding.
How easy is it to develop basic stuff in WM?
I have access to MSDN, so I can get Visual Studio (2005 for sure, maybe later versions), so I think I have access to the apps I would need. I just ordered some books to help me along, but was wondering if I would likely face a steep learning curve.
All the stuff I want to do is today screen plugins - was thinking of having a bash at writing my own quick contacts plugin - *very* basic - just a vertically scrolling list of names over a transparent PNG button with maybe photos from the address book - I want it to be able to scroll by vertical gesture within an ultimatelaunch tab - is this likely to be quite easy and quite a good "first app" to program?
I was also looking at writing a lite repacement for phoneweaver as the only feature I use is to turn on BT when it detects power but no activesync (ie auto turn on BlueTooth when I am in the car and the device is cradled) - maybe a hack to force the keyboard backlight on in the same situation.
I have bought:
Microsoft® Visual C#® 2005 Step by Step (Microsoft)
Microsoft® Mobile Development Handbook [Paperback] by A. Wigley; Daniel... (Microsoft)
Comments / suggestions?
I would also be very interested in a thread or good reference on how to start to program app for mobile gadgets. Actually i'm a Delphi coder, and i would like to implement some applications on WM platform, but when i search over internet there's plenty of information, but no usefull information with "real-life" recomendations.
depend on the platform and language one wish to use really
there is c#.net, vb.net c++.net
c++ miniMFC, c++ PureWin32 sdk
oldVB
...
here are some other posts asking pretty much the same thing from the forum
http://forum.xda-developers.com/showthread.php?t=225405&highlight=programming
http://forum.xda-developers.com/showthread.php?t=237932&highlight=programming
http://forum.xda-developers.com/showthread.php?t=241670&highlight=programming
http://forum.xda-developers.com/showthread.php?t=245426&highlight=programming
http://forum.xda-developers.com/showthread.php?t=228043&highlight=programming
http://forum.xda-developers.com/showthread.php?t=317913&highlight=programming
http://forum.xda-developers.com/showthread.php?t=302548&highlight=programming
http://forum.xda-developers.com/showthread.php?t=327164&highlight=programming
http://forum.xda-developers.com/showthread.php?t=305926&highlight=programming
http://forum.xda-developers.com/showthread.php?t=336251&highlight=programming
http://forum.xda-developers.com/showthread.php?t=226412&highlight=programming
codeguru.com got examples of various windows mobile programs too today items and such
about delphi i dont know if anybody got some info i would say borlands site
Thanks rud. I was aware of various other posts, but my question was more of a "How steep is the learning curve?" rather than "How do you do it?".
There was also an element of "How do you do it?" insofar as there seem to be better or worse ways of going about various kinds of app (eg today apps with gesture support) which I am finding a bit of a minefield, but I feel that the new post was valid because I am giving an indication of my experience level and what I am trying to acheive - none of the posts you listed cover the combination of stuff I am trying to do. Reqs like pulling from outlook db and allowing gesture scrolling in a today plugin, I dunno, I may waste ages with C#, for example, only to realise it is a breeze with C++... I also note that a google search for wm programming gesture scroll today screen currently ranks this very thread #5. By tomorrow that'll be a googlewhack then.
Yes, there are various posts about how to get started, but I think maybe a sticky would be in order with a bit of info on the various paths - the vb/c++/c# options are quite bewildering - stuff like
levenum said:
Your question is mainly a matter of personal preference.
Here is my opinion on C++ vs. C#:
C++ advantages:
- Native code is faster than .NET
- Easier access to Win32 APIs
- Ability to write system components like keyboards and today plugins.
C# advantages:
- Saves on coding time
- Allows use of many .NET CF components to quickly accomplish complex tasks.
Please note that I am bias. I hate .NET and want nothing to o with it. Specially on mobile devices that do not have the processing power to spare for the .NET overhead.
Click to expand...
Click to collapse
is really useful, maybe if it were expanded upon, info such as for this route you need visual studio, etc, etc it would make a really good sticky for the dev section.
evilc said:
I am interested in dabbling a little in programming for my Kaiser. I have programming experience, mainly php / mysql, though I have done some C and lots of scripting in my time. My biggest project so far though was an open source google maps mod to put on your website - thousands of lines of php / js code, mysql backend and AJAX tieing it together, some graphics routines etc, so I am no drooling n00b when it comes to coding.
How easy is it to develop basic stuff in WM?
I have access to MSDN, so I can get Visual Studio (2005 for sure, maybe later versions), so I think I have access to the apps I would need. I just ordered some books to help me along, but was wondering if I would likely face a steep learning curve.
All the stuff I want to do is today screen plugins - was thinking of having a bash at writing my own quick contacts plugin - *very* basic - just a vertically scrolling list of names over a transparent PNG button with maybe photos from the address book - I want it to be able to scroll by vertical gesture within an ultimatelaunch tab - is this likely to be quite easy and quite a good "first app" to program?
I was also looking at writing a lite repacement for phoneweaver as the only feature I use is to turn on BT when it detects power but no activesync (ie auto turn on BlueTooth when I am in the car and the device is cradled) - maybe a hack to force the keyboard backlight on in the same situation.
I have bought:
Microsoft® Visual C#® 2005 Step by Step (Microsoft)
Microsoft® Mobile Development Handbook [Paperback] by A. Wigley; Daniel... (Microsoft)
Comments / suggestions?
Click to expand...
Click to collapse
Hey!
Congrats on getting your hands on with Windows Mobile...
The easiest way is to download Visual Studio 2005(2008 You have it on MSDN) - and create a new application with it.
It's sooo easy if you know your object oriented programming, as long as you want to create ordinary "office" applications... But if you want to do more advanced things(like creating a today-plugin) you need to go over to c++(even though you can download a .net home-plugin-container which acts like a "loader" for your plugin written in c++) - and also, if you want to create good GUIs, I think you are better off with c++... But then again, I think you need a bit more effort in learning c++ then using c#...
Hope this helps...
Still slogging my way thru this...
I got hold of an MSDN disc, first off I installed visual studio 6 - bad move.
Had to uninstall before trying to install VS 2005, now I think it has screwed something up, every time I try and create a "Smart Device Win32" project, I get a "Project creation failed" error. I may have to re-GHOST my OS to get rid of it
So much time just finding out what apps I need and what options to choose to start a project...
I found http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.HomePage which seems helpful
Thanks for responses!
Evilc, you link of msdn is excellent point, many thanks!
I have also just started programming in C++ ..i dnt have any knowledge of any type of codes..i learned every thing frm MSDN libraries ( i have many many of them caz i have VS 2006 VS 2005 and VS 2008 )..i recommend you to work with C++ because it uses less system resources and is fast..hope this helps..check out my Kitchen coded in C++ ( link in signature )
Yeah, I think C++ is definately more what I am looking for from what I have learned thus far.
Re-Ghosted OS - totally fresh XP SP2, installed Visual Studio 2005, still the same error. GRRR!
Visual C++ --> Smart Device --> Win32 Smart Device Project == "Project Creation Failed"
Other Languages --> Visual C# --> Smart Device --> Windows CE 5.0 --> Device Application == Project created OK.
Some posts I have found on the net say it is an IE7 issue, I may try uninstalling that or flashing back to an OS image with IE6 only, but this is really winding me up and taking a *lot* of my time...
I uninstalled IE7 and the problem went away. Woohoo!!
starting programming windows mobile
hello
1. see my web site.
2. see my book recommendations, especially the 'programming windows ce' by douglas boling. It has an example for many things and a today sample too. Most is based on visual c++ 3.0/4.0. Embedded Visual C 4 can be loaded free of charge at ms.
regards
josef
Nice site, thanks.
The windows mobile 6 sdk actually has a today screen sample, along with samples of most of the things I need to do.
neofix said:
It's sooo easy if you know your object oriented programming, as long as you want to create ordinary "office" applications... But if you want to do more advanced things(like creating a today-plugin) you need to go over to c++(even though you can download a .net home-plugin-container which acts like a "loader" for your plugin written in c++) - and also, if you want to create good GUIs, I think you are better off with c++... But then again, I think you need a bit more effort in learning c++ then using c#...
Hope this helps...
Click to expand...
Click to collapse
Are we using the same language?? Cos this (C++ Win32 for Mobile Devices) is by far and above the most difficult programming language to get into that I have ever tried. Yes, worse than ASM.
Trying to code an app that prints "Hello World" has taken me over 5 hours with no success yet - most languages I have a go at it's 5 minutes.
From http://msdn2.microsoft.com/en-us/library/ms901121.aspx :
Code:
int DrawText(
HDC hDC,
LPCTSTR lpString,
int nCount,
LPRECT lpRect,
UNIT uFormat
);
It gives a brief description of what the parameters are, but absolutely no examples and no explanation of what all the parameters do or how to initialize them, so even browsing an example is no use to me.
u can simply try
MessageBox::Show(" your message ");
ather90 said:
u can simply try
MessageBox::Show(" your message ");
Click to expand...
Click to collapse
Isn't that .NET ?
I thought the consensus was that Native Win32 or whatever it is called was the better way to go?
This is part of the problem. I cannot even work out what to put in a search engine to pull out info on the right "flavour" of C and for the pocketpc. It's *so* bewildering.
Hello evilc.
First I noticed you have some trouble with VS 2005. It probably won't be easy now, but if you ever get to format your machine again don't install it (unless you absolutely need some other features).
For C / C++ programming for WM device I strongly recommend eVC 4 as it is much lighter and responds quicker. (It's a free download as well)
Second, though you can program for WM in C# and VB .NET which are both .NET Object based languages and are probably much closer in form to PHP and Java then C, you can not write system components such as today plugins in those languages.
You need native code so C / C++ is the only way to go.
(Actually, there is a trick to combine C# and C++ DLLs to create a today plugin where C# will do the main stuff, but its pretty complicated)
What you need is to learn basic Win32 programming and using the windows API. They are almost identical for Windows Mobile and Desktop windows versions so any book on Win32 should teach you the basics.
(Personally I started with MS book on MFC and studio 6 but I would not recommend it)
Finally:
I would gladly explain the parameters of DrawText but I am not quite clear on how much familiarity you have with the Win32 mechanics, since the languages you are used to obscure them unlike C which gives you extra power but also makes you work much harder to get anything done.
Do you know how to handle messages, and how windows manages all abjects using handles? Any familiarity with GDI?
If not, it will be pretty difficult to explain.
levenum said:
Hello evilc.
Click to expand...
Click to collapse
Hello! <waves>
First I noticed you have some trouble with VS 2005. It probably won't be easy now, but if you ever get to format your machine again don't install it (unless you absolutely need some other features).
Click to expand...
Click to collapse
I tracked down the problem when I got home and installed on my desktop. When doing it on the laptop, whilst installing SP1 for studio 2005, I had hit "Not Now" to a reboot request and it had said installation failed. When I installed SP1 on my desktop and said "Yes" to the reboot request, the problem went away, so I guess it was fixed in SP1 but the installer is a bit picky.
For C / C++ programming for WM device I strongly recommend eVC 4 as it is much lighter and responds quicker. (It's a free download as well)
Click to expand...
Click to collapse
Wish I had that advice before as I wasted a day messing around with an MSDN CD, trying to work out what to install and what not. So does the eVC 4 download include an IDE? If not, what do you use?
Second, though you can program for WM in C# and VB .NET which are both .NET Object based languages and are probably much closer in form to PHP and Java then C, you can not write system components such as today plugins in those languages.
You need native code so C / C++ is the only way to go.
(Actually, there is a trick to combine C# and C++ DLLs to create a today plugin where C# will do the main stuff, but its pretty complicated)
Click to expand...
Click to collapse
You don't have to tell me twice to avoid the bloatware ****e
What you need is to learn basic Win32 programming and using the windows API. They are almost identical for Windows Mobile and Desktop windows versions so any book on Win32 should teach you the basics.
(Personally I started with MS book on MFC and studio 6 but I would not recommend it)
Finally:
I would gladly explain the parameters of DrawText but I am not quite clear on how much familiarity you have with the Win32 mechanics, since the languages you are used to obscure them unlike C which gives you extra power but also makes you work much harder to get anything done.
Do you know how to handle messages, and how windows manages all abjects using handles? Any familiarity with GDI?
If not, it will be pretty difficult to explain.
Click to expand...
Click to collapse
No GDI Experience. I take it this would be the library of choice for drawing the screen of a today screen app? Stuff like the HTC Home clock or the new Face Contacts - they would likely use Native C++ and GDI? Doesnt strike me as something you would do with a form.
Also, anyone got the skinny on vertically scrolling by click-and-drag inside a today screen app? Just a case of enabling a parameter? Has to be coded manually? Best way to do it smoothly? If you have seen the Conduits Pocket Player 3.x browse list - how it "eases in" and "eases out" at the ends of the list, has inertia so you can "flick" down the list, the alphabetical bar instead of the regular scroll bar - is that all coded manually or is there an api or something that can help?
Thanks for the help!
I just noticed your apps in your sig - checked out LVM time - noticed there was source - wooohoo! I generally pick these things up by example.
All that code just for a (configurable) clock on one line - wow. Great though, a really good example of a today app - minimal enough in functions so it is easier to suss how it all slots together, but full featured enough (implimented example of an options screen - yay!) to show how to do various things.
And Gnu as well! Nice, this will be the basis of my first test project too I think - at least now I have a framework to test out what I want to do and how to go about it without having to work out how to code the basis of the application.
I thank you from the bottom of my heart sir.
I tried to build it in VS2005, but I got a
fatal error C1083: Cannot open include file: 'todaycmn.h': No such file or directory
A quick google search showed todaycmn.h was part of the SDK, I found the file, dropped it into the headers section of the project, but no joy. I will probs just try eVC.
Oh, and having developed a today plugin, maybe you can answer this one:
As far as I can tell so far, debugging isn't very easy with a today app - something to do with the fact that the dll is not releasable? Is this an issue I will come up against? I hope its not a case of "reinstalling" the app each time you want to test... I was thinking maybe along the lines of have it as a normal app for debugging, then make it a today plugin when you want to build to use it?
I dunno, probably trying to run before I can walk, my books shoulda been here today, oh well. Sorry for all the questions...
@evilc:
Are you using standard Win32 or MFC?
You may want to try using MFC since you get the flexibility of native development but with some nice class libraries that make your life easier.
As for click and drag behavior, that is usually implemented by handling the WM_LBUTTONDOWN, WM_LBUTTONUP and WM_MOUSEMOVE.
When you get wm_lbuttondown you set a flag that says the user is dragging. You use wm_mousemove to update the stylus position as long as this flag is set, then you unset it on wm_lbuttonup.
That's the basic idea anyway. Someone made a post about gesture recognition in this forum a few weeks ago with sample code. You should see if you can find that.
Managed Today Screen plugins
See:
http://msdn2.microsoft.com/en-us/library/ms839442.aspx
for some background on the concept.
And:
http://www.christec.co.nz/blog/archives/279
Outlines what I think is a very ingenius technique for managed today screen plugins.
For those of you that want an easy way to make a today screen app in c#. Chris did all the C++ work for you.
Also I forgot to mention that the SDK samples cover all most every application type you can think of. Most of the good ones are Win32 though.
Also, keep in mind that you can use P/Invoke from your C# apps to call native APIs. So don't let people tell you you need to use C++ just because you can access more api's. I will say that you should use C++ for games, or other apps that require high speed or advanced GUI's (it is VERY hard to do interesting gui techniques with C# and interop, trust me).
And finally, I would highly recommend using the most recent version of visual studio you can get (especially if you're using vista), unless your machine can't handle a newer version. I say so because visual studio gets more and more powerful as an editor with each new iteration and I personally can't go back after I get used to the new features they introduce. And the new versions are almost necessary if you're going to do .net development.

Categories

Resources