{Solved} How to show unread emails from multiple accounts - Windows Mobile Development and Hacking General

Hi people. Only my 2nd post here.
Recently picked up the amazing Samsung i780 and then found these forums. Thanks to you all for the icons, program advice, etc. that has turned this into the best phone I've ever seen.
Over the past few days, I've constructed a 6-panel UltimateLaunch interface, with plugins like Rltoday (for active icons on one page), weather, agenda, battery monitor, and GPRS monitor. Looks great. No function I regularly use further than two screen taps away.
Now I've come to this final hurdle: How to show unread messages for individual mailboxes. Where can we get this information?
I've looked through the registry and while there are folders for each email account under HKEY_CURRENT_USER\System\State\Messages\, those folders do not contain the "Count" variable.
In the HKEY_CURRENT_USER\System\State\Messages\OtherEmail\Unread folder there is an extra line called "Text" which shows "emailaccount1 (21)[]emailaccount2 (3)". I assume this is what gets used in the standard Today plug-in that shows unread emails.
The question is, how is this text generated? There must be some way to get data for each inbox. Any ideas?
Alternatively, is there a way to pare this text down to just the numbers? I want to map them onto separate icons (already existing) on my rltoday page that take me direct to each individual mailbox.
As an side, I'll just say that UltimateLaunch is the best WinMo program ever!! Stable, fast, and really turns a WM phone into what it should be - graphical, configurable, flexible. And did I mention stable? No crashes or glitches even on the i780's 320x320 screen which throws some programs (eg. Pocket Plus) for a loop.

can` help you, but as a professional user you should know that the name is "Ultimatelaunch" not launcher. but dont worry everone here is doing that Wrong.

Oops... ya.. sorry. No offense to the author! (edited post above)
It really is a great program. I tried out many of the other UI options and it's just tops. Only problem now is that modding my phone has taken up too much time over the past week. It's really addictive.

OK, here's a screenshot of the page in queston.
As you can see, I've got separate icons for 2 email accounts and a bridge between them showing total unread mails. But what I'd really like to do is for each to have it's own separate number.
Any ideas out there?
(and big thanks to bluemetalaxe for all those icons. Modest donation coming soon...)

These should work, I use them for batterystatus
voicemail count number:
<registry key_value=HKCU\System\State\Messages\vmail\Total\Unread\Count/>
sms unread count number:
<registry key_value=HKCU\System\State\Messages\sms\Unread\Count/>
total email unread number:
<registry key_value=HKCU\System\State\Messages\TotalEmail\Unread\Count/>

spencepu3 said:
These should work, I use them for batterystatus
voicemail count number:
<registry key_value=HKCU\System\State\Messages\vmail\Total\Unread\Count/>
sms unread count number:
<registry key_value=HKCU\System\State\Messages\sms\Unread\Count/>
total email unread number:
<registry key_value=HKCU\System\State\Messages\TotalEmail\Unread\Count/>
Click to expand...
Click to collapse
Thanks, but I think the OP is looking for counts for specific email accounts, not just "all emails". Is that possible with BatteryStatus, cuz I'd like that also...

Search msdn.com for details on the State and Notifications Broker api (SNAPI). I think this is in the Microsoft.WindowsMobile.Status namespace if you're using managed code.
Also look through the docs for the Messaging API (MAPI).
Here is one link on MAPI: http://msdn2.microsoft.com/en-us/library/ms879918.aspx
One of those two api's should tell you what you need to know. Hope these help.
EDIT:
Managed Messaging API is in the Microsoft.WindowsMobile.PocketOutlook namespace.

jomo25 said:
Thanks, but I think the OP is looking for counts for specific email accounts, not just "all emails". Is that possible with BatteryStatus, cuz I'd like that also...
Click to expand...
Click to collapse
That is correct. As you can see from the screenshot above, I've already got total email counts, sms counts, etc. Those are simple registry keys. But there don't seem to be registry keys for individual mailboxes.
Robp - thanks for that. I'll have a look right now and report back if I find anything.

I had the same issue when using RLToday and here is the solution that I came up with. I installed mortscript and then had this script running in the background.
#ErrorLevel("off")
While (1)
Mailstring=RegRead("HKCU", "\System\State\Messages\OtherEmail\Unread", "Text")
#Convert String to values
maildet=part(Mailstring, "(", 1)
parse1=part(Mailstring, ")", 1)
num1=part(parse1, "(", 2)
parse2=part(Mailstring, "(", 3)
num2=part(parse2, ")", 1)
if (maildet eq "Yahoo!")
RegWriteDword ("HKCU", "System\State\Messages\OtherEmail\messStatus", "yahoocount", num1)
RegWriteDword ("HKCU", "System\State\Messages\OtherEmail\messStatus", "gmailcount", num2)
Else
RegWriteDword ("HKCU", "System\State\Messages\OtherEmail\messStatus", "yahoocount", num2)
RegWriteDword ("HKCU", "System\State\Messages\OtherEmail\messStatus", "gmailcount", num1)
EndIf
Sleep( 300000 )
EndWhile
This script looks at the reg key that you mentioned above, strips out the numbers and updates new reg keys with the values. I also created two Reg Keys for the text of the mail accounts. I also found out that the order of the text in Keep in mind that the order of the mail accounts can change, hence the if statement to sort out which is which. This is fine for two mail accounts but gets more complex for any more.
A couple of caveats, I am but no means a programmer, so I'm sure that there is a much more elegant way to do this and I have no idea how much of a resource hog this script is. But it does work. You might want to adjust the sleep time to get a better real time snap shot otherwise you might be ~5 min out of sync with you email count.
Dave.

You're a star.
I just spent a bit of time learning all kinds of interesting things about MAPI but not quite finding a solution.
This is a much easier way out. I'm off to give it a try.

update: Big thanks Nimbusbrew!
I installed Mortscript and put a slightly modified version of his script in my Startup folder (changed the key names to match my mail folders and reduced the sleep time to 100000 milliseconds)
I now have working registry keys to which I can point my indicators on rlToday for each individual mailbox.
I had a feeling from the start that Mortscripts were the answer but hadn't gotten around to learning them yet. I'll have to take another look through that Mortscripts scripts thread to see what other fun can be had...

Glad I could help

Just out of curiosity are you using managed code or native code for your project?

I'm not much of a programmer, just a newcomer part-time phone hacker, but I guess you would consider it managed code since this particular routine is compiled by Mortscripts and any small bit of design code xml I've cooked up is going through rlToday, Batterymonitor, etc.
(or did I totally misunderstand the question?)

It sounds like you kind of misunderstood the question but you still told me what I needed to know .
At any rate, while I'm happy that you got it to work, I think you should eventually find a more robust solution that works for more than two email accounts.
You could write something like that in C# in less than 30 minutes probably. Let me know if you need any help with that in the future.
Also, managed code usually refers to code written with the .NET Framework. I'm not really sure how to categorize mortscript. Just a (really cool) scripting language I guess.

I'm intreasted in doing something very much the same, but I'm not so smart and haven't yet done anything with mortscript, although it's installed on my pocket pc. Can you walk me through what I need to change in the registry and what the mortscript will be? I have two email accounts ("Hotmail" and "Providence") that I want to keep count of.
Thanks.

nimbusbrew said:
I had the same issue when using RLToday and here is the solution that I came up with. I installed mortscript and then had this script running in the background. ...
Click to expand...
Click to collapse
Don't know if anyone still needs it, but I've written an improved version of the MortScript that works with any number of email accounts, and writes each account's unread total to a registry key with the same name as the account. I hope someone finds this useful.
Code:
Call( "main" )
Sub main
# Gets the original string of unread values.
mailstring=RegRead("HKCU", "\System\State\Messages\OtherEmail\Unread", "Text")
# Clear out values (in case of one account having zero unread).
RegDeleteKey( "HKCU", "System\State\Messages\OtherEmail\Unread\Accounts", TRUE, TRUE )
# Goes through and turns each individual account into its own registry value.
ForEach mailpart in split( mailstring, ")", TRUE)
emailname=part(mailpart, "(", 1, TRUE)
emailnumber=part(mailpart, "(", 2, TRUE)
RegWriteDWord ("HKCU", "System\State\Messages\OtherEmail\Unread\Accounts", emailname, emailnumber)
EndForEach
While( mailstring eq RegRead("HKCU", "\System\State\Messages\OtherEmail\Unread", "Text") )
Sleep( 500000 )
EndWhile
Call( "main" )
EndSub

Related

WM5: Does anyone else miss the 'New' menu?

Hello Gurus and loyal subjects (of which I am definitely the latter)!
I have been using WM5 (Magneto) for some time now and while generally impressed, especially with the stability, I really miss the 'new' menu that is on WM2003/SE at the bottom left of the today screen. I used to use it a lot and now find it long-winded going into the application and then clicking new.
Does anyone know of a workaround/replacement for this?
Many Thanks,
Coj
I don't know about the other stuff - though I'm sure there are switches for the .exe's associated, but with regards to messages I have a series of shortcuts in Pocket Plus to start txt messages to different people.
Eg, the .lnk when imported into Notepad on the PC reads:
19#"\windows\tmail.exe" -To "SoNSo <+44 (1234) 567890>" - though MS changed the -acc switch so it doesn't allow you to specify whether it be SMS / Outlook / POP3 etc.
Maybe you could do something similar? Admittedly it wouldn't be like the New menu but if you can find the switches for the .exe's involved I'm sure it would be of help.
Cheers
Ant
half a solution
Hi, thanks for this tip, I have managed to use it in pocket plus and can now create a blank sms in two taps from the today screen (same as in 2003). will keep my eyes open for a switch for selecting text messages as the type.
someone posted, I think buzz, tray launch and more in the 1.50h discussion, and that allows you to add in a way the new menu to the same place where the bluetooth is, you're not using any extra space because that is already taken up... so hope that helps a bit, I know I missed the new then notes, so I added an link to it

linux shell question - help required - anyone

linux/shell cracks, anywhere? This might be off-topic, but I hope someone can give me a hand nevertheless.
I have a little problem: After exporting a few thousand SMS from my PPC I ended up with text files like these:
---[begin]---
[From]: LastName, Firstname [Sent]: 2005-04-03 11:12:13
TextTextText with spaces and all that but bo line feeds - just one line.
[From]: LastName, Firstname [Sent]: 2005-04-03 12:13:14
Next SMS TextTextText with spaces and all that but bo line feeds - just one line.
---[end]---
This is the layout for the incoming. The Layout for the outgoing is slightly different, with one additional line feed between the messages. But I can work that out on my own once I have a solution for one of the files.
Reason I am telling you all that, is that I want to convert the files into a different format. I know that it should be possible with sed but I am a bit lost when it comes down to regular expressions which I will have to use.
I'd like to get the layout single-lined with some kind of delimiter so I can easily import them into excel or something like this and combine incoming/outgoing files by sorting them by date field or whatever. Like this:
---[begin]---
Lastname, Firstname°2005-04-03°11:12:13°TextTextText with spaces and all that but bo line feeds - just one line.<CRLF>
Lastname, Firstname°2005-04-03°12:13:14°Next SMS TextTextText with spaces and all that but bo line feeds - just one line.<CRLF>
---[end]---
It is not really important whether the date field is split up or left intact from original. Also, I don't mind losing the [From] and [To] identifier, they are separate files so I can work that out when importing to excel. Delimiter can be most anything that does not occur in text... "°" or "|" or even "¡" are all suitable.
Now my question - is this something sed can do? I am pretty sure it can, but I already banged my head against that problem to no avail. Unfortunately my linux pocket knife (cygwin) is not quite complete in manpages and manuals, so I am bit lost there when it comes to defining the newlines and compressing two lines into one with delimiters.
Does anyone have a good idea how to handle this problem or even a sed-command line for me that might give me a good start? It would be greatly appreciated!
Off topic indeed
Hi,
I have no cygwin, nor linux installed.
BUT - I have gVim installed and it works pretty much the same (regular expression-wise :lol, so you can use the next line:
:%s/\[From\]: \([a-zA-Z].*\), \([a-zA-Z].*\) \[Sent\]: \(.*\) \(.*\)\n\n/\1,\2,\3,\4/g
Hope it helps ya out!
P.S
If it does not work for sed (and it may very well not work) use the above line in the native cygwin vim.
Re: Off topic indeed
michar said:
If it does not work for sed (and it may very well not work) use the above line in the native cygwin vim.
Click to expand...
Click to collapse
Thanks a bundle... You are right, it did not work instantly but it gave me a good head start into the general direction. With some trial and error I got the desired result and some extended knowledge of regexps.
Thanks again.

New Version of Pocket Informant ready to go

Have a look over at http://www.pocketinformant.com/Forums/index.php?showtopic=8904&st=0 for the latest (Release Candidate) of Pocket Informant.
Its well worth installing as it has a much smaller memory footprint (see the discusion in the forum above), and seems a lot faster to me. Also if you can find any bugs, make sure you post them into the forum.... I found one yesturday, and its been fixed already.
The guys at Web IS seem to have done a great job (and no, I'm not linked to them in any way.... its just that their product makes the PDA calendar features usable!!!)
Regards
P
Oh !£@[email protected]!&&! Installed this and now my right soft-key won't bring up the internal (default) contact program (which is so much better than the one in pocketinformant). Anyone know how to change it back? I managed it before but no amount of registry changing seems to work now
I'm not an expert on this, but one suggestion I would make is that you tap on the PI icon on the bottom of the screen (the red dot surrounded by a multicolour ring) and de-select "Make Default PIM" ... this then makes all the MSFT links work with the MSFT apps rather than PI... hope this helps
P
BudgieUK said:
I'm not an expert on this, but one suggestion I would make is that you tap on the PI icon on the bottom of the screen (the red dot surrounded by a multicolour ring) and de-select "Make Default PIM" ... this then makes all the MSFT links work with the MSFT apps rather than PI... hope this helps
P
Click to expand...
Click to collapse
This is one of the beefs I (and several others) have with PI, and AF for that matter, which seem to fall on deaf ears in their cosy cartel. Why won't they let the user choose which modules they want to use, instead of their software taking over the whole machine?
If you installed a non-MS planner on your Desktop PC, you wouldn't stand for it replacing all your other PIM apps too. So why should you on the PocketPC?
There is a page in the wiki that shows the registry settings for the soft keys, but I found this method unreliable. I managed to change the text but the app remained at the default setting.
The way I did it was to download Buzz's SoftKeyAppletEx, which goes into your control panel [you do need to register to download the file].
Code:
Description:
This is a replacement applet for the SoftKeyApplet.cpl. I called it SoftKeyAppletEx.cpl (to be original) ;)
This applet does exactly the same thing, but with more features
1. you can browse your ppc to get the desired application or link dedicated to the soft key.
2. you can change the name shown on the soft key.
3. you can place the applet icon on the settings tab you want (personal, system, connections).
4. you can specify only one soft key (left or right) or both
5. you can reset to defaults, so I think it's the phone and the calendar
That's really useful stuff - thanks!
As others have said, I want to use PI for my Diary but the built-in contacts application - which is far better for quick dialling etc.
I still have a problem though - PI seems to have replaced my /Windows/poutlook.lnk file with its own, so if I make the right soft-button point to this file it still runs PI. Can anyone send me their default contacts.lnk file (and possibly poutlook.exe too?) or tell me how to make a new link to the default contacts application (which I assume must still be in ROM?)
Thanks all. Love PI but this hijacking on my contacts is really annoying!
PReDiToR said:
The way I did it was to download Buzz's SoftKeyAppletEx, which goes into your control panel.
Click to expand...
Click to collapse
Where'd you put the file? What control panel are u taliking about? Help is appreciated.
BudgieUK said:
I'm not an expert on this, but one suggestion I would make is that you tap on the PI icon on the bottom of the screen (the red dot surrounded by a multicolour ring) and de-select "Make Default PIM" ... this then makes all the MSFT links work with the MSFT apps rather than PI... hope this helps
P
Click to expand...
Click to collapse
I tried this and I can report some success. I use PocketBreeze on the Today screen which is tightly linked to PI. Nothing I say here is relevant if you don't use PocketBreeze.
Now, with PI the non-default PIM, my PocketBreeze links take me to PI's calendar, tasks and contacts applications. My hardware contacts button and the contacts soft key in the phone now take me to Pocket Outlook's contacts app.
Couple of caveats: PI does seem to revert to being the default PIM after a soft reset. Also, the 'special days' feature in PB (lists upcoming birthdays and anniversaries) seems to grow duplicate entries over time, but these can be cleared with a soft reset. It's never worked properly for me anyway so could be unrelated.
I have yet to see any problems syncing. I do expect it to work OK as I believe that PO and PI run off the same database.
Hope this helps those with PB and PI.
-- TK
Lovely program, but the last few versions hae been a complete dog speed wise.
belfast-biker said:
Lovely program, but the last few versions hae been a complete dog speed wise.
Click to expand...
Click to collapse
I agree. Rev 4 was often very slooowww, although I had installed it in RAM. But this new version is different. The footprint is much smaller in WM5.
But although I have installed the new version entirely on the storage card, it is MUCH FASTER now!
I found some other improvements too, like the timeline now shows you total hours for your different projects, and there is a real fullscreen option now.
Didn't find any bugs so far, but I just downloaded it two days ago.
Cheers and thanks to this great forum! I have benefitted a lot already from the tips and tricks posted here
itoma

WM5 batch scripting?

Hi Guys,
Is there a way to simply execute 2 commands in a row with one wrapper script in WM5?
I would like to execute:
\Windows\repllog.exe /remote /all /h /p:all
\Windows\tmail.exe -Service "MailAccount" -Sync
via one simple script. Any hints?
Help greatly accepted!
Bye,
m.
Mortscript.
V
Thanks for the hint. Unfortunately MortScipt-3.1.cab does not run on my new Test Device (Samsung SGH-i320) under WM5...
Uhh, neat, a new toy - the 320i is barely out isn't it?
Problem is your device is a SMARTPHONE while mortscript was designed for Pocket PC platform.
I am not familiar with any Smartphone solutions, but you can try opening the cab using WinCE cab manager (you can download a full featured demo that will run 10 times) and modifying the platform / devices cab supports or try to install the app manually. This is probably an inf issue and the app itself will run.
Or better yet you could try and contact the developer of the app, and ask his advice.
Also there may be a security issue. Try application unlocking your phone.
I played with the i320 at the Modaco meeting a couple of weekends ago.
To quote sex and the city, I needed a napkin to wipe my seat after seeing how gorgeous the screen was. Best screen this side of a B&O TV. If you need one reviewing, send it my way
Anyway, nscript, and the SKScheMa modified version, might also help, but as my learned friend levenum says, never tried either of them on a smartphone. But I guess they should work.
Specifically for the smartphone, I think xbar has scripting capabilities. Excellent app from my old smartphone days.
V
Good tips thanks. I have successfully tested MortScript v 3.2 Beta with the i320.
n00b alert!
runWait "\Windows\tmail.exe","-Service "MailAccount" -Sync"
Does not seem to have any effect... :/
Anybody have had the same problems with a simple script like that?
Even I tried all the possible combinations, unfortunately I could not manage to reach my POP3 mail screen directly and sync
I also tried syncaccount.exe which u can search in forum also does the job not
I am doing smth. wrong maybe.
#\windows\tmail.exe -Service "MMS"
and
#\windows\tmail.exe -Service "SMS"
works but "Outlook E-mail" or "MyPrivateMailAccountName" does not?
any suggestions?
http://forum.xda-developers.com/vie...ostorder=asc&highlight=vjphoneshortcuts+email
V
Yes I tried those but as the last post there, only checking the last account..
I have "Outlook E-mail" ; "POP3" ; "MMS" ; "SMS" ; "Hotmail"
also Hotmail works, and one thing is that I use "New Menu for WM5" and sure that does not go to E-mail screen..
Confused
I finally figured it out...
Deleted "MyPrivateAccount" and recreated and left the name POP3 then it worked for Mortscript, syncaccount and New Menu..
Hope this helps to someone else
Mortscript
I've used MortScript myself for email. The syntax below is what always works for me.
run \windows\tmail.exe , """-Service "[email protected]""""
MortScript seemed liked it got real confused if I didn't use all the quotes....
Yes a bit complicated but managed to work with
Now with one push of button, my personal account is reached+checked
Thanks! Escaping the quotes did the trick. Solved for me.
tmail.exe
Folks, you´ve lost me!
run \windows\tmail.exe, -Service "AccountName" -sync
does it in Mortscript as well as
ii#\windows\tmail.exe, -Service "AccountName" -sync
for a link (ii dependant on the real AccountName).
What quotes? :shock:

[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:View attachment RegDisplay.CAB
The source (eVC 4 project): View attachment RegDisplay.zip
Thanks for this!
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
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.
Suggestion
levenum said:
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.
Click to expand...
Click to collapse
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.
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.
levenum said:
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.
Click to expand...
Click to collapse
Thanks for the info, I never knew that.
Thank you so much! This was exactly what I was looking for!
levenum said:
...But by all means feel free to make suggestions.
Click to expand...
Click to collapse
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?
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.
levenum said:
I think something like that would be better implemented by the mortsrit program it self.
...
I'd suggest contacting the developer of mortscript and discussing it with him.
Click to expand...
Click to collapse
Mort knew about that request and by chance just announced to so.
Thanks anyway.
Hello levenum,
I just joined the community. Reason being, I found your RegDisplay plug-in
You call it a sample project, but the impact is that of an awesome solution.
Great for MortScript, but equally useful in BASIC applications that write
messages to the registry which is show upon screen minimization.
I regret not being a C programmer (mainly BASIC), else I'd love to further
develop this jewel.
Your plug-in runs flawlessly in an iPAQ 210 under WM6 Classic.
Cheers and Respectful Greetings
Robert
CLSID for registry display plugin
What is the CLSID for the Registry Display Plugin? I am going to have to edit the XML file that defines my home screen in order to get the plugin to show up. I am using Facade to control my home screen, and the only plugins that it will show in its list are those currently in use in one of the XML files in the Application Data\Home folder. All other new plugins require editing the XML. Thanks for your help.
levenum said:
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:View attachment 41592
The source (eVC 4 project): View attachment 41583
Click to expand...
Click to collapse
This is great! I was asked if I could write a today screen plug-in for my weather application (http://forum.xda-developers.com/showthread.php?t=445576) - I couldn't since I don't have the skills and I'm writing .NET code - but this is exactly what I needed.
I'm adding support for this plug-in and will of course give credits to you.

Categories

Resources