Related
Hello!
I have some difficulties to read SMS in my application : my application doesn't want to use the fonction SmsOpen in mode RECEIVE. Do you know the parameters to use in this function to read Sms?
Gremlins (and I'm not Gizmo!)
funny as Gizmo asked me exact the same question via private mail ...
This was my response:
----------------------------------------
I've never used the function to read SMS messages but here is my suggestion:
check the return code of SmsOpen, it is probably SMS_E_RECEIVEHANDLEALREADYOPEN. According the SDK help it means, that another app has already opened and is using the provider. In most cases, that might be Inbox, so shut down the Inbox task befor you are running your code.
If your error code is different, check the meaning in the help file, look for SmsOpen -> SMS specific error codes.
You don't have disable Inbox. The problem is the internal SMS handler - if you look in \Windows\Startup, you'll see a SMSHandler (I don't have a T-Mobile at the moment, so can't confirm the exact name). You need to get your application to start before it. In addition, you need to do a SmsSetMessageNotification() for both SMS_MSGTYPE_RAW as well as SMS_MSGTYPE_TEXT message types. Strangely, the code does not get the notification if you only set it for one of the two.
I have a T-Mobile MDA. There is a folder called "AutoStart" in the Windows folder, so I guess the file called "SMSReceiver.exe" is the handler you were talking about. I named my application "aaamyapplication" in order to start it up first after a soft reset (There is actually no "startup" registry-entry either for "SMSReceiver" nor for my application... in the end I kicked "SMSReceiver" out).
Unfortunately receiving an SMS through my app does not work (but strangely the system is still able to receive SMS in spite of deleting "SMSReceiver").
Do you have a good guess what I should do? I would be grateful for any advice
t_lex
Could some body be more specific on what Jvd said ??? i'm running an XDA2 and when i look in windows/startup i only get the followng :
CheckAutoRun
ChgDfLnk
IA_Caller_ID
MMReg
poutlook
stk
wifiIcon
Hi there,
Is it possible (or could any kind developper!) to script a text message that would always have the same text.
Basically to pay the London Congestion Charge (£5 for driving into Central London), one needs to send a text message to the number 81099 containing the last four digits of their credit card.
As the message is always the same, I thought it might be easy to script such a message to make it easy to pay the charge.
Thanks!
isn't that easy? set up your pre set messages as the words and numbers u need so then u create a new text and click my text chose the one u want and send it!
Hi,
Thanks for your reply. I see what you mean, but that is still several clicks more than I have in mind. With a script/batch file, it would literally be a one button (through a shortcut) click which could even be assigned to a hardware button. Lazy ... maybe! I guess it all really depends on whether the function to send a text message can be accessed from the command line.
no kidding ur lazy!
You can write smssender.html which will include a javascript, that will redirect you to:
mailto:123456789 body="Send me a taxi!" - I'm not sure about the syntax...
Everytime you execute this webpage, you will only have to confirm SMS sending and close IE (I don't know if window-terminating scripts work in PocketIE) :idea:
(!)
I don't know if you're willing to pay for it, but there is a utility called Cell Profiler found here
You can pre-define an SMS to be sent to a particular number when you drive through a particular point.
Download the trial and see if it fits in with your requirements.
You can use the scripting utility called nscriptm to automate your screen taps etc. Give it a go. Its fairly simple and there is a good sample that shows you how to work with screen taps.
Thanks for your replies. I will try each and see what works best for me.
Thanks again!
XDA2-owner said:
Hi there,
Is it possible (or could any kind developper!) to script a text message that would always have the same text.
Basically to pay the London Congestion Charge (£5 for driving into Central London), one needs to send a text message to the number 81099 containing the last four digits of their credit card.
As the message is always the same, I thought it might be easy to script such a message to make it easy to pay the charge.
Thanks!
Click to expand...
Click to collapse
I wonder if I understand you correctly. In my SMS messaging on the XDAII I have something called My Text as a menychoise. The predefined messages in there can be added/amended in the Edit menu...You could do it easily there...?
Hi,
Yeah - someone mentioned that earlier. What I was really looking for though was a literally one-button way to pay my congestion charge - basically a shortcut to a batch-file/script that creates the SMS, enters the text and addresses it correctly.
Does anyone know if the mailto: command that you can use to create an e-mail would work for an SMS? If so, that would be fine as within the mailto: command you can specify the recipient (81099 in this case) and the text (credit card digits).
Thanks for all the responses.
1. PPCs don't make any difference between e-mails and short messages - you have same dialog, same options and same mailto: command...
2. JavaScript in HTML page is probably the fastest way to perform actions you need (if you dont want to write it in C++ of coz!)
3. If I'm not too drunk today I'll have probably posted an example of such page by tomorrow - I finished with school today, so I have something to celebrate! 8)
Would be great to see a javascript sample if you could be bothered/sober enough to put one together.
Thanks very much indeed.
So, that's what it looks like:
<html><body>
<script language="JavaScript">
window.location="mailto:81099?body=Here's my creditcard number!"
</script>
</body></html>
mailto: - where
body: - what
You can also add subject: (don't forget to divide it with "?" :!: )
It looks like Pocket IE does not support close() function. Can anyone confirm? Any way, even if you will have to close IE manually, executing this file (possibly from Today screen) and pressing SEND is still faster than going to New>SMS>MyText>choose>enter number>confirm... 8)
That worked just great! Thank you so much.
I used the PHM Pocket PC PowerToys's TrayLaunch program to put a shortcut to the .htm file onto the bottom bar of the Today screen.
I still need to press the Send button (is there a way to automate that?) and close IE but it's still MUCH quicker than doing it through a manual SMS.
Thanks again for all comments and help.
Compose new text message from shortcut
Hi there,
I'm a total newbie (NOT a programmer at all), just a Qtek 9090 addict. I 've been looking for something similar to your request: I wanted a way to go straight to the "compose text message" window from the today screen or a hardware button. I finally found a way to do this (maybe not the best way, but I can't find a site that lists all the possible parameters for tmail.exe).
If you're still looking for a better way to automatically launch your message, try this:
Copy the "Messaging" shortcut from Windows/Start Menu and put the copy somewhere you can work on it. Rename it to something like "London Congestion".
If you have Resco file explorer on your device, select your new shortcut and view its properties. On the second tab ("shortcut"), you should see the line "\Windows\tmail.exe". Change it to this:
"\Windows\tmail.exe" -service "text" -to "81099" -body "your credit card number"
Then tap "ok".
Move your new shortcut to Windows/Start Menu/Programs. Now you should be able to access it with your Today screen launcher or Button launcher.
If you don't have Resco file explorer, copy your shortcut to your desktop and open it with Notepad. You'll see something like 43#"\Windows\tmail.exe"; just leave the number at the front, make the adjustments I described and save the file. Then put it in Windows/Start Menu/Programs on your device.
I tested this and it worked for me, so I hope it does for you too!
To simply go to the "compose" window from a shortcut, I use this line:
"\Windows\tmail.exe" -service "text" -to ""
Robrecht.
Thanks a lot Robrecht,
I was actually going to re-open this issue because I have a Blueangel now - and I don't know if it's because it is WM2003 Second Edition or not, but the javascript that was written for me in the above post no longer works, so I needed a new method.
A very timely reply and I will try it over the weekend.
Thanks a lot,
Jimmy
I think you should add "I hope it chokes you bunch of rip off bastards" We pay road tax, we pay huge tax on fuel, we sit for hours in jams and they want money :?:
Well, XDA2-owner, you're very welcome!!!
I have a Blue Angel too and it works for me, except....... I discovered a flaw.
I thought the
-service "text"
parameter made sure the automatically created message was always a text (SMS) message, but instead it turns out that the format of the new message (SMS, e-mail, MMS...) changes according to the last viewed folder in Pocket Outlook. So if you were checking your e-mail account just before you use my shortcut, it wil create an e-mail instead of a text message.
This sucks! And I was so happy I'd been able to help someone!
Does anyone know a way to make sure the new message is always a text message?
Hi again,
This issue was one I was also having with the Javascript - I got used to the fact that if I was using the e-mail part of Messaging, I would switch it back to SMS before closing it.
One issue I am having though - and it might just be to do with my setup - is that when I run the shortcut from Start-->Programs-->Congestion, it works fine. When I try and launch it from my Today screen though, using BatteryPackPro, it doesn't seem to create the text message, and just stays on the Today screen.
Any ideas?
Thanks again for your help and ideas.
Peculiar: if I soft reset the machine, I can view my Text messages fine. However, if I then view another message folder (outlook, http:// or smtp folders) the SMS folder populates with these messages: if I look at the tree structure there is a - (Minus) sign next to the text message branch, and if I select the stub I get a blank screen with IPM.Root at the top.
If I soft-reset, I can then view my SMS again, but only until I view another messagefolder.
As you can imagine, this is a MONSTROUS pain in teh arse, and I would really appreciate any help in solving this.
(apologies if the solution is listed elsewhere, searched for 5 days and couldn't find it).
Thanks,
Jolyon
I wonder if anyone managed to solve the problem.
It happened to me and I am unsuccesfully searching the web for a definite answer. There is no direct solution, just a few indirect ones such as "hard reset and restore except mailboxes" which sometimes work, sometimes not. The problem seems pretty popular. Would you hackers please assist us mere users...?
Hi all,
First post! Just got very interested in customising my HTC Touch WM6...been playing with spb pocketplus. Like the idea of putting shortcuts where I want them to what I want. But wanted to take it further...
For example I found this:
Create a shorcut, ex: NewSMS.lnk, then put this line in:
30#windows\tmail.exe -service "SMS" -to "" -body ""
writting by Cloudyfa in http://forum.xda-developers.com/showthread.php?t=320448
I renamed the .txt to .lnk and stuck it on my phone and it worked perfectly! What i would like to learn is how to create my own shortcuts, i.e. what does all the text mean in the lnk? the 30# and -service etc...
Hope its not a stupid question or maybe its one that cant really be answered simply..?
Cheers in advance,
Jon
The example you gave in your post can be broken down as follows:
Code:
30# - total length of the string following the "#"
(it's not strictly enforced - you could put "0#" and it would still work!!)
windows\tmail.exe - the path to the application followed by any parameters...
-service "SMS" - the mail service; in this case, text messages
-to "" - set the recipient to blank
-body "" - set the body of the message to blank
The "-service" parameter could also be set to "MMS" or to the name of another mail type account you may have set up on your phone; e.g. "Google" or "Yahoo" etc... You could also set the "To" parameter to someone's name if you wanted to create a shortcut for sending a message to a particular person.
Creating shortcuts is fun - the difficult bit is working out what parameters are available and what format they take! There is a post on creating shortcuts to the "control panel applets" - i.e. the stuff in Start | Settings - you can find it at this page. Good for more examples
Hope this helps,
Mark.
Hi Mark,
Thanks for that, it kind of looked like that was how it was working... like you say though, the question is knowin what format the parameters are to be put in.
For example, on my phone I have a program called "Patiences" when opened, within the program i could choose from 3 different variations of game. How would I go about finding out the right parameters to create a shortcut that would start the program and choose the right game?
Also, modifiying the SMS one, if it was to go to a specific person, should i enter the number in the "to" bit or can it refer by say name to an entry in my address book?
Cheers!!
Jon
jcr1 said:
For example, on my phone I have a program called "Patiences" when opened, within the program i could choose from 3 different variations of game. How would I go about finding out the right parameters to create a shortcut that would start the program and choose the right game?
Click to expand...
Click to collapse
Now you're starting to get technical .....there may be an easy way to get a list of available parameters, probably using the debugger in Visual Studio or something - not something I've ever used! My own method would involve opening the .EXE file with a text editor and searching for recognisable strings; then I would employ a great deal of trial and error to see if I could get it to work
jcr1 said:
Also, modifiying the SMS one, if it was to go to a specific person, should i enter the number in the "to" bit or can it refer by say name to an entry in my address book?
Click to expand...
Click to collapse
The SMS application will resolve whatever name you enter before the message is sent; as long as the name you enter in your .lnk file contains enough characters to make it unique (e.g "John How" would match "John Howard" and "John Howlett", but "John Howl" would get the one you want!!).
Hope this helps - at the end of the day, there's nothing more satisfying than figuring something out yourself (and sharing it with the community if it's worth sharing )....there's so much crap on the TV, I'd much rather spend an hour or two (or six!) messing about with something on my phone, getting it just the way I want it
Enjoy!
Mark.
Hi Mark,
Thanks for the help! Great advice and I shall definately be taking a look at what you suggested. Thats all I needed was some prompting as to where to start looking, as you say, it is much more satisfying working things out for yourself than just getting someone else to do it.
Cheers again!
OK next question, how do I get the tmail.exe from my phone onto my pc so I can have a look at it in notepad? I can find it by browsing through my phone from my laptop but I cannot copy it over? Access denied!
On the phone can't change the properties so it isn't read only or anything?
please help.
Cheers
Now there's a question!!
I've just tried to copy the file myself (using Total Commander V3 Beta - from this page) and it fails for me.....
I used to be able to do it on my Hermes/TyTn, which was unlocked/SuperCID - but now that I have a stock ROM on my Kaiser/TyTn II, it seems that it's no longer possible. I've yet to SuperCID my Kaiser as I've been too busy with work to get involved in flashing/trashing it but after this weekend I may well have a go.
Not sure who else is reading this topic, but if a ROM cook or a more worldly wise user is able to verify my thinking, then that should help you/me/us in our quest to get Tmail.exe off the damn phone and onto the PC!!!
I'll check back/post back if I come across the answer in the meantime. BTW, what device are you using - you don't have a signature that tells me
Cheers,
Mark.
Hopefully now my sig is working... I have a HTC Touch with Windows Mobile.
I'm new to this so I've no idea what you mean by locked ROMs etc.
Either way, thanks very much for your help.
I've been digging around and trying numerous examples of the message2reg.exe utility. I've found examples from ThrottleLauncher, BatteryStatus, WAD... they all seem to include the same set of files and mortscripts. It seems like the shortcuts included should cause the message2reg.exe to run and put data into the registry at ...
SMS_text = RegRead("HKLM","Software\ThrottleLauncher\Messaging\SMS","Subject")
I have all the files in \Program Files\Message2Reg\
The mortscript writes then deletes temporary registry entries in noted location above. Then it does....
RunWait("\Program Files\Message2Reg\Message2Reg.exe","SMS Refresh")
This should put the data into registry but nothing ever shows.
Also tried ...
RunWait("\Program Files\Message2Reg\Message2Reg.exe","Text Messages Refresh")
because "Text Messages" is what shows in my Messaging application (not SMS).
Eventually I want to use mortscript to get weather from google via SMS, then use message2reg to parse the SMS.
Any tips?
itesla said:
I've been digging around and trying numerous examples of the message2reg.exe utility. I've found examples from ThrottleLauncher, BatteryStatus, WAD... they all seem to include the same set of files and mortscripts. It seems like the shortcuts included should cause the message2reg.exe to run and put data into the registry at ...
SMS_text = RegRead("HKLM","Software\ThrottleLauncher\Messaging\SMS","Subject")
I have all the files in \Program Files\Message2Reg\
The mortscript writes then deletes temporary registry entries in noted location above. Then it does....
RunWait("\Program Files\Message2Reg\Message2Reg.exe","SMS Refresh")
This should put the data into registry but nothing ever shows.
Also tried ...
RunWait("\Program Files\Message2Reg\Message2Reg.exe","Text Messages Refresh")
because "Text Messages" is what shows in my Messaging application (not SMS).
Eventually I want to use mortscript to get weather from google via SMS, then use message2reg to parse the SMS.
Any tips?
Click to expand...
Click to collapse
..why don't u use regwritestring of mortscript instead of message2reg?
Let mortscript itself write the datas into registry.
How does mortscript know what to write into registry? The whole point of message2reg is to read the SMS text "behind the scenes" and put in the registry for programs like mortscript / rlotday / throttlelauncher to access. I haven't used MortScript to switch windows, copy text from window, etc.... That seems really messy and error prone, plus there are a lot of messages to repeat through.
Or can MortScript read directly from the WM messaging program now in a new version or something?
...hm I don't really know what message2reg exactly does. But mortscript is not able to communicate with the wm messaging interface.
How does message2reg know what to write in the registry? Sorry, but as i mentioned before I don't know message2reg.
But have a look here: http://forum.xda-developers.com/showthread.php?t=479076&page=3
You are not alone :-(
Well, I haven't gotten it working yet... My impression is that it writes numerous entries into the mentioned registry key (entries for subject, sender, date, body) for the most recent message in the Messaging "folder". You tell message2reg which folder to read from as a command line parameter as well as Refresh...
RunWait("\Program Files\Message2Reg\Message2Reg.exe","SMS Refresh")
RunWait("\Program Files\Message2Reg\Message2Reg.exe","Text Messages Refresh")
If you want to see the information for the next oldest message, your execute message2reg again with the "Next" parameter, and then the existing registries entries are over-written with the 2nd SMS message...
RunWait("\Program Files\Message2Reg\Message2Reg.exe","SMS Next")
cyron_at said:
But have a look here: http://forum.xda-developers.com/showthread.php?t=479076&page=3
You are not alone :-(
Click to expand...
Click to collapse
That is one of the many I read through Some people have it working so there must be some trick or missing parameter or something
Anyone get this working? Is it OS issue (WM5)?
I used it successfully in my Multiplugin:
http://forum.xda-developers.com/showthread.php?t=523015
You can see the commands I used inside.
itesla said:
I've been digging around and trying numerous examples of the message2reg.exe utility. I've found examples from ThrottleLauncher, BatteryStatus, WAD... they all seem to include the same set of files and mortscripts. It seems like the shortcuts included should cause the message2reg.exe to run and put data into the registry at ...
SMS_text = RegRead("HKLM","Software\ThrottleLauncher\Messaging\SMS","Subject")
I have all the files in \Program Files\Message2Reg\
The mortscript writes then deletes temporary registry entries in noted location above. Then it does....
RunWait("\Program Files\Message2Reg\Message2Reg.exe","SMS Refresh")
This should put the data into registry but nothing ever shows.
Also tried ...
RunWait("\Program Files\Message2Reg\Message2Reg.exe","Text Messages Refresh")
because "Text Messages" is what shows in my Messaging application (not SMS).
Eventually I want to use mortscript to get weather from google via SMS, then use message2reg to parse the SMS.
Any tips?
Click to expand...
Click to collapse
you're wrong with parameters of message2reg
they are : Next , Previous , Refresh , Reply , Details or Detail (don't remember)
Hi,
I was wondering if Message2Reg was able to get email body and/or message dates.
I successfully configured it to work with SMS and ActiveSync email but I cannot find the informations above. Any advise ?
Thank you !
This is the only info I found on this matter:
Message2Reg. Save to registry the message from the account with the number specified (to HKLM/ThrottleLauncher/Messaging/#AccountName#). Params: "account name [SMS/ActiveSync/...]" "Action [Next/Previous/Refresh/Details/Reply/Exit]". This little app is based on the MAPI api suplied here: http://www.codeproject.com/KB/mobile/PocketPCandSmartphone.aspx. If you want the sourcode of Message2Reg send me a mail and I'll send it in cumpliment of the BSD license.
Click to expand...
Click to collapse
From: http://www.throttlelauncher.com/portal/Downloads/ThrottleLauncher/092beta
damn i've really lost my mind trying to get this thing to work, seems like it does not want to wok on my device........somebody please help
i am lost at how your trying to run it.
all it does is write to the registry, you then need something to show the new reg keys.
example WAD can show REG text.