• twitter
  • facebook
  • rules
  • news
 
Page 1 of 2 12

[New release] Registry display plugin

  • Retweet Thread
  • Vote for Thread to be Featured on the XDA Portal
Lightbulb [New release] Registry display plugin

Ok, most of you may find this totally useless as a plugin, but it was a combination of a request by user Treo_newb and a desire to create a sample plugin project that could be used as a base / example for plugin writers (I plan on doing an article on codeproject.com and this will be the source for it).

What does it do?
This plugin displays a string stored in registry.
The path is:
HKEY_CURRENT_USER\Software\RegDispPlugin
Value name: DisplayString

It checks if this string has changed several times per second when today screen is shown (as the system sends refresh message to all plugins) and displays the updated message if a change occurred.

What is it good for?
First, if you write apps using mortscript or similar like the user who requested this it will let your script display stuff on today screen.
Alternatively it could be used to mark your device today with a string that isn't as easily changed as user info.

The source is basically a skeleton plugin you can use to build your own plugin on (no license / copyright to limit you) and it already has several tricks needed for the plugin to display correctly:

  • VGA compatibility
  • Text size matching system settings
  • Proper header in settings dialog (like on system plugins)
  • Proper text color when selected (according to theme)
  • No blinking all today screen on change
  • Proper resize when switching between landscape and portrait
When I was writing my first plugin I could not find all these little fixes concentrated in a single article so I had to fish for each one as the bug reports came in.

Hope you will find this little project useful.

The plugin:
RegDisplay.CAB
The source (eVC 4 project): RegDisplay.zip



__________________
HP iPaq rz1710
ROM 1.00.05 ENG from 22/6/2004

i-mate Jamin (Prophet G3)
WM6 - PDAViet 4.0.0.0.6 Touch


My apps:
LVMTime | LVMTopBat | RegDisplay


Last edited by levenum; 15th June 2007 at 03:05 PM. Reason: I need to start paying more attention when writing inf files!

Thanks for this!

Thumbs up Thank You Lev.

Thanks, Thanks, Thanks,
You are a legend.

I was almost through with my today plugin and was trying to figure out reading registry values and all of a sudden I get a PM from u about the plugin !!!

Very Cool !!!

OK a few questions,

1. I know that WM_TODAYCUSTOM_QUERYREFRESHCACHE is called for refreshing the today plugin, any ideas about when is it called.
I read somewhere that it was 2 seconds. Is it true?

2. I saw ur code and u have exposed CustomItemOptionsDlgProc in RegDisplay.def, but when I installed the cab file the 'options' is not enabled.
I manually changed the resistry and changed options to dword = 1 and saw ur name and email address.
u might want to enable that by default so that people can notice ur work.

I am planing a commercial release of a new project on basis of this.

Thanks again,

Shailesh

__________________
Developer of CallFirewall and GroupSMS.
For more Pocket PC & SmartPhone Applications visit http://www.Logic-Unlimited.in/mobile.htm
------------------------------------------------------
Proud Developer @ XDA-Developers.com
------------------------------------------------------

First, you're welcome.

shaileshashar:
1) I ran a debug print on this message once on an iPaq 1710 and it seems to be sent several times per second. This could differ from OS to OS or even from device to device, I am not sure.
If you need specifically timed refresh, or you have an event triggered on new data, I suggest using a timer or maybe a thread that will wait on an event. You can refresh your plugin from anywhere in code by calling InvalidateRect with your window handle.

2) I messed up the cab at first, forgetting to add the Options reg value. Then when I went to upload the fix, I couldn't access the site for about an hour (no idea why, I even rebooted the PC to Ubuntu). Should be fixed now, but I will check it later again (I have to go back to XP for that).

Good luck with your program.

__________________
HP iPaq rz1710
ROM 1.00.05 ENG from 22/6/2004

i-mate Jamin (Prophet G3)
WM6 - PDAViet 4.0.0.0.6 Touch


My apps:
LVMTime | LVMTopBat | RegDisplay

Lightbulb Suggestion

Originally Posted by levenum  View Post

First, you're welcome.

shaileshashar:
1) I ran a debug print on this message once on an iPaq 1710 and it seems to be sent several times per second. This could differ from OS to OS or even from device to device, I am not sure.
If you need specifically timed refresh, or you have an event triggered on new data, I suggest using a timer or maybe a thread that will wait on an event. You can refresh your plugin from anywhere in code by calling InvalidateRect with your window handle.

2) I messed up the cab at first, forgetting to add the Options reg value. Then when I went to upload the fix, I couldn't access the site for about an hour (no idea why, I even rebooted the PC to Ubuntu). Should be fixed now, but I will check it later again (I have to go back to XP for that).

Good luck with your program.

Thanks for the help, will check the fixed cab.
Also a suggestion:
A custom icon could also be incorporated. You can give a option to load a custom icon next to the text in the today plugin.

I know anybody can modify ur code and do it but still.

__________________
Developer of CallFirewall and GroupSMS.
For more Pocket PC & SmartPhone Applications visit http://www.Logic-Unlimited.in/mobile.htm
------------------------------------------------------
Proud Developer @ XDA-Developers.com
------------------------------------------------------

Actually, I probably should have mentioned this in the original post but I have no intention of adding options to this thing.
This would only complicate the code and turn it in to an actual app instead of a sample project.

But by all means feel free to make suggestions. If this thing does become popular, when I am done with my other projects (like LVMTopBat) which won't be any time soon (unfortunately) I will release a separate version of this plugin with all kinds of options that can be controlled both by user (form the options dialog) and by other apps through registry.

Maybe things like text alignment, size, bold / Italic / underlined.

P.S.
The reason I put the string this plugin loads under HKEY_CURRENT_USER instead of the HKLM where the rest of the plugin registry resides is because by default the HKEY_LOCAL_MACHINE on WM 5 and higher has a security restriction. For example you can not write to it using RAPI, only by authorized (or signed) app on the device. The HKEY_CURRENT_USER on the other hand is open for all.

__________________
HP iPaq rz1710
ROM 1.00.05 ENG from 22/6/2004

i-mate Jamin (Prophet G3)
WM6 - PDAViet 4.0.0.0.6 Touch


My apps:
LVMTime | LVMTopBat | RegDisplay

Originally Posted by levenum  View Post

P.S.
The reason I put the string this plugin loads under HKEY_CURRENT_USER instead of the HKLM where the rest of the plugin registry resides is because by default the HKEY_LOCAL_MACHINE on WM 5 and higher has a security restriction. For example you can not write to it using RAPI, only by authorized (or signed) app on the device. The HKEY_CURRENT_USER on the other hand is open for all.

Thanks for the info, I never knew that.

__________________
Developer of CallFirewall and GroupSMS.
For more Pocket PC & SmartPhone Applications visit http://www.Logic-Unlimited.in/mobile.htm
------------------------------------------------------
Proud Developer @ XDA-Developers.com
------------------------------------------------------

Thank you so much! This was exactly what I was looking for!

Originally Posted by levenum  View Post

...But by all means feel free to make suggestions.

As a frequent mortscript user I think, this great app might be even more usefull, if the string was shown in an "allways on top" message box instead of the today screen. The Today screen might be obscured by other active windows during the scripts runtime and the plugin eats precious today screen estate also while being unused, doesn't it?

In that case (of a standalone application) I would furthermore introduce some kind of termination string (or reg. value) to end the display application.

Code:
- start mortscript
   - writes first string to registry
   - starts display application (run)
   - updates string in registry whenever appropriate
   - ...
   - writes termination string to registry 
   -> display applications self-terminates
   - ...
- end of mortscript

Honestly, I already do use something comparable with mortscript (employing a conditioned sleepmessage loop and reading from the registry too), but this could be much nicer and more elegant.

Just my 2 cents... What do you think?

__________________
MDAPro, HBH662

Last edited by mistrix; 15th October 2007 at 10:04 AM.

I think something like that would be better implemented by the mortsrit program it self.
It could be a function like MessageBox API in windows which you could then command on and off. Having it built in would save precious resources on the device that would be wasted by having an extra app run constantly in background.

This is just my thought though.
I'd suggest contacting the developer of mortscript and discussing it with him.

__________________
HP iPaq rz1710
ROM 1.00.05 ENG from 22/6/2004

i-mate Jamin (Prophet G3)
WM6 - PDAViet 4.0.0.0.6 Touch


My apps:
LVMTime | LVMTopBat | RegDisplay


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Rules
Forum Jump
 
All times are GMT +1. The time now is 08:25 AM.