Start IE in full screen on boot - Windows Mobile Development and Hacking General

Dear XDA-Developers,
As a volunteer for a project i'm making a webapplication which is controlled by a pocket pc.
To make it useable for people i want Internet Explorer to start automatically on the boot of the device. That on itself isn't that hard, i know.
I need IE to open a specific webpage, and go in full screen mode.
Maybe it's not that difficult, but next to webdeveloping, i can't make software etc. so i was hoping someone has a solution for me. It would be a big help.
Thanks in advance.

You can use Resco Explorer to make a shortcut like this:
"\Windows\iexplore.exe" http://www.xda-developers.com (To open your favorite site )
You can put this link in \Windows\StartUp\
I currently don't know a method to open fullscreen.

Well last time I tried if I exit IE when it's full screen, it stays full screen next time I opened it. This is with WM6.

Hi,
Not sure if this will help but Confused Stu has just released a ROM that starts IE in Full Screen.
http://forum.xda-developers.com/showthread.php?t=371014
Cheers.

THIS is how to start Pocket IE in FullScreen mode
I'm sure this is waaay too late for your project, but for the sake of posterity (and for the search engine) here is how to start Pocket IE in FullScreen mode...
It's in the registry- HKCU\Software\Microsoft\Internet Explorer\Main
the key is a DWord called "FullScreen" set it to 1.
Obviously, if PIE is already running (minimized but not closed) you'd have to kill the process, write the registry entry, then open PIE. PIE retains the fullscreen setting until you change it (either via the registry or by exiting fullscreen mode within PIE) but it couldn't hurt to check the registry value before firing up PIE.
All of this easily done via Mortscript. In the case of a console-type app that runs on startup and you want the user to stay in that app (and out of the rest of the system), you'd want to check periodically to make sure PIE was the active window, and activate it if not. You might also want to prevent access to the PIE menus (via the SoftKeys) and also the Start Menu button. I'm sure there's a util somewhere to disable the HW buttons, but off the top of my head, I can't think of any.

Related

Dealing with icons, screen orientation, and MortScript

I apologize in advance if this gets too technical for some, but after you read it, you may understand why I took the time to do it and ultimately offer it here.
First of all, if you noticed after a soft reset that it takes some time for Windows Mobile to show the programs you have installed on your device, you'll quickly realize that the reason why it's so slow is that it's grabbing the icon image from the shortcut's executable, which is usually located at the end of that executable.
Now, you'll also notice that some icons appear slower than others. Most of the time, it's because the program's executable is usually big. Take Skype, for example. It can take up to 20 seconds just to show the stupid S icon because the single executable is about 5MB big.
All that effort to get to an icon is painstaking, and surprisingly enough, the issue remains in Windows Mobile 5.0. Why Microsoft never learned to cache the icons in a single file is beyond me. And you'll have to deal with it after every soft or hard reset... Of course, the average user here does that often, so you can see where I start to get frustrated.
But with frustration comes inspiration (or desparation).
I have created a small 26KB file called RunSkype.exe. All it does is launch Skype. While that doesn't sound helpful much, you'll realize that if you copy this file to the Skype folder, then create a shortcut to RunSkype.exe and replace the Skype shortcut with this one, you'll see that the icon and program will show up MUCH faster than having Windows Mobile 5 try to poll the 5MB file.
I also took the liberty of making a full VGA-compatible icon for Skype, so it looks good from 16x16 pixels to 64x64 pixels.
You can download the program here: http://www.beyondthetech.com/downloads/phone/hacks/RunSkype.exe
Now, for us HTC Universal owners, you're in for a treat. A really awesome program called MortScript has been released. MortScript is essentially a batch language which you can have steps completely automated for you, based on a text file of commands you create. You can simulate button and keypresses, stylus taps and holds, execute and close programs, read/write registry entries, and much more.
http://www.sto-helit.de/modules/edito/content.php?id=38
One of the biggest gripes I have on the Universal are the developers who have not yet dealt with landscape mode. Some games such as Pocket Mini Golf 2 and Farkle, will either look nice or screwed up, and/or the stylus will not work properly because the image doesn't match the screen coordinates. Avid Universal owners will know what I'm talking about.
Using MortScript, I create this batch file:
Code:
Rotate 0
RunWait \Program Files\Smart Box Design\Farkle.exe
Rotate 270
If it isn't obvious, the batch file will rotate the display to portrait mode, then launch the program. After the program has exited, it will revert back to landscape mode. Again, Universal owners such as myself have kicked themselves for launching a program knowing they have to flip the screen before they run it in order for it to work. This batch file takes the forgetful step and makes it automatic. Flipping the screen to portrait afterwards makes no difference since it's already in portrait, so you're all good to go.
The only downsides to this are two things: 1. If the program doesn't actually exit, but minimize, then it will never get a chance to rotate back. In that case, I delete the last line of the batch file and change RunWait to just Run. 2. It's obvious that you'd make a shortcut to the batch file, not the program's executable anymore. Soon, you'll notice that all the shortcuts will have the same MortScript icon, and that just looks ugly.
This is where my second executable comes in. But, this is going to require some work and an icon editor such as MicroAngelo.
I created a program called batchrun.exe. After you have created your MortScript batch file, save it as batchrun.mscr and put both files in the program's folder. Drag the batchrun.exe and the original program's executable out to your desktop. Using MicroAngelo's Librarian software, you can extract the icon images out of the original program's executable and inject it into batchrun.exe. That way, when you create a shortcut to batchrun.exe, it will have the original icon of the program you want to run.
So, the chain of command is: batchrun.exe -> batchrun.mscr -> commands + original program's executable
One final word... batchrun.exe is hardcoded to run batchrun.mscr, so you can't change the name of the batch file. In addition, you cannot change batchrun.exe's name either, since it's tied into the programming. But you can modify its icon data all you want.
Some of the programs I have successfully done this for include:
Acodic Mobile Info2Go
Handmark Zagat to Go
Resco Diamonds
RealDice.com Texas Hold'em
Smart Box Design Farkle
EdgeQ TrafficEdge
Momentum Games Pocket Mini-Golf 2
Again, the above listed programs do not play well in landscape mode, but with the batch file commands I provided above, it makes using these programs much easier.
Here's batchrun.exe. It currently has my BeyondtheTech Guy logo, but again, use an icon editor software like MicroAngelo to replace it as needed.
http://www.beyondthetech.com/downloads/phone/hacks/batchrun.exe
Here's a bonus. I like keeping the Start Menu as clean as possible. This includes the Recent Start Menu items that appear the moment you start launching away at shortcuts. You may recall that if you never ran anything, all it said was "Recent Programs" and the Start Menu was as short and simple as possible.
Well, you can always get that fresh feeling by creating a MortScript batch file containing this line:
Code:
RegDeleteKey HKCU,\Software\Microsoft\Shell\TaskSwitch,1,1
Call this file cleanup.mscr and stick it in your \Windows\Startup folder. As soon as you boot up from a soft reset, it will silently wipe out the most recently launched items.
Hope this was helpful to anyone.
If anyone needs help or doesn't understand any of this, just let me know.
RunSkype.exe .... thanks for that
S

Simulate touchscreen tap, or add ShortCut key.

Hello,
I have such a problem. But first I will explain why I have that problem.
In company we are using a PocketPC with Windows Mobile 2002. And have only one apllication for work.
When connecting to Server we need to tap the left bottom corner of the screen.
Many of workers tap with diferent objects like cutters, pens, not with Stylus, so the left bottom corner become bad in 1-2 months, till the time I can't do nothing, just changing the screen.
So. There is a posibility to implement somehow a ShortCut to that menu, to avoid taping that part of screen? (Because after that in program we use only buttons.)
(Note: I have no source code for tha app.)
Any kind of help will be apreciate.
Thank you much!
It's easy to simulate screen tap by code.
Do you have experience programming in C/C++?
If so all you have to do is write a little app that does the following:
Code:
HWND hWnd; //window handle
hWnd = FindWindow(L"BUTTON", L"Connect to server"); //this text is just an example
SendMessage(hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(5, 5)); //actually simulates the click
Then you can assign this app to a hardware button using device settings or put a shortcut to is in the start menu.
I don't know of any ready apps to just simulate a click, but there was a thread around here somewhere on a virtual mouse app for PPC. It's free so try searching for that. (Sorry, don't remember the link).
Good luck.
Thank you man.
I'll try this...
levenum said:
It's easy to simulate screen tap by code.
Do you have experience programming in C/C++?
If so all you have to do is write a little app that does the following:
Code:
HWND hWnd; //window handle
hWnd = FindWindow(L"BUTTON", L"Connect to server"); //this text is just an example
SendMessage(hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(5, 5)); //actually simulates the click
Then you can assign this app to a hardware button using device settings or put a shortcut to is in the start menu.
I don't know of any ready apps to just simulate a click, but there was a thread around here somewhere on a virtual mouse app for PPC. It's free so try searching for that. (Sorry, don't remember the link).
Good luck.
Click to expand...
Click to collapse
So I have not so many experience in C++ and nor in Visual Studio.
Can you provide me with full c++ code for Visual Studio 2005?
Thank you in advance.
Here is another way. Just create a simple project in vis studio ( I am not using 2005 so I cant tell you what its called, if all else failes use the "hello world" option). Open the main .cpp file and after the includes delete everything. Paste this in....
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL);
return 0;
}
Then build the exe. Make a shortcut to the exe on your device and place it in the windows\start menu folder. When the user taps the shortcut the cordinates specified will get a mouse down message, not all ppc programs will rspond to this message but most bought software I have do.
As it is, this will hit the close button on a 240*320 display. To vary the target location see this from the documentation:
If MOUSEEVENTF_ABSOLUTE value is specified, dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner.
...So you may need to play with it to hit the spot.
If that fails then just replace the
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL);
with levenum's code putting the name of the window you are talking about in instead of "Connect to server" to send the normal WM_LBUTTONDOWN message to that window.
OdeeanRDeathshead, your method seems to work. I did it and application works proprely on my Magician.
But now the question is: I need that program for a PocketPC 2002 platform. How to do this in VS2005, can explain me anyone?
Thank you in advance.
Actually, you can't write apps for WM2002 using VS2005.
You need eMbedded Visual C++ 3. It is available free from Microsoft, just search the site. You will also need to install Pocket PC 2002 SDK. (also free on MS site)
levenum said:
Actually, you can't write apps for WM2002 using VS2005.
You need eMbedded Visual C++ 3. It is available free from Microsoft, just search the site. You will also need to install Pocket PC 2002 SDK. (also free on MS site)
Click to expand...
Click to collapse
Ok.. all this I installed.
I will try to do the program there. But problem become more complicated.
My PDA's are not HTC. They are modified by SYMBOL company. So.. I realized that i have no HARD BUTTON.
In start menu I can't let the application, only because START is not accessible. The only program is that for work and it's full screen.
The PDA have a keyboard.
The question is: it is possible to do in program a HOT_KEY combination, and run MOUSEEVENTF_LEFTDOWN only when HOT_KEY combination was pressed.
I understand that program must remain in memory to intercept that.
Do you mean that there are no buttons on your device, only a keyboard?
Doesn't matter really because as far as windows is concerned keystrokes from device buttons and full keyboard are handled the same.
Sorry I am not really familiar with setting up hot keys, I think your app window needs to have input focus for that to work.
There is a function called SetWindowsHookEx that lets you hook all keyboard events so they will pass through your function. You can then have a small app in background (without UI) that will monitor any key combination you want and simulate the tap when necessary.
levenum said:
Do you mean that there are no buttons on your device, only a keyboard?
Click to expand...
Click to collapse
Yeah.... it looks like this http://www.symbol.com/PDT8100
I do not know if you can throw some cash at your problem but SKScHeMa from www.s-k-tools.com can wait for an application to start then execute a script. In the script you can simulate both tap and tap and hold actions.
Hope that helps.
Regards cjb.
One of those buttons must correspond to the buttons on the normal ppc. It would be overkill too write an app to run constantly just to redirect one tap. Do you have the opportunity to ever start the unit without the fullscreen program running, if so you could experiment with the button assignments to find the correct one. If the author of the custom software on the thing was half good they could have disabled those buttons assignments while its running, but if they didn't thats the best solution.
If that fails perhaps a program to run after powerup and ask if the user wants to connect to the server could work. It could show for 10 seconds then end. There was a thread here somewhere about programs starting on powerup but I can't seem to find it now.
edit:
I read the specs and it has two "side scan keys", I bet they are your buttons waiting to be reassigned!
OdeeanRDeathshead said:
One of those buttons must correspond to the buttons on the normal ppc. It would be overkill too write an app to run constantly just to redirect one tap. Do you have the opportunity to ever start the unit without the fullscreen program running, if so you could experiment with the button assignments to find the correct one.
Click to expand...
Click to collapse
No one of that buttons corespond to CALENDAR or CONTACTS or CAMERA or RECORD button.
I can start the device without work program. Also I don't need to simulate tap, because I own my PDA and have knoweledge how to use it.
Users don't know much... for that i disables all. Only Work program in fullscreen mode without START MENU.
I read the specs and it has two "side scan keys", I bet they are your buttons waiting to be reassigned!
Click to expand...
Click to collapse
This is a PDA with barcode scanner. That 2 buttons named "side scan keys" are only for SCANNER and are not programable.
TO ALL: Thank you for your support![/quote]
cjb said:
I do not know if you can throw some cash at your problem but SKScHeMa from www.s-k-tools.com can wait for an application to start then execute a script. In the script you can simulate both tap and tap and hold actions.
Hope that helps.
Regards cjb.
Click to expand...
Click to collapse
Thanks for help.
I can't do any investitions in that.
More of that it's not the same I need. I need to simulate this not only at start, also during work.
Yes, so make the prgram asking if a connect is needed run when the power button is pressed. If the user needs to connect they press off then on then the window comes up asking if a simulated tap is needed (I do not mean reset). If the full off is not desireable then dose your unit change the brightness when the power button is held down? If so, and if it is using the standard name for the named event to signal brigtness changes then you could make the tap simulate program run all the time in a loop but waiting for the brigtness change event. Waiting will take up almost no processor time and the program is so small it takes up almost no memory! The user just has to hold the power button for several seconds and the your window will pop up. The down side is that your app will also have to save then restore the brigtness settings so the user dose not need to manualy reset the brigtness level.

Kiosk Mode Problem

Hi again,
the application which I'm programming shall run in kiosk mode. Currently, I have a quite simple realization by hiding the shell parts (Taskbar, Start-Icon and SIP button), and by resizing the main window to screen size.
That works quite fine, I've additionally deactivated all of the hardware buttons.
But: The application shall access the device's phone application. Every time the phone application is active, there appears the Start-Icon and other items of the standard WCE screen.
How could I avoid this problem?
I'm working on the ARTEMIS device, Windows Mobile 5.0 and I'm programming in native c++ (Visual Studio 2005)
thanks,
Günther
Quick question:
I assume you use SHFullScreen API to hide the taskbar and stuff.
At what point do you call it?
According to documentation and from my experience you need to call it after your window becomes foreground so doing it from WM_CREATE may be too soon. Try returning the HWND from Create window and using it to call the SHFullScreen isntead of WM_CREATE handler.
You can also, move/resize/hide navigation bar window and check it in loop.
Use a Remote Spy++ to determine windows classes.
@levenum: Yes, I'm using the SHFullScreen API. Currently, I'm calling it after pressing a button to toggle full screen mode. However, this doesn't prevent the application to show the taskbar after the internal Phone application has been used. Furthermore, after using the phone, my application automatically swiches back to reduced screen mode in any case.
@THEVK: Well, this also sounds reasonable - I could already acquire the handle of the taskbar and hide/disable the window. Now I still have to think about bringing the phone application or the contacts application to the background when they aren't needed anymore. But I think I could do that by simply adding some buttons to my main application and placing them at the location of the taskbar...
thanks and cheers,
Günther
Taskbar have a code, which bring it on top always, IMO.
I think, the best solution to hide taskbar window and place your custom window there.
disable kiosk
hi a customer brings a windows mobile phone which is in a kiosk mode and he don't know the password for it and i can not take it back again is there any way that i can disable kiosk mode??
It sounds more like the phone is locked by a password than that it is a actually in "kiosk mode".
In such case there is a high possibility the reason the customer does not have the password is because it is not his phone.
But if that is not the case (and I hope so) then you should give details about what kind of phone it is (exact make and model) and describe the kiosk application that is running.
Perhaps then someone will have the answer for you.

Kiosk mode & some questions

Hi,
my application on Windows Mobile 5.0 shall run in kiosk mode. Therefore, I've disabled the TaskBar and did some other stuff. Basically, it works great, but I'm still having a few problems:
1. When I hide the taskbar, also the "OK" Button which is needed by some dialogs gets hidden. Therefore, when the user e.g. wants to change communication/GPRS settings, there is no way to accept the changes or close the regarding dialogs. (I have to use these sort of things provided by the operating system - thus, the OS is not entirely hidden).
Is there any possibility to simulate the TaskBar's OK button within my own application? (E.g., by sending a certain Windows-Message indicating the OK-Button pressed?)
Or, alternatively, is it possible to just hide some parts of the TaskBar (e.g., the Start Button) and keep the OK button, clock, and GSM status visible??
2. Somestimes, there appears a system-notification window, e.g. notifying the user about establishing a GPRS connection, or regarding failures. Is it possible to intercept these dialogs and to hide them, or just to disable them such that the user can see it, but tapping the "Cancel" or "Settings" button won't cause any action?
I'm working with Visual Studio 2005/windows Mobile 5.0 SDK in visual c++ and I'm using the HTC ARTEMIS device
Kind regards,
Günther
1. You can send WM_COMMAND with wParam = IDOK.
It must work, because it's how app handle it!
Is there anything I have to consider when sending WM_COMMAND system-wide? A simple PostMessage(NULL, WM_COMMAND,...) seems not to work. Do you see any possibility to get a Windows handle to the active application that should receive the WM_COMMAND message?
Or do you have any idea how applications tell the TaskBar to show the OK or Cancel button? I think this happens via system-wide windows messages, doesn't it? But which messages, and how to intercept them???
Any help is still highly apprechiated (it seems that nobody else did ever have this problem, also in various fora I couldn't yet get an answer... )
I have the same problem with the ok buttom. My PDA have 1 buttom for the camera, so I use this buttom like an OK buttom, for now.
But I´m still trying to make the ok buttom be operacional on the blocked taskbar.

How to activate screensaver?

I use Chronos (a clock program) as my screensaver. I also use Spb PocketPlus for my home screen rather than the stock HTC home screen.
I'm trying to find the command in the software that invokes the screensaver so I can put a link to it on my home screen. I cannot find anything that works in the Windows folder (like scrnsaver in XP).
I also use TweakHD, but can't find anything in there.
Anybody know where this might be found? If I activate to the chronos.exe file, it brings up the full program with the settings indicator, etc. so that I can't dismiss it just by touching it. That's why I'm trying to find the command within the OS that invokes the screensaver.
Thanks.
LeeBv said:
I use Chronos (a clock program) as my screensaver. I also use Spb PocketPlus for my home screen rather than the stock HTC home screen.
I'm trying to find the command in the software that invokes the screensaver so I can put a link to it on my home screen. I cannot find anything that works in the Windows folder (like scrnsaver in XP).
I also use TweakHD, but can't find anything in there.
Anybody know where this might be found? If I activate to the chronos.exe file, it brings up the full program with the settings indicator, etc. so that I can't dismiss it just by touching it. That's why I'm trying to find the command within the OS that invokes the screensaver.
Thanks.
Click to expand...
Click to collapse
screensaving with pdas means switching off the screen. you will not have much fun with a device that is switched on all the time, because your battery will be drained in less than a day. so there´s no switch to use to activate a screensaver like at your computer at home

Categories

Resources