running multiple instances of a software - General Questions and Answers

Hello all.
I use Windows mobile 6.1.
I would really like to be able to run mobipocket reader (and some other software) concurrently. Running multiple instances of a program at once is really useful as we dont have to close something just to open another document.
Can anybody tell me if there is a way to do this?

It depends on the software itself. The original Pocket PC methodology as published by MS was that only one copy of a program should be in memory at one time, and that it should only open one document at a time. If you create a shell C++ application in VS Studio, it contains the following code in the InitInstance function.
Code:
//If it is already running, then focus on the window
hWnd = FindWindow(szWindowClass, NULL);
if (hWnd)
{
// set focus to foremost child window
// The "| 0x01" is used to bring any owned windows to the foreground and
// activate them.
SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001));
return 0;
}
The comments are inserted by the VS code wizard.
Basically the application looks for another instance of itself in memory. If it finds one, it activates that copy before terminating itself.
By starting a second copy of the program, you merely reactivate the first one.
WinCE has a 32 process limit but this is set to change with WinCE 6.0. we will probably have to wait until at least WinMo 7 for this to filter through.

thanx stephj
do you know if anyone has created such a shell already?
I have heard of js hexmaster but couldn't find it anywhere, besides it's for application developers
TIA

Haali Reader is an ebook reader I use (and prefer over mobipocket) that supports multiple instances.

thanks noidtluom, I knew that, but i'm in too deep with mobipocket.
Do you know any other good ebook readers that can open prc format created by mobipocket?
Would really be great if there were...
cheerz

any updates on hacks to run multiple instances of the same program at the same time?
you seem to be able to do this on PC:
http://www.makeuseof.com/tag/how-to-run-multiple-versions-of-the-same-program-on-your-pc/
and here:
http://filesharefreak.com/2008/08/08/how-to-run-multiple-instances-of-utorrent-v177-v18/

Related

(MY) MAJOR BREAKTHROUGH: now, you can use Opera Mini as the system-level Web browser!

You, hopefully, already know Opera Mini 4, which, currently, I recommend the most for all Windows Mobile users as the primary browser. It’s especially useful if you are on either a slow (say, GPRS) or expensive (non-flat rate) data plan and/or you also use Opera on the desktop and, therefore, can make use of the excellent, remote (!) favorite synchronization offered by Opera Link.
So far, it was impossible to quickly invoke Opera Mini from any mailer applications by just clicking / activating Web links in them. This was a major stumbling block for many, which is quite understandable. Yes, it’s a major pain in the back to having to rely on Internet Explorer (Opera Mobile, Netfront etc.) for displaying the given Web page - instead of the much faster / cheaper / prettier Opera Mini.
Of course, Pocket PC (using the new terminology, Windows Mobile 6 Professional / Classic) users have always had an escape route. They still could highlight the link and, then, copy it to the clipboard. After that, they could still invoke Opera Mini, go to Menu / Enter Address and paste the URL there. (Assuming, of course, they use a copy/paste-capable MIDlet Manager. The outdated and, unless you have specific needs or an old operating system, in no way recommended TAO isn’t one of them; the recommended Jbed is.) An example of highlighting a link and copying to the clipboard is depicted in the following screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This, however, resulted in multiple screen taps and has never been so simple as just clicking a link in the mail body and let the system invoke the browser and pass the link to it.
And, of course, the above-explained way of copying URL’s to Opera Mini doesn’t work with touchscreen-less MS Smartphone (in the new terminology, Windows Mobile 6 Standard) models. Not even with external Copy/Paste tools like VITO’s excellent, free CopyPaste.
Because of the acuteness of the problem, I’ve thought very hard on solving the problem and making Opera Mini (OM for short) a browser that doesn’t suffer from this problem. And, during a lengthy swimming & sauna session, it occurred to me how it can be solved. Yeah, it’s mostly during swimming that I get the best, most revolutionary ideas
First, the pros and the cons so that you can see what you can expect of my solution.
Pros
Fully Seamless integration into Messaging (or any other mailer app), Notes, Word Mobile, PDF readers, MobiPocket (or any other text processing / viewing app) etc under ALL Windows Mobile / Pocket PC operating systems before Windows Mobile 6, on both the Pocket PC and Smartphone platforms
While it’s not compatible with WM6 Smartphones (WM6 Standard devices), on WM6 Pocket PC’s, you can still pretty easily invoke OM and pass the given URL to it.
It’s free and pretty easy to set up
Cons
It isn’t compatible with WM6 Smartphones like the HTC Vox (s710) or the HTC Wings (s730). Sorry.
With WM6 Pocket PC’s (unlike previous OS version), some additional manual work is needed, compared to the pre-WM6 cases. That is, just clicking the link won’t suffice.
It will NOT work on local HTM(L) files on your device – that is, not external links. That is, you won’t be able to render a local HTML file if you click it from File Explorer. However, as it’s mostly remote links that you’ll want to view, not local files, this isn’t that big a problem.
Again, let’s emphasize it again:
with WM6 PPC’s (unlike with pre-WM6 ones), you must copy the URL to the clipboard and only after this click the link!
It does NOT work with touchscreen-less WM6 Smartphones (WM6 Standard devices)! That’s because of the operating system’s inability for any kind of copy/paste operation.
Installation, usage
download and install MortScript if you haven’t already done so. Make sure you install it in the main memory (unless you’re ready to modify the scripts I’ve provided).
download THIS file
depending on your operating system version, go to either the WM5 or WM6 directory of the ZIP file downloaded in the previous step. Note that if you’re still using a pre-WM5 operating system, you’ll need the WM5 version.
transfer OMInvokeAndPasteScript.mscr to \Program Files\MortScript on your device
import the registry file into the Registry (WM5: OMInvokeAndPaste.reg; WM6: OMWM6DefBrowser.reg). if you do this on a MS Smartphone, make sure it is application unlocked. I’ve published several articles on (the absolutely legal) app unlock; see for example THIS
If you absolutely don’t know how the Registry import file needs to be imported, do either of the following:
either get (and, even better, purchase - they DO deserve it as it’s a REALLY excellent app) SOTI’s Pocket Controller. Install it, connect to your device, click the Registry icon. Then, select Edit / Import in the new remote Registry Editor window. Search for the registry file and import it.
or, get Resco Explorer. Install it on your mobile device; make sure you don’t disable the Registry editor install. Start the latter and, then, just exit it – this makes sure .REG files become associated with the Registry editor. Now, after you’ve transferred the REG file to your handset, just click it from inside File Explorer. Voila: it gets imported into the local Registry.
That’s all – from now on, clicking links in mails, documents etc. should fire up OM and pass the URL.
How you can (and when you must) modify OMInvokeAndPasteScript.mscr ?
The majority of the application logic is, in both the WM5 and WM6 versions, in OMInvokeAndPasteScript.mscr. Therefore, you’ll need to modify it in the following cases:
first, the most important instruction you’ll need to modify is the second row Run("\Windows\jbed.exe", "-run sX_"), where X is either 0 or 1 (I’ve set it to 0 in the WM5 and to 1 in the WM6 script).
As is explained in my earlier Opera Mini & Jbed-tutorial and posts (see for example THIS) , along with other people (see for example THIS), X stands for as how manieth OM was deployed under Jbed.
also note that, if you have to use a pre-WM5 operating system, it’s here that you need to define your TAO / IMB J9 links. Please consult the related section in the MIDlet Bible for more info on how these links need to be created.
Just remember the following: the Run() function requires two parameters, both enclosed in “’s. First is the executable; the second is the passed parameters. The latter string, of course, can (and with both IBM J9 and TAO, will) consist of several parameters.
the script is geared towards Opera Mini 4 users. Under Opera Mini 3 (or previous versions), the initial two SendLeftSoft calls will NOT result in the “Enter address” dialog coming up. With Opera Mini 3, therefore, you will need to change the second SendLeftSoft to SendCR as follows:
#SetClipText(url)
Run("\Windows\jbed.exe", "-run s0_")
Sleep(6000)
SendLeftSoft
Sleep(400)
SendCR
Note that the above code snippet has SetClipText(url) commented out (note the # at the beginning of the row). This is only needed under WM6; under previous operating systems, you MUST NOT comment it out.
finally, you can fine-tune the parameters of Sleep() in the code so that OM is still reliably invoked. With the code above, for example, I let MortScript wait for 6 seconds (6000 milliseconds) before starting to emulating left softkey presses.
Quick explanation for the different behavior under WM6 (only for geeks / hackers / programmers!)
Under WM6, invoking the default Web browser isn’t any more done the same way as under previous operating systems. There, the contents of HKEY_LOCAL_MACHINE\ SOFTWARE\Microsoft\ Shell\Rai\ : DEFBROWSER\1 tell the system what to invoke. Here, unfortunately, it’s impossible to define additional command-line parameters. Parameters DO get passed (in the background), but you can’t name them. MortScript, however, relies on the latter – that is, named parameters referable under their name, NOT their index.
Under pre-WM6 operating systems, it was easy to name the parameters you passed to programs as can clearly be seen in the WM5-specific Registry import file, which just overwrites the old value of HKEY_CLASSES_ROOT\ http\Shell\Open\ Command:
@="\"\\Program Files\\MortScript\\MortScript.exe\" \"\\Program Files\\MortScript\\OMInvokeAndPasteScript.mscr\" url=\"%1\""
Here, I’ve named the parameter “url”. This is why the first row in the MortScript file is as follows:
SetClipText(url)
This just instructs MortScript to copy the contents of the “var” variable (which, now, comes from the “outside” of the script) to the clipboard so that, later, it can be pasted back to the URL input field.
Feel free to quickly scrutinize the two, WM6- and pre-WM6-specific Registry import files so that you can see this for yourself.
Currently, I don’t know a way of naming parameters under WM6. Of course, when I come up with a solution, I let you all know.
UPDATE (11/29/2007): thanks to badbob001 on my blog, now, as opposed to the initial case, WM6 devices (both Pocket PC's and Smartphones) are FULLY supported!!!!!!!
This all means there is no longer a difference between how WM6 and pre-WM6 operating systems behave. You only need to make sure to get the right .MSCR and Registry import files from the already-updated ZIP file, depending on your operating system version. That is, for WM6, get the files from the WM6 subdirectory, for pre-WM6 operating systems, from the WM5 one. And, of course, modify the scripts if Opera Mini isn't deployed as the first app under Jbed, the, by default, supported (and highly recommended) MIDlet manager.
Again: Under WM6, manual link copying to the clipboard is no longer needed and, again, it works 100% on WM6 Smartphones as well!
(note that now that WM6 is fully supported, I haven’t edited the original article; its WM6-related parts are now outdated. Again, WM6 is fully supported now and there's no difference between the usability on pre-WM6 and the WM6 platforms any more.)
Undo
I hate to be a pain, but I am trying to view the registry file. Can you suggest a product to view the file? I followed the instructions and was having problems, so I am trying to undo the registry changes.
Thanks
Never mind. I found the registry entry.
Tnx for sharing this great idea ... always wanted one, at least until Opera Mobile 9 will be released.
I have HTC Artemis = WM6 Pro, Cloudyfa Jbed 20070802.2.1 on Storage Card and Opera Mini 4. This is the only midlet so far installed, none other present as of now.
Following is my experience:
1. When Opera Mini is not running, and has to be launched I always get a message "Could not find suite s0_", and then later Opera Mini does get launched but no address input happens. Simply the browser is launched in other words.
2. If Opera Mini is already running, everything works nicely ... no probs here.
3. I use this app, RSS Reader, Spb Insight (I think the best, beats NewsReader except that it has no podcast download support). When I click on the link address in the article (btw, I even cannot copy them in this app), PocketIE/Opera Mobile 8.65 is launched. How can this be resolved.
The script that I am using is that of badbob001, with small mod:
If (ProcExists("jbed.exe"))
Run("\Storage Card\Program Files\Jbed\jbed.exe", "-run s0_")
sleepmessage(3, "Please Wait...")
Else
Run("\Storage Card\Program Files\Jbed\jbed.exe", "-run s0_")
sleepmessage(6, "Please Wait...")
EndIf
SendLeftSoft
Sleep(100)
SendLeftSoft
Sleep(100)
SendEnd
SendHome( "",0,1 )
Sleep(100)
url = substr(url,2)
SetClipText(url)
SendCtrlKey( "V" )
Sleep(100)
SendLeftSoft
I have tried with the original one as well .... same results.
Ok, I got rid of s0_ error. After trying 0-10, I decided to delete the string all together and it launches now without any error. So the line now looks like:
newer --> Run("\Storage Card\Program Files\Jbed\jbed.exe")
older --> Run("\Storage Card\Program Files\Jbed\jbed.exe", "-run s1_")
So, why then we need this s0_ string anyway !!!
But then again, if Opera Mini is not running, after clicking on the link in e-mail, the midlet manager is launced and OM fired, and then no URL input happens. If OM is already running, then all is fine. And still haven't found how to resolve URL linking with Spb Insight application.
BTW, for my Artemis @260Mhz, sleep strings of "If= 2 and Else=4" seconds is perfect.
And, of course, the above-explained way of copying URL’s to Opera Mini doesn’t work with touchscreen-less MS Smartphone (in the new terminology, Windows Mobile 6 Standard) models. Not even with external Copy/Paste tools like VITO’s excellent, free CopyPaste.
Click to expand...
Click to collapse
Well, it works for me. If I recieve link in email I just click Reply to be able to select and copy the link. Open Opera Mini and paste the link (using Vito CopyPaste). The copy & paste works in intent Midlet Manager (v10.1.7.559) fine.
EazyVG said:
Ok, I got rid of s0_ error. After trying 0-10, I decided to delete the string all together and it launches now without any error. So the line now looks like:
newer --> Run("\Storage Card\Program Files\Jbed\jbed.exe")
older --> Run("\Storage Card\Program Files\Jbed\jbed.exe", "-run s1_")
So, why then we need this s0_ string anyway !!!
Click to expand...
Click to collapse
That is strange that just by running jbed.exe, opera mini is launched automatically or am I not understanding you?
EazyVG said:
But then again, if Opera Mini is not running, after clicking on the link in e-mail, the midlet manager is launced and OM fired, and then no URL input happens. If OM is already running, then all is fine.
Click to expand...
Click to collapse
Perhaps opera mini is taking longer than your script expects. In the original script with sleep(6000), it expects opera to run in 6 seconds. On my device, that is too short and I had to increase it to sleep(8000) or sleep(8500). Just launch opera and count how long it takes to get a rough idea.
Yes, you are right. I have deleted the string mentioning s0_ all together, and it does work without it. So, what you think.
Basically, here is what I tried:
Code:
If (ProcExists("jbed.exe"))
Run("\Storage Card\Program Files\Jbed\jbed.exe")
sleepmessage(2, "Please Wait...")
Else
Run("\Storage Card\Program Files\Jbed\jbed.exe")
sleepmessage(10, "Please Wait...")
EndIf
SendLeftSoft
Sleep(100)
SendLeftSoft
Sleep(100)
SendEnd
SendHome( "",0,1 )
Sleep(100)
url = substr(url,2)
SetClipText(url)
SendCtrlKey( "V" )
Sleep(100)
SendLeftSoft
What it does with that 10 seconds command is that, it launches Jbed, waits 10 seconds at the menu option (where there is a list of Midelets installed, in my case for now only Opera), and then only launches OM, and again there is no auto address input. So increasing seconds doesn;t give me anything. What can be the problem?
And what about handling of links in apps such as Spb Insight ... I haven't tried clicking links in any other 3rd party app, but perhaps the result will be same, i.e. not launching the OM but going straight to PocketIE.
MOVED our discussion .... as this one is for Smartphones. The link to your other General post:
http://forum.xda-developers.com/showthread.php?p=1707520#post1707520
I have problems with the url parameter on WM5 Smartphone.
If I have in the registry entry like this:
"\Storage Card\Program Files\MortScript\MortScript.exe" "\Storage Card\Program Files\MortScript\OMInvokeAndPasteScript.mscr" url="%1"
It says "There is no application associated with http://something.com. Run the applicaition first and open this file inside the application."
"\Storage Card\Program Files\MortScript\MortScript.exe" "\Storage Card\Program Files\MortScript\OMInvokeAndPasteScript.mscr"
This runs the script fine (except the address of course).
"\Storage Card\Program Files\MortScript\MortScript.exe" "\Storage Card\Program Files\MortScript\OMInvokeAndPasteScript.mscr" url=
This launches the script as well but it dosnt paste the url. I have moddified the script for my intent Midlet Manager but I still have "SetClipText(url)" and "SendCtrlKey( "V" )".
Any help?
I'm confused.
Here you say it worked...
EazyVG said:
Yes, you are right. I have deleted the string mentioning s0_ all together, and it does work without it. So, what you think.
Click to expand...
Click to collapse
But here you say a list of midlets comes up.
EazyVG said:
What it does with that 10 seconds command is that, it launches Jbed, waits 10 seconds at the menu option (where there is a list of Midelets installed, in my case for now only Opera), and then only launches OM, and again there is no auto address input. So increasing seconds doesn;t give me anything. What can be the problem?
Click to expand...
Click to collapse
If you see a list of midlets come up, IT DID NOT WORK. The point of all this "-run s?_" business to so that the midlet list is bypassed and the midlet is run directly. If you can't get this direct launch method to work, then you will need to modify the script to press enter at the midlist list to launch opera for you. You may think the script is working because a command in script 'accidentally' launches om for you but the script expects om to be already started.
You should study this page:
http://pdaphonehome.com/forums/ppc-...ed-includes-info-new-java-midlet-manager.html
EazyVG said:
And what about handling of links in apps such as Spb Insight ... I haven't tried clicking links in any other 3rd party app, but perhaps the result will be same, i.e. not launching the OM but going straight to PocketIE.
Click to expand...
Click to collapse
It is possible that applications ignore the system settings and launch links by invoking pocket ie. Did you even run a windows application and click on a link in help > about and internet explorer opens instead of your default browser like firefox. That application, instead of passing the url to the os to take care of, is running 'iexplore <url>'.
But here you say a list of midlets comes up.
Click to expand...
Click to collapse
Well, what I meant is where the list of midlets is showed, in my case, for now there is only Opera Mini, otherwise I am also gonna have few games, apps and Gmail.
It is possible that applications ignore the system settings and launch links by invoking pocket ie. Did you even run a windows application and click on a link in help > about and internet explorer opens instead of your default browser like firefox. That application, instead of passing the url to the os to take care of, is running 'iexplore <url>'.
Click to expand...
Click to collapse
Of course I tried, such as with links embedded in e-mails. So as I undersstand, not all apps follow what is known as Global Rules.
then you will need to modify the script to press enter
Click to expand...
Click to collapse
Can you please tell me how this script should look like, kinda never don this before on my own.
BTW, it does bypass the midlet list section, only when OM is already running in the background. I'll check the link you have given me ... hope it will shed some light.
EazyVG said:
BTW, it does bypass the midlet list section, only when OM is already running in the background.
Click to expand...
Click to collapse
It bypasses the midlet list because you already have a java application running. You can't go back to the midlet list until you quit the existing midlet application because you can only have one midlet running at a time. You'll just need to read the reference web pages to figure out what s?_ value to use to invoke om directly. If you already have other midlets installed, then you must have invoked another installed midlet by chance. If you had tried s0_ up to say s20_ (don't know how many midlets had you installed), then perhaps you jvm doesn't support direct run.
Is it possible that you have jbed installed on both the storage card and main memory and somehow it's looking for your midlets in the wrong storage location? Just a guess since I've just learned enough just to get om working and I don't have jbed on a storage card. According to the link, you should look in \windows\appdb and find the .jar for opera. Each midlet application should have a jar named s?_suite.jar where ? is a number. Once you know the value of ?, then you know what to put in your script. If you have your jars on the storage card instead, then you will need to research if you need to change anything to get direct launching working.
So for now, your problem is getting a midlet to directly run and has yet to even involve the link-copy-paste idea of the original post.
So far I have tried s0 to s10, and had maximum, prior to deleting the rest apart from OM, somewhere abound 6. I guess this has to do something with my Jbed being present in ROM (as it came with coocked ROM and I can't delete it) and one on storage, but am quite sure that the one from storage card is being run, as per registry inputs. I'll try to leave one just on main memory and reinstall the OM.
But still, the main question for me remains the one with 3rt party apps and embedded links in them, such as Spb Insight, which I use on daily basis. I hope soon one or the other solution will be found. Perhaps some tweak to be done in the registry itself for Spb and other apps to launch the Jbed/OM combo!
Tnx for the tip.
EazyVG said:
So far I have tried s0 to s10, and had maximum, prior to deleting the rest apart from OM, somewhere abound 6. I guess this has to do something with my Jbed being present in ROM (as it came with coocked ROM and I can't delete it) and one on storage, but am quite sure that the one from storage card is being run, as per registry inputs. I'll try to leave one just on main memory and reinstall the OM.
Click to expand...
Click to collapse
Did you look in the \Windows\appdb\ folder? Opera for me is installed as s0_suite.jar and has a size of 97.7KB (100,056 bytes). I had also applied a hack to the selector.utf file so that I'm not prompted for permission when opera wants to access the network. Do you get a prompt when opera starts? That *may* be related.
EazyVG said:
But still, the main question for me remains the one with 3rt party apps and embedded links in them, such as Spb Insight, which I use on daily basis. I hope soon one or the other solution will be found. Perhaps some tweak to be done in the registry itself for Spb and other apps to launch the Jbed/OM combo!
Click to expand...
Click to collapse
This may be answered here, starting at post #24.
http://www.howardforums.com/showthread.php?t=1283853&page=2
It looks like even on wm6, some applications still use the wm5 registry settings so you may need to apply the registry changes for both wm5 and wm6.
UPDATE (12/04/2007): Major WM6-related updates have taken place in the meantime.
In the meantime, my blog reader badbob001 has refined the script. Now, if you click a link, you’ll be presented a choice list, where you can select whether to pass the given URL to Internet Explorer Mobile, Opera Mini, just copy to the clipboard or just cancel the operation. This will help you in selecting the right browser if you (still) plan to use IEM (or other native Web browsers like Opera Mobile, Netfront or Minimo).
Cool, eh?
Remember that you don’t need to deploy this script if you don’t need this kind of functionality but always want to be redirected right to Opera Mini. Therefore, I’ve also included the older version of this script in the ZIP file. It’s in the NoBrowserSelectionDialog subfolder. Note that this script has also been updated a bit: it checks for Jbed already running; if it is, then, it doesn’t wait that much. Again, thanks for badbob001 for refining and performance-tuning my initial script.
Note that the usual stuff applies: if the script doesn’t invoke Opera Mini but invokes something else, edit both occurrences of s0 and appropriately change 0 to a greater number.
Finally, note that, these updates & bugfixs being all WM6-related, I haven't edited the old, WM5-related, working MortScript file. If you need some speedup and/or dynamic, runtime selection of the browser you'd like to use, you'll want to copy either of the two new MortScript files - it'll work.
2. Upon HowardForums forum member volwrath’s bug report, I’ve enhanced the Registry import file to support invoking Opera Mini from all applications, not only Messaging and Notes. I wouldn't have thought WM6 is so half-baked (that is, half of the apps still depend on the pre-WM6 (that is, the HKCR/http/Open/Command) way of invocation). That is, the WM6 Registry import script has also been enhanced (basically, I've just added the contents of the old WM5-related Registry import file to it), not only the MortScript file.
Note that reading local files will still default to the system-level browser as I haven’t redefined the default application for opening .htm(l) files. That is, by default, Internet Explorer Mobile will open these.
Again and again, it can’t be stressed enough how much these hacks enhance the usability of Opera Mini under Windows Mobile! I really recommend giving Opera Mini a try – you certainly won’t regret it!
Thanks Menneisyys and badbob001 ..... you the king of the hill.
On my HTC P3300 running WM6, Claudyfs Jbed 1.2, now all is working exceptionally well. Now with the updated script and reg tweak even the links embedded in 3rd party apps (such as the one I mentioned, Spb Insight) the OM get's launched and the browser shows the web site without any delays. The only thing I changed was the Sleep string from 6 to 4.
I can't thank you guys enough ... definitely MAJOR BREAKTHROUGH
UPDATE (12/12/2007): upon the problem reports of several Smartphone users (see the posts for example HERE), I’ve released a slightly modified version of the script that, instead of pasting, uses keyboard emulation. This makes it possible to use the script on some Smartphones that are incompatible with pasting.
The script is available HERE. Remember to remove the SP.2 extension before deploying it. Note that, again, it's ONLY meant for Smartphone users that previous script versions didn't work with!!!
Note that while it works on for example the I3 Beta of WM6 of the Samsung BJ, it doesn’t do the same on the (original) WM5 version of the same device or the HTC Vox (s710). It seems it’s impossible to support these devices with the current MortScript version. I'll also try to reimplement the script in nScriptm (another, less widely used scripting language / interpreter) - hope it is able to paste / send characters to these, still incompatible MS Smartphone models.
UPDATE (12/13/2007): I’ve also made available the Registry import file you’ll need to use when reverting to the original, Internet Explorer-only associations. It’s HERE.
UPDATE (12/15/2007): XDA-Devs forum member shlomki has just released the different hacks in CAB format so that they’re very easy to install. They’re available HERE. Comments are welcome. (Note that, due to lack of time, I haven’t checked them.)

Programming/Development question

I hope this doesn't get lost in the sea of other questions.
Im working on a little program for my Visual Basic 08 class. Im going a bit further with it and making a windows mobile version of it. (currently using the WinMo 5 SDK) The program works fine in the windows platform, however when i copied the code over to the WinMo version, there was a few issues with the code. Most of it i manage to find the new syntax for and get it working on the WinMo emulator, however there is one problem that persists. TabControl.focus. This function does not seem to work in the WinMo development. Any Code i input that looks for what tab has focus, is ignored, like it doesn't know to look for the focus. Here is what im trying to do.
I have a program, with 2 tabs, and one button. I need that one button to execute two separate code blocks, depending on which tab is active. However i cannot get it to recognize, or do not know the proper function to get it to see which tab has focus, and execute the proper code accordingly.
Now, the simple fix for this would to just make another button, and place one each inside the tab, but i wanted to avoid that for as much as possible, and since it workers fine on the windows end, i know there has to be a way to get it working on the winmo end. By the way, im doing this in VB because im learning VB for a class, and the more coding practice i get the better ill do in class. Im sure there is a better way to do this in C# or whatever else.
Anyone know the workaround for this?
Im currently using Visual Studio 2008 Pro with the WinMo 5.0 SDK.
Your two tab pages are already part of a tabcontrol object. Use that to find the active tab with its property tabControl1.SelectedIndex This will return a zero based index integer for each tab paged attached to it. The object names used here are the default ones created by the IDE
Sorry, I only code in c#, but the VB code will be almost identical.
In the code for the button click event -
if(tabControl1.SelectedIndex == 0)
{
// tabPage1 active
}
else
{
// tabpage2 active
}
c sharp's double equals is the same as VB's single equals, in the sense that it means 'is equal to'.
There is not "active" property in vb (atleast not in vb mobile code) so that doesnt work
Im somewhat fimiular with c++, so i can atleaast understand the code when you put it in C format, but i have a bit of trouble converting C code to vb format. In this case, in normal (non-mobile) the .focus would be enough to make it work...
Here is what i tryed to make work..
Code:
'Changes what the "Roll" button does depending on which program tab is selected.
Select Case True
Case xTabPageCombatRoll.Focus
Call RollCombat()
Case xTabPageRandomRoll.Focus
Call RollRandom()
Case Else
MessageBox.Show("The Tab Control code didnt work")
End Select
both tab pages are part of xTabPageCombatRoll object
I'd suggest asking Development questions in the Dev&Hack section.
(yes, new rules)
Here's the screen shot and the c# application to go with it. Its in VS2005 but VS2008 will open it and convert the solution and project files to 2008 format. Once that happens VS2005 will not be able to open it.
The lines starting // in the code in the previous post above are comments. Same as VB's ;
thanks steph, i have 2005 installed along with 2008 so i just ran 05 . That code does work. But i still cant find anyway to translate that into VB (as .SelectedIndex is not valid in VB code)
ugh.. the more i work with VB the more i like C based code. But im in a VB class so im trying to keep doing stuff in VB so i can pass the class.
SelectedIndex is a property of the TabControl, a .NET framework object It does not matter which language you use to access it. VB, C#, C++, take your pick .
To prove the point here is the same project in VB. I had had to do this on another machine, as I only have C++ and C# installed on this one.
It only had the WM 2003 SDK on it. If your machine has the .NET CF 2.0 the .EXE should work, if you drop it on your device.
Another trick is to use Red Gate's .NET Reflector. If you point it at the original exe generated by the C# project in the previous post above, it decompiles it in C# as
Code:
private void button1_Click(object sender, EventArgs e)
{
switch (this.tabControl1.SelectedIndex)
{
case 0:
this.label1.Text = "Page1 is active";
break;
case 1:
this.label1.Text = "Page2 is active";
break;
}
}
If you decompile it as VB instead you get :
Code:
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Select Case Me.tabControl1.SelectedIndex
Case 0
Me.label1.Text = "Page1 is active"
Exit Select
Case 1
Me.label1.Text = "Page2 is active"
Exit Select
End Select
End Sub
Ahh..
I got it to work now.. My problem was i wasnt specificly using Case 0 and Case 1, but instead using Case Tabpage1, and Case Tabpage2, which wasn't working.
Thank you VERRRY much.. The program is working like it should now and it makes me verry happy

[Q] Open a Programm twice parallel?

Hi everybody,
is it possible to open a programm twice parallel? I want to open the coreplayer twice, one time for music and another time for audiobook. Is that possible?
thx, mic
It's probably not too hard to write a script for it.
trying talking to either vijay or oldsap.
Depends on the code in the program itself. In the shell code created by Embedded C++ in the InitInstance function there is the following code:
Code:
hWnd = FindWindow(szWindowClass, NULL);
if (hWnd)
{
// set focus to foremost child window
// The "| 0x01" is used to bring any owned windows to the foreground and
// activate them.
SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001));
return 0;
}
In other words when the application starts, it looks for another active process with the same name as itself. If it finds one, it activates it, then kills itself.
thx for try to help me - that means it is not possible?
The original PPC programming guidelines by Microsoft stipulated that only one copy of a program should be running at any one time. In later versions of Windows CE/PPC a lot more processes are allowed to run simultaneously. They may have changed their tune over this since. Try and launch it twice, then go to Settings->System->Memory and see if there is more than one copy in Running Programs. If there is only one, then I'm afraid the answer is no.
P.S. If you create a Windows Mobile Win32 program in C++ under Visual Studio 2008, it still has the process checking code in it by default.

[Q] web app

Hello,
I dont know if the title fits, so i gonna explain my Problem.
I want to Programm a Game With User Login. Sadly wp7 doesnt Support SQL api, so i cant make the User Management directly over sql.
So i got a Website with a working Login Formular. I want to link the wp7 textboxes with the textboxes of the Website which works with SQL.
Is there a simple way to get this working? Or does anyone have a better idea to get my User Management working?
Greatings win99
Sent from my HD2 using Board Express
Hmm... I can only suggest you to learn how to do http requests (and general programming of course). I hope u'll stop thinking in terms like "linking textboxes"
yeah, "linking" is maybe the wrong word
What exactly do you mean with "http request"?
I can program a bit html an php, which i could include in a "WebBrowser" control. This way i could use php with mysql, but i don't want to make a browser game.
Is there somethink like a "http database"? Cause i don't know yet any database based on http. And is there an API availible to do this requests from a panorama app?
Sorry for this basicly questions, but i'm just a hobby programmer and since now i just programme windows desktop projects, where i could easily use SQL.
Your "very basic question" requires a very long answer (sorry, but I don't have enough time. Also, I'm not an expert in SQL http communication). FYI, all communications between web page (and you can treat your WP7 page as a web page) and SQL server based on HTTP POST requests (but of course not on "linked textboxes"! ). So, try to google with words such as "WP7 SQL HTTP POST" - first five links possible will have all info you need (but you should understand "how everything works" first!)
ok, if i understand it correctly, this sound like instead of using "app<->SQL" i should use "appy<->http<->sql".
i will try to find some good tutorials and reply on success/ no success.
win98 said:
ok, if i understand it correctly, this sound like instead of using "app<->SQL" i should use "appy<->http<->sql".
i will try to find some good tutorials and reply on success/ no success.
Click to expand...
Click to collapse
Well, from the sounds of it, I am going to assume you networking and web API knowledge and maybe decent enough MySQL/SQL/Database knowledge, and possibly somewhat new to WP7 C#.NET (Don't take this personal or a lashing towards you, not the case, I mention it so I can be basic and to the point without assuming you know what references I make or offend you).
If you want an "out-of-the-box" easy solution, let's stop and go download RestSharp (http://restsharp.org). After you get it, visit: https://github.com/restsharp/RestSharp/wiki/Getting-Started, as this will give you a great example of HOWTO use this solution.
You also need to remember about the footprint, a 90MB limit (Max) on 256MB phones. Too big can cause some issues.
Also, another good option is SQLlite, probably one of the most popular, straight forward and well respected (I even use it on some projects). Should you choose to use it, go to http://sviluppomobile.blogspot.com/2010/07/wp7-sqliteclient-preview.html and read his Blog post, VERY informative and a Sample available for you to learn from as well.
If you really wanted to do this yourself, you could create an HTML page and do all your coding in it (e.g. Login Box) and use JavaScript as well, this way you grab the contents from your textbox(s) and send to the embedded web browser you load the HTML page in, hence scripting is available for WP7 but must enable scripting support and highly recommend to use IsolatedStorage and can invoke JS just as easy as:
window.external.notify("(Task)Param)");
So this should hopefully get you to where you want to be but if any of the above statement I made was true, I recommend out-of-the-box solutions for you.
Thanks,
Lance
lseidman said:
If you really wanted to do this yourself, you could create an HTML page and do all your coding in it (e.g. Login Box) and use JavaScript as well, this way you grab the contents from your textbox(s) and send to the embedded web browser you load the HTML page in, hence scripting is available for WP7 but must enable scripting support and highly recommend to use IsolatedStorage and can invoke JS just as easy as:
window.external.notify("(Task)Param)");
Click to expand...
Click to collapse
This is the way i planned to do it. How do you call it? For me it is hard to find a tutorial or book or something like that, cause i don't know which keyword to google
thanks anyway
win98 said:
This is the way i planned to do it. How do you call it? For me it is hard to find a tutorial or book or something like that, cause i don't know which keyword to google
thanks anyway
Click to expand...
Click to collapse
First and foremost, I appreciate your honesty which is why I will basically show you the way...
Well, if you wish to invoke JavaScript via WP7 you can, like below:
1). Open your Mainpage.xaml and find the grid and insert:
<phone:WebBrowser HorizontalAlignment="Left" Name="webBrowser1" VerticalAlignment="Top" Height="xxx" Width="xxx" IsScriptEnabled="True" ScriptNotify="webBrowser_callback" />
2). Make an HTML page, go in the HEADER section and type something like: "<SCRIPT LANGUAGE="JavaScript" src="HelloWorld.js"></SCRIPT>" and add a button that has a function to fire upon clicking + name the section like:
<h1 id='myName'>Hello World!</h1>
<form>
<input id="button" type="button" class="button-standard" style="width:200;height:100" value="Hello World!" onClick="HelloWorld()"/>
* Remove the Quotes from above...
3). Make a file called HelloWorld.js and put in something like:
function HelloWorld() {
window.external.Notify("Name");
}
function sets(val) {
document.getElementById('myName').innerHTML = val;
}
4). In your Mainpage.xaml.cs, find where you want to invoke the script/site and put in:
webBrowser1.Navigate(new Uri("http://lance.compulsivetech.biz/login", UriKind.Relative));
*Change the URI to your address, not my blog's fake login...
5). Since we are loading the site locally in Isolated Storage, go forth and type this in:
private void CreateDirOnStore(string strDir)
{
// Create a directory for local storeage.
IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
if (!isoStore.DirectoryExists(strDir))
isoStore.CreateDirectory(strDir);
}
private void SaveFileToIsoStore(string strFileName)
{
// This will save the file to the isolated storage based on the string provided.
IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
//remove the file if exists to allow each run to independently write to
// the Isolated Storage
if (isoStore.FileExists(strFileName) == true)
{
isoStore.DeleteFile(strFileName);
}
StreamResourceInfo sr = Application.GetResourceStream(new Uri(strFileName, UriKind.Relative));
using (BinaryReader br = new BinaryReader(sr.Stream))
{
byte[] data = br.ReadBytes((int)sr.Stream.Length);
//save file to Isolated Storage
using (BinaryWriter bw = new BinaryWriter(isoStore.CreateFile(strFileName)))
{
bw.Write(data);
bw.Close();
}
}
}
6). In your public MainPage() put:
this.Loaded += new RoutedEventHandler(Load_WebPage);
* Always put stuff after your Intialize call
7). We need to make a page load function as below (in xaml.cs):
void Load_WebPage(object sender, RoutedEventArgs e)
{
//Set the start folder of the widget and navigate to the start page
CreateDirOnStore("helloworld");
SaveFileToIsoStore("helloworld/index.html");
SaveFileToIsoStore("helloworld/helloworld.js");
webBrowser1.Base = "helloworld";
webBrowser1.Navigate(new Uri("index.html", UriKind.Relative));
}
8). Now we invoke the function as seen below:
void webBrowser_callback(object sender, NotifyEventArgs e)
{
//Use invokeScript to give to the web env.
webBrowser1.InvokeScript("eval", new string[] { "sets('txtName.Text')"});
}
Hope this helps, this is basically off the top of my head but should be pretty close to being right and Mango Compat.
Creating a WCF services that calls SQL will be the quickest way...about 30 minutes.

Link contact adress to Nokia Drive

I use my7rom on my Omnia 7.
Is there anyway to link a contacts adress to Nokia Drive instead of Maps (stock wp7 app). It would be much more practical if Nokia Drive opened a navigation session instead.
Anyone up for the challenge? A reg-tweak perhaps?
// Manneman
Skickat från Windows Phone 7.8
There's two parts here. The first is identifying the correct "filetype" or URI scheme that is used for navigation. That shouldn't be too hard; a little digging in HKCU should reveal it. We already know about ones like callto: and http: and I'm actually (slowly) working on an app to allow people to easily change them. The second part is finding the correct command to load that address or route in the Nokia Maps app. If the app supports pinning routes or destinations to Start, this is probably possible. If not, it may not be possible in the app. Most apps aren't designed to accept command-line parameters, so even if you make them the default handler for a given filetype or URI scheme, they ignore the value you send them and just start as though launched from Start.
GoodDayToDie said:
If the app supports pinning routes or destinations to Start, this is probably possible.
Click to expand...
Click to collapse
Nokia Drive supports pinning to start so it should be possible. Unfortunately I can't tell you exact command line parameters 'cause my Lumia 900 still "in jail"
Let me see if I have a copy of the Nokia Drive XAP handy. I'll need to decompile it to figure out the correct parameters for launching it with the intent of navigating to a specific location. Note also that this might not be possible directly - for example, the app might store a list of locations internally, and the tiles only provide an index into that list rather than providing the location directly - but that just requires another layer of indirection.
In that case, you create an app that gets registered as the navigation handler, and in response to a navigation request, it writes the requested location into the Nokia Drive app and then chain-launches Nokia Drive with the index of the newly written location. That's just an example of one way that this might go wrong, but overall, the odds are actually pretty good. Obviously, all of this will require, at a minimum, write access to the HKCR hive in the registry.
Ah, guys! You are so kind helping me out. I´m really certain alot of members in the WP7 section would love for this to work!
// Manneman
GoodDayToDie said:
I'll need to decompile it to figure out the correct parameters for launching it with the intent of navigating to a specific location
Click to expand...
Click to collapse
GoodDayToDie, you may try much simpler solution. Just create assembly (dll) to show startup parameters in message box, and replace main Nokia Drive dll (but pin some location first).
That's actually harder than it sounds; even if the app is sideloaded (which would mean I already have the DLL) my fake would have to mimic the internal structure of the real app to a degree (namespaces, class names, default actions, etc.). That's not hard, but decompiling .NET is pretty trivial too.
AFAIR, Nokia Drive is obfuscated (but I'm not 100% sure). Also, you don't need to duplicate all names and structures; just a stuff mentioned in WMAppManifest (I hope so). BTW, I forgot: I still have unlocked handset; if I'll found time, will try today later.
Update: tried but without of luck What I did:
- installed Nokia Drive first;
- downloaded map and pinned current location;
- created fake app with same app guid and namespace name ("Drive"), and performed app update (that operation completely override whole solution but NokiaDrive tile still pinned to the start screen);
- tried a few different page names (_default.xaml, QuickStartPage.xaml, DestinationPickerPage.xaml, FavoritesPage.xaml) with code
Code:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
MessageBox.Show("Hello from fake dll");
if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New)
{
string[] keys = NavigationContext.QueryString.Keys.ToArray();
string[] values = NavigationContext.QueryString.Values.ToArray();
string param = "";
for (int i = 0; i < keys.Length; i++)
{
param += keys[i] + " -> " + values[i] + "\n";
}
MessageBox.Show("parameters: " + param);
}
}
But result always the same: app doesn't start from the pinned tile
Update 2: Finally, I did it
The trick is:
- do the same as I've described above (you should have pinned tile from ND);
- add following code to the start page:
Code:
public MainPage()
{
InitializeComponent();
var appTile = ShellTile.ActiveTiles.Last();
if (appTile != null)
{
//MessageBox.Show(appTile.NavigationUri.OriginalString);
EmailComposeTask emailTask = new EmailComposeTask();
emailTask.Subject = "NokiaDrive pinned parameters";
emailTask.Body = appTile.NavigationUri.OriginalString;
try
{
emailTask.Show();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK);
}
}
}
- run app as usual (not from tile);
We allset - all params are sent to our email (I'm too lazy to manually copy all stuff )
Here we are (start parameters; bold values are changed for privacy reason ):
/_default?destination.name=200 SomeName Street&destination.latitude=49.5255378801376&destination.longitude=-72.4296837244183&destination.address.street=SomeName Street&destination.address.houseno=200&destination.address.district=&destination.address.county=&destination.address.city=SomeCity&destination.address.state=&destination.address.country=USA&destination.address.postcode=05720&destination.hashCode=371767793destination.address.statecode=MA&pinnedFrom=Favorites
P.S. Just found: Navigon also has ability to pin address to the start tile So, if you find the way to modify map protocol (or how it calls), it will be a really nice hack! BTW, could you remind me: do we have ability to launch assembly by GUID (on the full-/policy-unlocked phones)? If "yes", it's possible to write a real nice "proxy" app to handle map requests
I don't know about launching assemblies directly, but it's certainly possible to launch apps by GUID. It doesn't even require anything more than dev-unlock in fact (although of course you can only launch apps that you could launch anyhow). So yes, a proxy app is totally possible. That's actually what I'm working on (started as a project to make a Kindle ebook file loader, that would pur .mobi/.prc file in the Kindle app's folder and then launch the app).
GoodDayToDie, could you please, take a look to the registry, for default map protocol handler and figure out how to change that stuff? I'm pretty busy these days (and probably will be extremely busy couple of next months) but we can cooperate and create this app...
I'll investigate, but you're not the only one busy. If you've noticed a lack of software from me recently, it's due to the nex job I got some months back; I love it, but it leaves me with a lot less time for phone hacking if I want to still have a life outside of that.
With that said, this actually ties into the work I'm already doing with things like filetype handling and default browser switching. I can send you my HKCRlib, at a minimum; it's a library that simplifies interacting with HKCR, including creating backups of important values when they change, and reverting the backups.
GoodDayToDie, truly, I'm not much interested (personally) in that hack 'cause I can't use it for my Lumia 900. So it's only for the community needs but because of lack of time, I believe, we may put it on hold.

Categories

Resources