Related
Hi
Am quite new to this, but it would appear there are quite many people familar with WM2003 (and it's various incarnations) here; so I figured it'd be the best place to ask this question:
a) How do I create a file (.cab or any other means) that I can run in my pocketPC that would load (or change) certain registry values in my Pocket PC?
b) Is there a location i can place a file within my pocket PC that will be loaded/run on every soft reset?
c) Is there a location i can place a file within my pocket PC that will be loaded/run on every wake up? (eg: everytime the power button is pressed and the screen comes on)
Things I'd like to do with the above; create 3 versions of a) above:
Drop a.1 into the extended rom so that on a hard reset; certain values are preloaded into the unit (eg: Owner name/ information/ various comon settings I always use/ etc)
a.2 + b would basically change my input method from 'keyboard' to 'block recognizer' after every soft reset (I just find it very annoying it switches back to 'keyboard' by default after my weekly scheduled sprite backup, or whenever I have to soft reset the unit.
a.3 + c would nuke the 'last owner' key in IIWPO so it'd send me a SMS everytime the unit is turned on; rather than only when the owner name changes. (if c) is not possible, I could drop it in b) so it'd resend an SMS on every soft reset instead).
Finally, I'd also like to know if anyone could recommend something or other I could read to learn how to write stuff for my PocketPC, and what tools you normally use. (I'd like to modify IIWPO; so that'd it'd resend an SMS every time any information is changed on the owner page (not just name); and/or to resend a new sms every 48 hours - or at least write some small code that would 'interact' with it, since the source doesn't appear to be available (?); eg: delete 'last owner' information every 48 hours...
Thanks!
for a.2b:
There are registry hacks to change the default SIP. Try Tweaks2K for an easy interface.
If you want to, try searching on the board for my program SIPwwitch to change the SIP from a shortcut, eg SIPswitch "Block Recogniser" (you'll have to look up the details on my other post on the development forum). Put this shortcut in your startup folder and it'll change the sip on every boot.
V
Runing on startup
Hi drean!
Here's how you make your program run automatically:
1. After hard reset: you must create a special folder on your devices flash drive (or whatever part of its memory that doesn't get wiped by hard reset. Not sure how memory is managed on XDA's on iPaqs there is a 'File Store'). The folder name must correspond to the number of your processor. (again for ipaq's PXA270 its 2577). In this folder place a file named autorun.exe This file will automatically lunch after every hard reset. (you can also do this with an SD or CF card see this thread http://forum.xda-developers.com/viewtopic.php?t=22861&highlight=grabit)
2. For your program to run after every soft reset place it or a shortcut to it in WINDOWS\StartUp (the program must not be on a storage card! You can also add a registry key with your programs path to HKLM\init.
3. To catch wake up events (power button) your application must be running and respond to power notifications. Here's the full explanations on how they work: http://msdn.microsoft.com/library/d.../wceddk40/html/cxconnotificationinterface.asp
As for how to program for pocket pc, here's a nice thread that will give you plenty of options: http://forum.xda-developers.com/viewtopic.php?t=29623
Hope this helps!
Good luck!
please suggest me some tools which realise "autostart" for my magician. The tool should run a program when i turn the magicion on.
Thanks!
Check out sktools. That'll do it I think.
V
use MemMaid. really usefull tool
Thanks!
Maybe somebody knows also a small (freeware) program?
try search at http://pocketpcfreewares.com or http://www.freewareppc.com maybe there's some. anyway, you can allways add a shortcut to app in the windows\startup dir (use totalcommander for this).
@dddrko:
as far as i understand, the startup folder starts only after reset, not at powert button...
This is a nice tool: Event driven application/command execute !!
http://www.kent7.com/holly/wakeapp/
It can start an application or run a command at about any 'event' = Meaning, whataver happens :
On a specific time or when ;
PC card changed
othe IR device discovered
Network (dis)connected
AC Power On/Off
full device data restore
RS232 conection made
data sync finisched
system time changed
timezone changed
Device wakes up
Haven't tested it yet, but looks mighty powerfull !
Good spot. These are standard events for the PPC, so SKTools, MemMaid and the lovely WakeApp should support them all.
V
jpiek said:
This is a nice tool: Event driven application/command execute !!
http://www.kent7.com/holly/wakeapp/
It can start an application or run a command at about any 'event' = Meaning, whataver happens :
Haven't tested it yet, but looks mighty powerfull !
Click to expand...
Click to collapse
Thats exactly what i mean, BUT its not working on my Magician...
I can see and set the events, but the program does not start.
ReflexNPG said:
jpiek said:
This is a nice tool: Event driven application/command execute !!
http://www.kent7.com/holly/wakeapp/
It can start an application or run a command at about any 'event' = Meaning, whataver happens :
Haven't tested it yet, but looks mighty powerfull !
Click to expand...
Click to collapse
Thats exactly what i mean, BUT its not working on my Magician...
I can see and set the events, but the program does not start.
Click to expand...
Click to collapse
Silly question maybe, but have you tryed resetting ?
Like i said, i haven't tested it myself yet...
from readme
** OS
PocketPC 2002
edit: tested it on my magican (wm03se), it works. great tool
shine on
@tom0_1:
could you please tell what exaxtly is working? Events,timer, ...?
OK, other way,
Example :
HKLM\Software\Microsoft\Shell\Event\Dock\Inbox
Command=Tmail.exe -RunInBKG
(retrieves new mail when Docked/Activesync on)
Also found :
HKLM\Software\Microsoft\Shell\Events\PowerOn\WMP
Class= WMP for Mobile Devices
On= 32837
(Resumes playing WMP after power on)
I guess adding a key in ether wil get you what you want also...
@jpiek: thanks, i will try it
About memmaid - i dont think that this tool can add entries to the notification queue...
Background: i have an old Magician (with long white beard), and i want to use it as remote control with Salling Clicker.
This program uses bluetooth and every time i turn on the device, it should start Salling Clicker (or bring to foreground) and reconnect the bluetooth connection (so my girlfriend can focus on what she wants to hear or see...)
i tried three items and all worked:
event by power on
event by changing sd card
timer
shine on
tom0_1 said:
i tried three items and all worked:
event by power on
event by changing sd card
timer
shine on
Click to expand...
Click to collapse
Ow Yeah, great... :mrgreen:
Repeat events?
With both memmaid and wakeapp, I can get a program to run once on a timer, but what I want to do is get the program to repeat daily at the same time. Memmaid seems to lack the ability to choose repeat; wakeapp shows "no end date" when one looks at the entry, but the notification disappears after it runs.
Memmaid can't do create recurring notification
I have verified with dinarsoft that memmaid can't put a repeating notification to run a program. The problem, they say, is that there is no facility to repeat and the way other programs do it is to write a few days worth and when that gets close to the end, write a few more.
Given this, wakeapp almost certainly can't either, since it seems to just be a "notification writer".
Can SKSchema run a program at the same time every day? An if so, can it then minimize the program?
Yes,
SKSchema can do repeating program runs, even do it only on Tuesdays or on the first of the month.
Hallo!
I'm working on an application called hTorch and although it is my first vb.net app I was quite successfull so far (at least I hope so ). But one think I'm just not able to achieve: Preventing the device from going into standby/suspend while the app is running.
In C++/C# there semes to be a system call "SystemIdleTimerReset()" but either there is no equivalent for vb.net or I was not able to find it.
Another thought was to modify the according registry key (HKLM\System\CurrentControlSet\Control\Power\Timeouts\BattSuspendTimeout) and to restore the original settings on program exit. This works fine except that WM does not apply the settings change immediately when it's done via registry. Again I did some research and again I only found a solution for C++/C# only. A system call named "NWUS_MAX_IDLE_TIME_CHANGED" tells the OS that the settings have changed and should be reread. I wasn't able to find something similar for vb.net though.
Does anybody know a solution for my needs?
Maybe someone could provide me with some sample code how he achieved this within vb.net?
Maybe some C++/C# programmer has build a library to access the power functions?
I would be really thankful for any help/hint you can give me!
Thanks in advance,
DeepThought
The standby mode is in the registry. Make a timer in VB.net and set it with an interval of about 5000 ms. Then make sure that ever time the timer ticks the standby mode will be disabled in the registry
Thank you for the quick response!
But the change via registry doesn't work. When I change the BattSuspendTimeout to 0 that does change the setting correctly. But they become not active. Only after a soft reset. It seems, that you somehow have to notify windows, that the settings have changed. Otherwise the will not be reread.
Any Idea how to achieve that?
I would also like to know if there is a way to prevent suspend.
I think only the pocket pc winmo versions do a real suspend where wifi and applications stop processing, and the smartphone winmo devices only kind of black the screen.
The only software I know is S2U2 which successfully can prevent "real suspend" and let e.g. my led notification work correctly.
Cause i cannot really use it on ks20 due to compatibilty issues i would be very interested in a reg hack, or (if there really is no reghack, i tried alot) some code snipets with which i could build a little app.
There's a pretty good article on CodeProject covering power.
*digs out link*
Here you go - http://www.codeproject.com/KB/mobile/WiMoPower1.aspx
It covers:
* Displaying the voltage, current, and temperature of your device's battery
* Changing the power state of hardware within the device
* Enumerating the hardware in a Windows Mobile Professional device
* Enumerating the power modes that a Windows Professional device supports
* Preventing a device from sleeping
* Toggling the state of the screen's backlight
* Waking up the machine to perform work without alerting the user or turning on the screen
[solution]
Thanks to AndyZap I can now answer the question myself
It is so simple, that I'm really ashamed now.
The magic word for me was PInvoke. Since I new the function I was searching for was an available win32 systemcall the missing link was how I can make this system call within vb.net.
So the actual solution are just two lines:
Code:
Declare Sub IdleTimerReset Lib "coredll.dll" Alias "SystemIdleTimerReset" ()
where "IdleTimerReset" is the name I've given the Sub. Which than just needs to be called like:
Code:
IdleTimerReset()
NOTE: This just resets the Idle timer once. So if you want to prevent the device from going into standby you have to reset this timer every time before it reaches the threshold. (The windows default setting is 60 seconds AFAIK).
THANK YOU AndyZap for your Help via PMail!
DeepThought
Thank you for your answer Northernmost!
I really love this community!
I found that many of the latest ROM cooks of WM6.1 have the annoying issue of Activesync always starting itself every minute... i searched a lot and found the best common solution is the fake account with manual settings...
After playing around with the registry i managed to find a better way.
Just open your favourite registry editor and set the value:
HKCU\Software\Microsoft\ActiveSync\KeepAlive
to 0
and enjoy.
Hope this will help future cooks to use this feature in their ROMs.
Cheers
Personally, I've been trying to read up on editing embedded database files (and CEDB files) to fix this situation once and for all. I've hex edited mxip_notify.vol and removed the repllog.exe call for AS after a time sync (which is the main reason AS starts up roughly every minute). It works, though when checking the notification queue there are three empty notifications that I'm not sure whether they hurt performance or not. Ultimately, if someone is able to get the WM5 or WM6 (6.1) SDK and knows how to edit EDB's or CEDB's (in a volume, of course. ), I'm sure the community as a whole would greatly appreciate it. I'll keep working at it; however, I've never used VS 2005 so I have a nice learning curve to navigate.
i already try the reg edit method,but it still come back when i softreset my phone.
the best method is the fake server. =)
Keep in mind also that on the 6.1 ROMS, if the Automatic Time Zone setting is enabled in the clock settings menu, it will continue to load up activesync periodically. Disabling it, at least for me, keeps activesync at bay...............
The hex edited mxip_notify.vol works great for me, I can still leave the Automatic Time Zone setting enabled without any AS problems. Just would like to eliminate the blank notifications in the queue.
I can post my edited mxip_notify.vol for anyone that wants it. The only thing is that it needs to be cooked in. So chefs would have the most benefit of this.
EDIT : By request, here is my modified mxip_notify.vol. When cooking simply replace the mxip_notify.vol in the SYS\Shell folder. Enjoy.
KMFM$ said:
The hex edited mxip_notify.vol works great for me, I can still leave the Automatic Time Zone setting enabled without any AS problems. Just would like to eliminate the blank notifications in the queue.
Click to expand...
Click to collapse
Yes please. Unfortunately, this might introduce one of my pet hates about WM6.0 - the blank notifications...
rling said:
Yes please. Unfortunately, this might introduce one of my pet hates about WM6.0 - the blank notifications...
Click to expand...
Click to collapse
No problem. Check my post above I've added the file there. I simply wish that I had the skill (and time to learn) to edit the volume properly to eliminate the notifications. Oh well.
bradipo.xda said:
Just open your favourite registry editor and set the value:
HKCU\Software\Microsoft\ActiveSync\KeepAlive
to 0
Click to expand...
Click to collapse
for me on polaris with syrius r4 the regkey seems to work... changed it yesterday and no active sync since then! so many thx!
oh, well... looks like the "keepalive" edit is only a partial solution. It works only until AS is started again (USB connection, launching it manually, or timechange if not disabled in the notify queue).
I played a bit with AS and here's what I found 'til now.
Everytime it starts it checks if a partnership with an exchange server is set, if not the "keepalive" value is set to 1.
If there's a partnership and the schedules are different from both "manual" it sets the keepalive again to 1.
That's why reg_editing the value lasts only temporarly.
So, the only way for not having A.S. "alive" is having a partnership with something and the sync schedules both set on manual...that's why the fake server is the best method, but I was searching for a way to "cook it in".
For the partnership issue i found this workaround.
Add the key {00000000-0000-0000-0000-000000000001} under [HKCU\Software\Microsoft\ActiveSync\Partners\]
and the string Engine="{22C7DA12-F3FD-4875-8344-7786454F6534}" in that new key.
This will create a fake partnership with a dummy exchange server without having to go through the configuration menu, so this tweak can be used for cooking.
The second part require a bit of databases manipulation. Actually i know what to change and where but i'm not able to figure out how to cook this (in particular i need to know how the pim.vol database is created in the first boot).
I'll play some more tomorrow and will post what found... and eventually i'll try to solve the empty entries problem...now is time to have some sleep
attached there's a .reg with the tweak mentioned... cheers
Alternative method
Hi,
I've used the fake exchange server method before, but I prefer to use SKTools to do the job. Been using SKTools for over two years and this feature has been available since then.
Download SKTools from http://s-k-tools.com/
Install SKTools and disconnect your PDA.
Make sure activesync on the PDA is closed (not minimized).
Go to the Tune-up section, and enter the activesync tab.
Change "AS auto connect" from yes to no.
No need to soft-reset.
Done!
Note that the PC will still detect the PDA, and this is reflected in Device Manager, but Activesync (WinXP) and Windows Media Device Center (WinVista) do not start. There is no syncing.
The PDA will also detect the connection, and activesync will start in the background, but it will not sync anything.
I use this method to charge my PDA without activesync starting when I don't need it. Hope this works for you too.
Hi,
Thanks a lot mi friend !!!!
mosestan said:
Alternative method [...]
Click to expand...
Click to collapse
thx for the directions, but... looks like the tweak you posted is intendend for keeping AS from starting on the desktop, while were trying to do the opposite, stopping AS from starting itself every minute, and makin' it a permanent cooked tweak ready for ROM flashing...
anyway, there's no real need of sktools to do that, is the same option in actyvesync-connections
or through registry key
HKCU\ControlPanel\Comm\AutoCnct
there's still some work to do
bradipo.xda said:
oh, well... looks like the "keepalive" edit is only a partial solution. It works only until AS is started again (USB connection, launching it manually, or timechange if not disabled in the notify queue).
I played a bit with AS and here's what I found 'til now.
Everytime it starts it checks if a partnership with an exchange server is set, if not the "keepalive" value is set to 1.
If there's a partnership and the schedules are different from both "manual" it sets the keepalive again to 1.
That's why reg_editing the value lasts only temporarly.
So, the only way for not having A.S. "alive" is having a partnership with something and the sync schedules both set on manual...that's why the fake server is the best method, but I was searching for a way to "cook it in".
For the partnership issue i found this workaround.
Add the key {00000000-0000-0000-0000-000000000001} under [HKCU\Software\Microsoft\ActiveSync\Partners\]
and the string Engine="{22C7DA12-F3FD-4875-8344-7786454F6534}" in that new key.
This will create a fake partnership with a dummy exchange server without having to go through the configuration menu, so this tweak can be used for cooking.
The second part require a bit of databases manipulation. Actually i know what to change and where but i'm not able to figure out how to cook this (in particular i need to know how the pim.vol database is created in the first boot).
I'll play some more tomorrow and will post what found... and eventually i'll try to solve the empty entries problem...now is time to have some sleep
attached there's a .reg with the tweak mentioned... cheers
Click to expand...
Click to collapse
That's good info, bradipo.xda. Have you looked at using CeRegEditor to help with finding the other necessary entries? You can perform a "before and after" comparison of the registry for detecting registry changes. I would look into it personally, however, I'm a little to busy to do so right now.
SOLVED
Here I have attached an mxip_notify.vol with ceipui and the timed repllog entries removed AND I have attached a provxml that will set sync times to manual without creating the fake server. This combination effectively prevents ActiveSync from restarting itself every few minutes.
I use this reg key, didn't see it mentioned here.
Code:
[HKEY_LOCAL_MACHINE \ System \ ActiveSync \ Engines \ {176F4FFD-F20C-4bd4-BDD7-01D0726C567B} \ Settings]
"SyncAfterTimeWhenCradled"=dword:00000000
Change the dword value to 0 as shown above, which means manual sync. The default value is 5, 5= 5mins, 15= 15mins, etc
firefly123 said:
I use this reg key, didn't see it mentioned here.
Code:
[HKEY_LOCAL_MACHINE \ System \ ActiveSync \ Engines \ {176F4FFD-F20C-4bd4-BDD7-01D0726C567B} \ Settings]
"SyncAfterTimeWhenCradled"=dword:00000000
Change the dword value to 0 as shown above, which means manual sync. The default value is 5, 5= 5mins, 15= 15mins, etc
Click to expand...
Click to collapse
that keeps repllog.exe from running in the background?
selyb said:
that keeps repllog.exe from running in the background?
Click to expand...
Click to collapse
Only one way to find out lol, seems to but will need more time to see if suddenly launches again?
Something to do with TouchFlo3D
Hi All,
I don't have the time to look into this myself, but I found that when I disabled touchFlo 3d to try out Mobile Shell, active sync never started up randomly. As soon as I turned TF3D back on... active sync kept coming back.
Just putting this out there, see if it helps anyone find a fix for that damn activesync.
The best and easiest solution
Holy cow people!, that's some crazy junk you're trying out there. I applaud your efforts but there is a much easier way.
As you know...
1. Disable the Repllog Notification (Apprunaftertimechange) in the Notification Window.(recommmend fdc taskmanager for this)
2. Registry hack [HKEY_CURRENT_USER\Software\Microsoft\ActiveSync] locate value "Keep Alive" change this to "0" for disabled.
But now the enlightenment...
3. Use fdcsoft's registry editor to tap and hold "KeepAlive" and select "Export..." (or chose from file menu) This will export this one value to a .reg file. Put this file in your \\Windows\StartUp folder. Now if you don't already have a program to "run" .reg files, you need to associate them with TaskMgr.
4. Using Total Commander, tap and hold your .reg file and select "Properties". Select "Associate" tab. Tap the gray box that says "Associate..." In the "Command:" box, reference the location of TaskMgr.exe (ex. \Program Files\FdcSoft\TaskMgr\TaskMgr.exe) In "Parameter:" box, leave the "%1" and add "/silent" (%1/silent) This keeps a dialoge box from popping up.
6. "OK" the changes and enjoy!
Now when windows starts it will "run" the .reg file and change the 1 back to 0. Problem solved.
bye bye Activesync!
fsb2cool2care said:
Holy cow people!, that's some crazy junk you're trying out there. I applaud your efforts but there is a much easier way.
As you know...
1. Disable the Repllog Notification (Apprunaftertimechange) in the Notification Window.(recommmend fdc taskmanager for this)
2. Registry hack [HKEY_CURRENT_USER\Software\Microsoft\ActiveSync] locate value "Keep Alive" change this to "0" for disabled.
But now the enlightenment...
Click to expand...
Click to collapse
Ok, best and easiest are matters of opinion. IMO, installing the cab I provided here is easier than the 6 steps you provided and doesn't require anything to be run at startup since Activesync will not try to run on its own anymore. But, that's only my opinion and it goes without saying that each person should do whatever works best for him or her.
hi, I was hoping that you are able to help .... i am permanently mounting my my wince6 Apical AT12X gps within a replica sunvisor in my car ... i want the igoPrimo program on the gps to start as soon as the engine is running, without any interaction from me or pressing any menu buttons on the touchscreen ... so essentially, unlike most people i want to lock my device ... i do not need file or video viewers, mp3 players or games, just iGo Primo which has detailed raster maps ... youtube[dot]com/watch?v=urX3rERYZf4
looking at the MioPocket4fv installation script, a section codes adding an entry into the "init" section of the registry to detect whether an SD card is inserted, and if it is, autorun a program
this would be a good way to directly run Primo, without hacking the GPS software too much, and removal of the SD would return the GPS device's operation to factory default
can you advise what the registry settings should be if i were to do this manually ... i do not fully understand the index number concept... a screenshot of my registry is attached, i am quessing the ceSd2577 program should be stored on the NandFlash partition, and the SDMMC / sd card would have the autorun / mortscript calling primo.exe
thanks in advance from New Zealand
antdavison said:
hi, I was hoping that you are able to help .... i am permanently mounting my my wince6 Apical AT12X gps within a replica sunvisor in my car ... i want the igoPrimo program on the gps to start as soon as the engine is running, without any interaction from me or pressing any menu buttons on the touchscreen ... so essentially, unlike most people i want to lock my device ... i do not need file or video viewers, mp3 players or games, just iGo Primo which has detailed raster maps ... youtube[dot]com/watch?v=urX3rERYZf4
looking at the MioPocket4fv installation script, a section codes adding an entry into the "init" section of the registry to detect whether an SD card is inserted, and if it is, autorun a program
this would be a good way to directly run Primo, without hacking the GPS software too much, and removal of the SD would return the GPS device's operation to factory default
can you advise what the registry settings should be if i were to do this manually ... i do not fully understand the index number concept... a screenshot of my registry is attached, i am quessing the ceSd2577 program should be stored on the NandFlash partition, and the SDMMC / sd card would have the autorun / mortscript calling primo.exe
thanks in advance from New Zealand
Click to expand...
Click to collapse
Adding an SD-Autorun feature to your GPS (which is running WinCE 6.0) indeed makes sense, because the app you start via "Autorun" simply overlaps default app as was intended by OEM. Means, it doesn't hurt anything.
Now to your questions:
1. ceSD2577.exe (extracted from MioPocket 4.0 FV package) must be installed on your GPS's nandflash in <nandflash-folder>.
2. With a Windows registry editor ( use CeRegEditor ) you simply import to your GPS's registry a .REG-file you created with Notepad with contents as following:
Code:
Windows Registry Editor Version 5.00
[COLOR="Red"]<-CR Carriage Return[/COLOR]
[HKEY_LOCAL_MACHINE]
[HKEY_LOCAL_MACHINE\init]
"Launch255"="<nandflash-folder>\ceSD2577.exe" [COLOR="Red"] <- <nandflash-folder> here is placeholder for the folder you created[/COLOR]
[COLOR="Red"]<- CR Carriage Return[/COLOR]
[COLOR="Red"]<- CR Carriage Return[/COLOR]
3. On SD-card in its root create folder 2577, and put there the package containing "Autorun.exe","Autorun.mscr" & Mortscript.exe
4. If SD-card is left in GPS, everytime GPS is booted and SD-card gets initialzed, then Autorun.exe present in folder \2577 of SD-card will be executed.
thank you so much
for taking time to reply soooo quickly ... i did not really understand the launch and dependency indices, but your MP4fv code was, and suggested regedit will, be very useful ...
check out my raster maps on youtube if you have time ... new zealand government have just released hi-res (< 1m) aerial orthophotos for 95% of the country for the cost of the hard drive they send it to you on, so could be porting these to iGo Primo for years
thanks again, I am very grateful
works flawlessly, you are a genius ... thank you
the OEM menu is now totally invisible until i exit iGoPrimo
just need to make some matching green-theme splash screens for power up and iGoPrimo loading screen, and my life will be perfect
so i am looking for some "green theme" Apical menu bitmaps, the menu looks like the attached image
the 800x480 menu files i am looking for are
residentflash2-bin-Main-Fore2-*.bmp
residentflash2-bin-Main-Animate2-*.bmp
residentflash2-bin-Main-MainLayer2-*.bmp
and maybe any *.ini file relating to GPSAni*.bmp
mine (AT12/atlasVI) are all archived into a single *.bin file, which i cannot unarchive, but in earlier versions of this shell (maybe AT10/atlasV), they are separate files ... these files will give me enough menu elements to make some matching splash screens for power-on and igoPrimo load .... i don't need to modify the apical menu itself
davison[dot]antony[at]gmail[dot]com
----
hi-res aerial orthophotos in igoPrimo (150km x 130km area, <1m per pixel resolution)
youtube[dot]com/watch?v=urX3rERYZf4
understanding the launch and dependancy indices
from
austech[dot]info/gps/31080-gps-launching-program-6.html
source is
blogs[dot]msdn[dot]com/b/mikehall/archive/2007/01/04/ce-6-0-booting-processes-with-command-line-options.aspx
==================================================================================
CE based devices have a couple of options for booting applications at startup.
1. The Registry.
The first option is to use the registry to launch processes during the boot process of the device, the registry key for launching applications is HKEY_LOCAL_MACHINE\Init - the registry approach has a couple of drawbacks - the first issue is that there is a dependency chain within the boot process, processes are started and need to signal back to the o/s that the process has launched (using the SignalStarted API) so that other dependent processes can also start - here's how this looks in a snippet from a device registry.
[HKEY_LOCAL_MACHINE\init]
"Launch20"="device.dll"
"Depend20"=hex:0a,00
"Launch30"="gwes.dll"
"Depend30"=hex:14,00
"Launch50"="explorer.exe"
"Depend50"=hex:14,00, 1e,00
Take a look at the "Launch50" line, this launches "explorer.exe", the standard Windows CE shell that looks somewhat similar to the Windows desktop shell - The Explorer process has dependencies on hex:14 (20 decimal) and hex:1e (30 decimal), this maps directly to the Launch20 and Launch30 processes - explorer.exe will not be started until the processes associated with Launch20 and Launch30 are started and have signaled the o/s that that have started, an application started through the registry must call SignalStarted to allow any dependent applications to also launch - an application launched through the registry gets its launch number (50 in the case of the Explorer shell) passed as a command line parameter - this is of course passed as a string, not a number, the SignalStarted API needs to pass a DWORD value as its parameter, so a process would use SignalStarted similar to the following.
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// Do some work here...
SignalStarted(_wtol(lpCmdLine));
The second drawback is that processes launched through the HKLM\init registry key cannot be passed any additional command line options beyond the launch key value which is then passed to SignalStarted by the launched application.
2. Startup Folder
The second option is to drop your application (or a shortcut to an application) in the operating system Startup folder (this is only implemented in the Windows Explorer shell) - The code that walks the Startup folder looking for processes to start can be found here - C:\WINCE600\PUBLIC\SHELL\OAK\HPC\EXPLORER\MAIN\exp lorer.cpp - take a look at the ProcessStartupFolder() function, it should be fairly easy to lift this code and implement your own startup folder code.
The advantage of using the Startup folder is that the applications don't need to know about the boot sequence of the o/s, don't need to be aware of the launch dependency chain, and could (if a shortcut is used) be passed command line options.
The downside of using the Startup folder is that all processes within the startup folder are launched at the same time - there isn't a dependency chain, or time delta betweeen processes launching - this could be an issue in some circumstances - let me give you an example - you may want to boot a CE device image and then connect to that device image from VS 2005 (so you can deploy/debug some managed or native applications), if you were to launch ConManClient2 and CmAccept from the startup folder you would have three minutes to configure VS 2005 with the correct IP address and then connect VS 2005 to the device - you might want to delay the launch of ConmanClient2 and CmAccept until the device has a valid and active IP address.
3. (did I say there were a couple of options?) SvcStart Services Sample.
John Spaith posted on the launch issue back in December 2004 - John wrote a sample called SVCSTART whose sole purpose in life is to start other applications with a delay period that can be configured through the registry - this sample was initially added to the CE product back at CE 4.1 and is still available today in CE 6.0 - C:\WINCE600\PUBLIC\SERVERS\SDK\SAMPLES\SERVICES\SV CSTART - it could be a little fiddly to get this built/added to your o/s image if you are just getting started with CE 6.0 development.
4. Project Socrates - AutoLaunch
To assist students taking part in the ImagineCup 2007 competition (and also to make it easier for any developer to launch applications on their device with delay, command line options, and also waiting until the device has a valid IP address) Jim Wilson and I have developed a simple application called AutoLaunch - the AutoLaunch application comes in a handy Sub-Project form so can easily be added to an existing CE 6.0 workspace. The functionality is similar to the SvcStart sample written by John Spaith but does have a couple of minor differences - the first is that the AutoLaunch program is launched through the HKLM\Init registry keys (much like any typical startup process) - the registry keys for adding AutoLaunch to the startup sequence are included in the sub-project .reg file, so you don't need to worry about this.
The second difference is that the AutoLaunch process waits until the device has a valid IP address before launching any processes - the reason why this is useful is that we wanted students to use their reference boards without needing a second monitor, keyboard or mouse (in effect the device is booting headless even though the CE desktop or launch application is being displayed) - in this case we want to launch the CE Remote Display application (CERdisp.exe) on the device with the command line "-c" (connect) which then broadcasts the device IP address/name to a listening desktop CE Remote Display application.
The CE Remote Display application can be found in the CE 6.0 catalog by searching for "cerdisp", the SYSGEN for the component is (strangely enough) SYSGEN_CERDISP. The desktop CE Remote Display application can be found here - C:\WINCE600\PUBLIC\COMMON\OAK\BIN\I386\cerhost.exe [NOTE: The CE Remote Display application is not the same as RDP/Remote Desktop, although RDP is supported as a client side application on CE 6.0 (SYSGEN_RDP)].
In the sample below we're launching the CE device side Remote Display application (cerdisp) with the command line "-c" to start connected, with a timeout of 0x1388 (5000ms, 5 seconds), and also starting the CE command prompt (cmd.exe) with a delay of 0x1f40 (8000ms, 8 seconds) - it would of course be trivial to also add ConmanClient2 and CmAccept to the launch process list.
[HKEY_LOCAL_MACHINE\Startup]
"Process1"="cerdisp -c"
"Process1Delay"=dword:00001388
"Process2"="cmd"
"Process2Delay"=dword:00001f40
Here's how the desktop CERHost.exe application looks when the device boots and runs the "cerdisp -c" command - notice the name of the device and the device IP address are both displayed in the Remote Host application (the IP address being displayed here is very useful for plugging into the VS 2005 Device Properties dialog!).
And to round off the blog post here's the Remote Display application running on my Vista desktop showing the CE 6.0 desktop - note that I can now use my desktop mouse and keyboard to remotely control the CE 6.0 device!
Using AutoLaunch and the CE Remote Display for hands on labs/training that use reference boards instead of the Device Emulator may be quite useful!
antdavison said:
works flawlessly, you are a genius ... thank you
Click to expand...
Click to collapse
Glad to hear this. Thank you.