Today background refresh - Windows Mobile Development and Hacking General

Is there any way to refresh the Today screen background without using
Code:
PostMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
That message causes the Today executable to reload all the plugins, so if I send that message from within a plugin, I will cause an endless loop...

Scewbedew said:
Is there any way to refresh the Today screen background without using
Code:
PostMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
That message causes the Today executable to reload all the plugins, so if I send that message from within a plugin, I will cause an endless loop...
Click to expand...
Click to collapse
Here ya' go...

hmm, you can create a simple check in ur app to avoid the loop (like a registry setting) if the value is set then dont post the message and then clear the setting..

That "Refresh Today.exe" seems to do the trick. What's the secret? Is there some API calls I can incorporate in my application?

No, can't do that. In order to be non-intrusive, my Today plugin must restore the original background image when it is unloaded. So the first thing that happens when I've changed the background is that my plugin gets unloaded...and I restore the background. Then my plugin gets re-loaded, and I change the background, which causes my plugin to be unloaded...

Scewbedew said:
No, can't do that. In order to be non-intrusive, my Today plugin must restore the original background image when it is unloaded. So the first thing that happens when I've changed the background is that my plugin gets unloaded...and I restore the background. Then my plugin gets re-loaded, and I change the background, which causes my plugin to be unloaded...
Click to expand...
Click to collapse
Will this program get rid of the taskbar at the bottom when the programs are no longer running? I have this problem with Palringo. Even after I close the program the taskbar is there with nothing on it.

Scewbedew said:
No, can't do that. In order to be non-intrusive, my Today plugin must restore the original background image when it is unloaded. So the first thing that happens when I've changed the background is that my plugin gets unloaded...and I restore the background. Then my plugin gets re-loaded, and I change the background, which causes my plugin to be unloaded...
Click to expand...
Click to collapse
About the refreshtoday.exe, it works because it is an exe, not a today plugin, hence it is not reloaded when the screen is refreshed.
And if the above statement was in response to my suggestion, then I think you didnt get what I suggested. I suggest the following steps.
1. Create a registry entry (say HKLM\mySoft\refresh) and init it with 0.
2) Have a check in the beginning of ur plugin to check for this registry entry. If value is 0 then you can refresh, if value is 1 just set it to 0 and do nothing.
3) Now, when you are about to post the refresh message, before posting set this registry entry to 1.
Following these three steps will do wht u want...

Related

Tip - How to Disable Clock

Hi folks,
You guys might already know about this but I just discovered how to do it after doing some heavy googling over the past couple of days. Many thanks to the guy at this link who made the discovery!
How to lock down the clock on Windows Mobile devices
I was reading through some of the messages on the microsoft.public.dotnet.framework.compactframework newsgroup when I came upon a real gem of a message.
The key piece of knowledge being, that there is a special registry key, that will disable GUI access for the clock on Windows Mobile devices.
Application State Registry Key for Windows Mobile Clock
HKEY_LOCAL_MACHINE\Software\Microsoft\Clock\
If this is set to 0x11 the clock is enabled, as by default. If it is set to 0x30, or probably anything not 0x11, it is disabled and ignores any attempts to run.
If you are writting any kind of salesforce automation applications, or route management software, then you can see just how useful this feature is. You just add a special admin feature to enable and disable the ability to set the time, or handle it entirely from within your application.
Now I just need to find out why this key even exists, since I hate to find out the OS likes to change it under circumstance X.
// disable clock
System.Byte[] offValue = new byte[1];
offValue [0] = 0x30;
OpenNETCF.Win32.RegistryKey registryKey =
OpenNETCF.Win32.Registry.LocalMachine.OpenSubKey(@"\Software\Microsoft\Clock\", true);
registryKey.SetValue("AppState", offValue);
registryKey.Close();
// enable clock
System.Byte[] onValue = new byte[1];
onValue[0] = 0x11;
OpenNETCF.Win32.RegistryKey registryKey =
OpenNETCF.Win32.Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Clock\", true);
registryKey.SetValue("AppState", value);
registryKey.Close();
Click to expand...
Click to collapse
And the link to the original source -
http://www.cjcraft.com/Blog/PermaLink.aspx?guid=0b590db3-cc90-45fa-822e-acf91f031052
I was pulling my hair out over that one the last couple of days!
Cheers,
Dav
Hi dav!
I am sorry to burst your bubble, but I tried this registry hack, and found there is an easy way around it, with out editing the registry.
If you hold the OK hardware button (in the center of the joystick, on those devices that have it) then tap and hold the clock (in the task bar) you get a little menu with 2 options: Run and Clock.
If you choose clock from this menu, the app will start and the registry setting will automatically be altered so you will be able to open clock settings normally from now on.
Further investigation showed that the lower 4 bit of the AppState walue (ones digit) simply selects on what tab the clock app will open. Legal values are 1-3. Any illegal value (like 0) will jam the app preventing it from opening by tapping the icon in settings. I suspect that if a command line switch is specified it overwrites the registry value and the app opens any way. (that’s how the menu works)
Just thought you should know.
Hi levenum,
Thanks for the insights! I just tried it too and sadly that is the case ;-( Mmmh, I wonder if there is a way to hide 'Clock' from the Run\Clock thingy? or disable the Clock in some other way?
mmh, back to the drawing board...
Dav
Here's what you might try:
Create a cab that deploys an empty clock.exe to windows directory on the device.
Clock.exe is a ROM file, but a cab should be able to overwrite it (it won't work manually). This way no matter who calls it (menu or control panel) they will see the empty exe and nothing will happen.
Sounds like a good idea to me! I'll give it a try and see how it goes. Thanks for your continued help
Dav
Worked nice Thankyou!
btw, do you think that overwriting the Clock.exe would have any effect on the 'displaying' of the date in the Today Screen? By clicking the date we launch the Clock.exe program, but something else other than Clock.exe must control what shows the current date, right? I mean, the current date wouldnt just stay on the date on which we delete Clock.exe?
Cheers and thanks again,
Dav
Actually, if the exe was responsible for the date on the today screen, you wouldn't see anything once you overwritten it. Today date is just another plug-in. I think its clockdll.dll but I am not sure. Whatever the file name, it takes the date directly from the system clock.
As I understand it clock.exe is just a little GUI utility for setting system time, and alarms.
That sounds right and what i was thinking, always good to have a second opinion for confimration.
All the best,
Dav
seems like you guys might know what your doing, so do you know how to get the battery removed and the clock back on the today screen of WM5 latest rom releases....
levenum said:
Hi dav!
I am sorry to burst your bubble, but I tried this registry hack, and found there is an easy way around it, with out editing the registry.
If you hold the OK hardware button (in the center of the joystick, on those devices that have it) then tap and hold the clock (in the task bar) you get a little menu with 2 options: Run and Clock.
If you choose clock from this menu, the app will start and the registry setting will automatically be altered so you will be able to open clock settings normally from now on.
Further investigation showed that the lower 4 bit of the AppState walue (ones digit) simply selects on what tab the clock app will open. Legal values are 1-3. Any illegal value (like 0) will jam the app preventing it from opening by tapping the icon in settings. I suspect that if a command line switch is specified it overwrites the registry value and the app opens any way. (that’s how the menu works)
Just thought you should know.
Click to expand...
Click to collapse
wow..thanx for this. worked like a charm on my wing (and 2 yrs after it was posted i might add =P). i thought my alarm clock was lost FOREVER!
Hi,
I found the following code in this discussion thread:
// disable clock
System.Byte[] offValue = new byte[1];
offValue[0] = 0x30;
OpenNETCF.Win32.RegistryKey registryKey =
OpenNETCF.Win32.Registry.LocalMachine.OpenSubKey(@"\Software\Microsoft\Clock\", true);
registryKey.SetValue("AppState", offValue);
registryKey.Close();
It looks pretty useful to me but It has some OpenNETCF keyword.
Please suggest me what is OpenNETCF? Is it an additional third
party compact framework and how can I get this?
Also, if it is inbuild reference by Microsoft, from where to get it?
-Abhishek Maitrey
OpenNETCF is an extra SDK for WiMo devices. Search for it....
In this situation it's not needed.

Issue: Today Plugin Options

I built a Today plugin (with a little help from folks on this forum) originally for WM5 devices (you can see it here). Everything works great.
Based on user requests, I re-targeted it to work on PPC 2003 SE devices also. Here's the problem: Now, the Options window won't open until the plugin is actually loaded. In other words:
1. After a fresh install, go to Today settings, highlight plugin, click options - nothing happens.
2. Check plugin, close Today settings, re-open Today settings - Options now work.
Any thoughts an why it behaves like this? I've compared the two versions ad nauseam, tweaked this and that to no avail. (this was built using VS 2005)
The options + the today item code are in the same dll and it dose not get loaded until after the items window is dismissed. This is normal behaviour and there is not much you can do about it. If you watch the task bar you will notice a flicker at this exact time (ie closing items window). I think a system-wide message is sent at that time to indicate a setting change. Find that message and you may have something to work with but there is no garantee that your item will get loaded even if you send that message during the installation.
OdeeanRDeathshead said:
The options + the today item code are in the same dll and it dose not get loaded until after the items window is dismissed. This is normal behaviour and there is not much you can do about it. If you watch the task bar you will notice a flicker at this exact time (ie closing items window). I think a system-wide message is sent at that time to indicate a setting change. Find that message and you may have something to work with but there is no garantee that your item will get loaded even if you send that message during the installation.
Click to expand...
Click to collapse
Hey - thanks for the help! Similar to your suggestion, I implemented a post-installation step (another first for me) that executes SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0); This refreshes the Today screen, causing my plugin to load immediately.
Perhaps version 1 always did this and I just didn't notice...

bring S2U2 to front after resume from suspend (step-by-step workaround)

thanks to SMYKUL in this post, who gave me this workaround. here's a step-by-step workaround for those who are not familiar with notification queue.
IMPORTANT: this workaround can be used only when the "Lock when device wakes up" S2U2 option is turned on
launch Task Manager
--> goto Notifications tab
--> click "add" toolbar (i.e. the second toolbar button)
--> fill in notification details as:
type = Application
app = \Program Files\S2U2\s2u2.exe
argument = <blank>
type = CNT_EVENT
event = The device woke up
--> soft reset
pp18 said:
thanks to SMYKUL in this post, who gave me this workaround. here's a step-by-step workaround for those who are not familiar with notification queue.
IMPORTANT: this workaround can be used only when the "Lock when device wakes up" S2U2 option is turned on
launch Task Manager
--> goto Notifications tab
--> click "add" toolbar (i.e. the second toolbar button)
--> fill in notification details as:
type = Application
app = \Program Files\S2U2\s2u2.exe
argument = <blank>
type = CNT_EVENT
event = The device woke up
--> soft reset
Click to expand...
Click to collapse
i don't really understand what this workround is for ! What do you mean by return from suspend ? I've no issue on my device : when I press power button, SU2U is here.
me too
the symtom is, sometimes S2U2 is brought to front when resume from suspend mode, but sometimes not. i noticed that the longer time my touch dual remained in suspend mode, relatively higher chance for having Today screen placed on top of the S2U2 screen. sometimes when not that severe, only top Start bar of the Today screen placed on top of S2U2, but not the full Today screen. i read some posts from the S2U2 thread and also a local forum that the same problem not only happens on my device, but some others... while obviously not every, which sounds very odd. when S2U2 not on the front, a symptom is, S2U2 can be found from the HTC Task Manager program list, meaning the S2U2 already brought to visible by iLock2 but not being on topmost due to unknown reason.
the workaround here is for sharing with those who suffers from the same problem while really like to use S2U2.
pp18 said:
the symtom is, sometimes S2U2 is brought to front when resume from suspend mode...
Click to expand...
Click to collapse
Hi.
I've seen somthing like that on my Niki.
I've notist that PIE was open, so i closed it and tried again. And bingo, there was S2U2 running.
I think there was other programs, that stopped S2U2 from running(On resume from suspend mode), but i cant remember other than PIE atm.
It seems that PIE just need to be running to stop S2U2, even minimized it still prevents S2U2 from resuming.
But you can still launch S2U2 manually, even if PIE is running, and then goto suspend mode.
muuu said:
Hi.
I've seen somthing like that on my Niki.
I've notist that PIE was open, so i closed it and tried again. And bingo, there was S2U2 running.
I think there was other programs, that stopped S2U2 from running(On resume from suspend mode), but i cant remember other than PIE atm.
It seems that PIE just need to be running to stop S2U2, even minimized it still prevents S2U2 from resuming.
But you can still launch S2U2 manually, even if PIE is running, and then goto suspend mode.
Click to expand...
Click to collapse
a pity that it is not my case. the case you mentioned was when any S2U2-excepted programs (determined by S2U2 EXE1-9 registry keys) are running. in this case, S2U2.exe is not turned to visible at all. (symptom: S2U2 cannot be found from the HTC Task Manager program list)
in my case, i could see S2U2 being launched first, then in a flash the Today screen overlays on it. in some cases only the top Start bar overlays on S2U2, in some other cases the whole Today screen overlays on S2U2. (symptom: S2U2 can be found from the HTC Task Manager program list)
i suspect it's because i've modified the GLYPHCACHE size or any other system tweaks that makes the Today screen taking longer than usual to be redrawn, resulting in a later point of time than S2U2.
That's what I want only backwards!
I would like s2u2 to lock my phone but be able to see the today screen (in the background) is there any way to do that??
hi, i saw this odd behaviour on my polaris, was quite annoying, not to mention making my phone look like a dog's dinner!!

Need help for Gsen!!!

Hey guys,
I just got my HD and have really no clue how to get the gsen to work so i can write sms and emails in landscape. Also I would like a few other applications to be in landscape too.
Can anyone help me??? It would be greatly appreciated.
Can someone please help me? or give me website that gives instructions? I really need help for this!!!!!!!!!!!!!!
gsen should by default enable landscape for almost any app (with some exceptions like tf3d and so on). after installed you should run gsen manually and then notice if the screen rotation is working. then if you like etc you can run gsen cfg and set it to autostart via left soft key.
crashDebug said:
gsen should by default enable landscape for almost any app (with some exceptions like tf3d and so on). after installed you should run gsen manually and then notice if the screen rotation is working. then if you like etc you can run gsen cfg and set it to autostart via left soft key.
Click to expand...
Click to collapse
Is it the best software for the HD to use for auto-rotation? Also how do i install it on the phone? thats my main problem. It seems to have come already pre-installed but cant figure out how to work it....
simply download the cab trasfer to phone and tap on it from the phone
OmZ said:
Is it the best software for the HD to use for auto-rotation? Also how do i install it on the phone? thats my main problem. It seems to have come already pre-installed but cant figure out how to work it....
Click to expand...
Click to collapse
Pre-installed?..... GSen doesn't come pre-installed.
Where did you get it from?
He's probably just talking about the original rotator that excludes most everything, aside from the media/internet based programs.
Works??
Hi again.
I installed the prog right now, started and open the settings. Screw the phone -< works fine. close settings, open programs, tur the phone again -> nothing happens. Like in nearly) every other program. Opening the settings again, nothing happens too.
So i turned the GSEN off an on again sometime, settings work but nothing else.
WHAT'S THE PROBLEM???
Thx for reply
Did you read the readme.txt file that came with gsen?
Works fine on my HD
Here is a part of the file:
1. Description
Auto-rotate screen on SOME devices with g-sensor.
Install GSen and run it.
If you run it again, program will ask you "Unload program?".
If you answer yes - program will be unloaded.
This also possible without question with parameter #unload.
You can use configuration shortcut for edit configuration file.
This file can include this command:
#window(text or class name) - add window description
#timeout(value) - default value 1000 ms
#onlyfor(0|1) - if 0 auto rotate work for all programm except defined by #window, otherwise ONLY for this program.
By default program not rotate screen if Manila or Teeter is foreground application, but you can edit this list.
#fdscreenoff(0|1|2) - if 1, program will switch off screen if you put device with screen on bottom, if 2 device will suspend.
#lockscreen(0|1) - if not present = 1, can prevent, if enabled, rotation with locked device
#poweroff180(0|1) - if not present = 0, determine interpretation of rotation to 180, 0 - rotate screen, 1 - power off.
GSen can indicate self state,
you can setup it with this commands:
#show(0|1) - if 1 GSen will show one pixel (by default) indicator on top bar.
#x(X),
#y(Y) coordinates of this indicator, default X=240,Y=1
#clr(R,G,B) - color, default white (255,255,255)
you also can setup width and height (#width(W), #height(H))
Commandline parameters:
#load - load app, if loaded already - exit without questions
#unload - unload app
#toggle - if loaded will unload, otherwise will load, usable with one shortcut
#about - show about window
if you start without parameters - program will ask "Unload?" if already exist one instance, or simple run if not exist.
NOTE: some programs, like Teeter game, cannot start in landscape mode, so switch to standard display orientation before.
Cheers
Yep
... I did.
First time I installed it I changed someting in the configfile as advised. But it doesn't work so in uninstalled and reinstalled it. Then started the prog.
SOMETIMES the picture turnes but not everytime.
I've got a HTC Touch Diamond :-o Shouldn't be the problem i guess...
Okay...
I just changed timeout to 5 and it works just fine on HTC touch HD
Guess it shoudn't be a problem on Diamond.
What is the Contacts program name?
In the GSen Configuration file, I want to be able to tell the program to leave the Contacts screen alone (to not rotate). The only problem I have is that I don't know the actual program name for Contacts, and where is it located?
Thanks,
Peter
Got it ...
I figured it out. When I entered the following command into the GSen configuration file:
#windows(Contacts)
It didn't work because I didn't first save it. Now that I've entered it again, and then saved the file, it works.
Peter
Is there any way to set it to rotate the Today screen? I'm using the default config and all programs rotate apart from Today.
Steeph said:
Did you read the readme.txt file that came with gsen?
Works fine on my HD
Here is a part of the file:
1. Description
Auto-rotate screen on SOME devices with g-sensor.
Install GSen and run it.
If you run it again, program will ask you "Unload program?".
If you answer yes - program will be unloaded.
This also possible without question with parameter #unload.
You can use configuration shortcut for edit configuration file.
This file can include this command:
#window(text or class name) - add window description
#timeout(value) - default value 1000 ms
#onlyfor(0|1) - if 0 auto rotate work for all programm except defined by #window, otherwise ONLY for this program.
By default program not rotate screen if Manila or Teeter is foreground application, but you can edit this list.
#fdscreenoff(0|1|2) - if 1, program will switch off screen if you put device with screen on bottom, if 2 device will suspend.
#lockscreen(0|1) - if not present = 1, can prevent, if enabled, rotation with locked device
#poweroff180(0|1) - if not present = 0, determine interpretation of rotation to 180, 0 - rotate screen, 1 - power off.
GSen can indicate self state,
you can setup it with this commands:
#show(0|1) - if 1 GSen will show one pixel (by default) indicator on top bar.
#x(X),
#y(Y) coordinates of this indicator, default X=240,Y=1
#clr(R,G,B) - color, default white (255,255,255)
you also can setup width and height (#width(W), #height(H))
Commandline parameters:
#load - load app, if loaded already - exit without questions
#unload - unload app
#toggle - if loaded will unload, otherwise will load, usable with one shortcut
#about - show about window
if you start without parameters - program will ask "Unload?" if already exist one instance, or simple run if not exist.
NOTE: some programs, like Teeter game, cannot start in landscape mode, so switch to standard display orientation before.
Cheers
Click to expand...
Click to collapse
i dont understand any of this talk.. if you go into the gsen edit screen, are those what will not rotate? eg, i would like to see the settings screen rotate, how do i add that? would it be something like #window(settings.exe)

[Q] How to hide the GSM line icon

Is it possible to hide the gsm line icon "1" from the titlebar in WM 6.5 ?
Good question! I hate the "1" in my task bar!
Seems it can't be done...
in registry edit this key, works instantly.
Code:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\RIL]
"ALSService"=dword:00000000
one flaw: gets re-enabled with every phone restart...
caliban2 said:
in registry edit this key, works instantly.
Code:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\RIL]
"ALSService"=dword:00000000
one flaw: gets re-enabled with every phone restart...
Click to expand...
Click to collapse
a mortscript can solve that
paste a .lnk to this script into /windows/startup
regwritedword("HKLM", "\Drivers\BuiltIn\RIL\ALSService", "0")
BTW, what other icons can you dissable like this on the topbar?
Rn
hehe, been at this point 2 years ago... ^^
mortscript won't work this way. the reg-key get's reset with first pin-unlock after reboot, not during boot-process itself (startup-dir). so, unless you can trigger the script with pin-unlock, it would get set to 0 during boot, after pin it get's set to 1 again.
i tried with a startup-link to a reg-file back then, works the same way as mortscript (reg-files associated to sktools, resco would work too). settled with opening that link manually once after unlock.
(enabling flight-mode and then re-enabling phone doesn't bring the line-icon back, it's really just the very first pin-unlock after reboot)
dunno about disabling any other icons in taskbar, but them i want anyway.
In my ROM I remove the icon and edit the registry.
caliban2 said:
hehe, been at this point 2 years ago... ^^
mortscript won't work this way. the reg-key get's reset with first pin-unlock after reboot, not during boot-process itself (startup-dir). so, unless you can trigger the script with pin-unlock, it would get set to 0 during boot, after pin it get's set to 1 again.
i tried with a startup-link to a reg-file back then, works the same way as mortscript (reg-files associated to sktools, resco would work too). settled with opening that link manually once after unlock.
(enabling flight-mode and then re-enabling phone doesn't bring the line-icon back, it's really just the very first pin-unlock after reboot)
dunno about disabling any other icons in taskbar, but them i want anyway.
Click to expand...
Click to collapse
i thought that mortscript had a problems with windows/starup/ - in that case it also has a problem with /windows/start menu/ too.. (i never actually wanted to say anything incase i was wrong, but i noticed this a few weeks ago when using a script to delete .lnks.. )
Rn

Categories

Resources