disallow screen rotation - Windows Mobile Development and Hacking General

Hello!
I need to write software that disallows any screen rotation on my Wizard.
How can I do it? I didn’t found any registry settings for this. The best way
that I see is hooking ChangeDisplaySettingsEx. But unfortunately, SetWindowsHookEx
doesn’t works on WM 5.0, at least it said on some topics. Please, give me any solution for this problem or example code to hook some API function.

wm5: [HKLM\System\GDI\Rotation]
Angle=dword:0
00000000 portrait
0000005a righthanded landscape
0000010e lefthanded landscape
then RegistryNotifyCallback will do

tanks a lot
I will try this way.
But I afraid it will be notified after screen rotation starting.
Adjusting this registry value in regedit tool did't help.
So I suppose this value is changing after rotation is done.

You can delete the start up service of ScreanRotate.
Go to HKLM/Services/ScreanRotate and delete it.
I think before you doing this,you can export it to a reg file

It's not bad idea.
but delete this key leading to system restart for apply
I just try to stop this service.

Not luck : (
This key not present in the registry storage.
I am under WM 5.0
Maybe you talk about some early system.

Hi hoblano, I'm experiencing the same problem, did you find a solution ?
thanks,
Scalposcarno

use task manager 2.7 and stop service...if you know it is service...
same way to stop kbd lights...btw,

I tried, but the result is the same as the one obtained by manually deleting the Screen Rotate voice within the services voices in the registry: avoiding the load of the service providing the icon on the task bar enabling the user to rotate the sceen one or more times by tapping on it.
I still don't understand ... at this point the most probable thing is that the service that rotate the OS screen when rotating by hand the HW screen, is invisible with respect to registry voices and to applications like Task Manager 2.7 or MemMaid. Apart from criticizing the constructor choice (why didn't they thought that someone should have been more comfortable using only one view mode ? e.g. landscape one), is there a way to obtain a list of core services and to avoid one of those to be loaded ? or, otherway, is there a way to intercept the event thrown when manually rotating the screen of the terminal ?
By the way, I'll have to do it with Java ...
thanks all

Related

Any way of preventing screen rotate to portrait ?

Just wondering if there is a registry hack that stops the screen from automatically rotating and displaying in portrait mode when you flip the screen round ?
i.e. it should stay in landscape mode no matter if the screen is facing in/out or otherwise.
You can do it manually by clicking on the screen rotate icon, or going into Settings > Screen > Orientation, so I figure there must be a reghack to put it permanently into Landscape ?
tia
Ok, i've found the key at least which shows what mode is currently in use:
This is Landscape (Right-handed) mode:
HKEY_LOCAL_MACHINE\System\GDI\Rotation
Angle 0x5A (90)
HideOrientationUI 0x0 (0)
LanscapeMode 0x1 (1)
The question is, how do I stop those being overwritten or change it so when it's in Portrait mode, it actually uses those settings ?
gaspx: I'm an odd fellow. I'd written you a long post about basically:
rotation is achieved at OS level, and driver level, so althought it's possible to be notified of the screen being rotated, intercepting it would require, AFAIK, some fairly substantial low level code or a reg key I'm not aware of.
But then I remembered my work on the Universal Voice Command/External Key issue in another thread. I've written a test program called VJElectrify, which contains a hack called ClamHack. And I just tried clamhack, and amongst its other side effects, yes, it does allow you to prevent the system forcing a rotation. So system stays in landscape if you open in laptop mode, or rotait into portrait mode. You then manually choose your rotations.
VJElectrify isn't finished yet, still a lot more research to do, but yes, it is possible to prevent it Keep an eye out for when VJElectrify is released.
Anyone else know another way to do this? I can't think of any relevant reg settings.
V
Heh heh, I knew it probably wouldn't be as simple as a reg hack.. cheers for the reply Vijay, i'll keep a watch on your website for the forthcoming VJElectrify..
gaspx said:
Ok, i've found the key at least which shows what mode is currently in use:
This is Landscape (Right-handed) mode:
HKEY_LOCAL_MACHINE\System\GDI\Rotation
Angle 0x5A (90)
HideOrientationUI 0x0 (0)
LanscapeMode 0x1 (1)
Click to expand...
Click to collapse
Thats just the keys where the current state is stored.
the key you need is HKLM\Services\ScreenRotate (you can change the ShowIcon value here to enable/disable the today icon)
Ive tried just renaming the ScreenRotate but that failed then i tried changing the dll name stored in the key, after all if it cant find the dll surlly it'll stop the rotations.
NOPE, i know the dll rename is working as the icon failed to appear, but the auto rotates continue to happen, it must be OS, it must be!!
.....the search continues
Ive tried just renaming the ScreenRotate but that failed then i tried changing the dll name stored in the key, after all if it cant find the dll surlly it'll stop the rotations.
Click to expand...
Click to collapse
I did that as well.. sorry, should've mentioned it in my original post, but I had the same idea as you! - the screenrotate.dll just seems to be tied to the icon in the systray. sigh.
Have to wait patiently for the VJClamhack to be released..
The clam hack has, by design, side effects - it disables part of the system OS, which conveniently disables screen rotation detection and some other stuff on the hinge. However, the bugger refuses to enable hardware keys with lid closed.
Because clamhack is quite a big sledgehammer for a nut, I'm a little worried about putting it out - however, I've never seen any negative sideeffects, only positive
V
Load DinarSoft MemMaid on your Universal.
Just as you can delete Startup Items, you can also delete Start Up Services. I believe I saw a service related to screen rotation in there.
I don't have my Universal for another week (getting replaced), but I do recall seeing that in there.
As always, perform a backup in case you can't "add" it back in.
I don't think that Rotation service helps, I tried it a bit earlier, since it seems to be an obvious target.
V
However, the bugger refuses to enable hardware keys with lid closed.
Click to expand...
Click to collapse
Thats OK, i don't need to use hardware keys when it's closed -- I figure this is part of a bigger problem you're looking at..
ust as you can delete Startup Items, you can also delete Start Up Services. I believe I saw a service related to screen rotation in there.
Click to expand...
Click to collapse
Yeah, I think that was the one Carnivor and myself had found.. we just prevented the service starting manually by bodging the registry key, but all it does is stop the little screen rotate icon from appearing.. thanks though
Has anyone figured this out yet?
Thanks

Totally prevent soft keyboard SIP in landscape mode?

a042349 at HowardForums wrote this post:
OK,
I hate that pop-up KB as well. I tried all the reg hacks and nullkb's I could find and on both my HP6515 and now on my 8125 it would always revert to the software screen KB and pop up at the most annoying times.
Well in doing some poking around I discovered a reg key that COMPLETELY elimnates the soft KB from popping up - great news. The bad news (there's always bad news) is that it completely prevents ANY of the SIP panels from coming up when you want them to, or from working in general.
So if you do this hack you are completely dependent on the 8125/9100 hardware keyboard. Now I've been running like this for over a year on two different devices and it works for me. The one thing I did was extract the "cut, copy and paste" icons out of an old "PHM Keys" I had and put them on the Start Menu so that I can now use those instead of the Ctrl-C, Ctrl-X, Ctrl-P when I need to. Works fine, but takes up three slots on my Start Menu.
You could also create a backup reg file, and one with the setting I'll give you, and then import them and reboot to turn the hack on or off. It does require a reboot so it's not an ideal solution, and I know the key by heart so i do it manually if I ever need it - which I never have:
HKEY_CURRENT_USER\ControlPanel\Sip\AllowChange=1
Change that entry from a 1 to a 0 and reboot. No more KB, Block Recognizer, Transcriber - nothing but the HW keyboard.
Try it you'll like it!
Click to expand...
Click to collapse
From what I know (I didn't try it yet), it totally prevents the SIP from appearing, and that would probably include portrait mode when the hardware keyboard is not available. A soft-reset may be required between changes, too.
Is there a way someone can make a program to prevent the SIP from appearing in landscape mode at all, yet make it available in portrait mode?
I use my device in both modes, so I wouldn't want to lose complete functionality of the SIP.
Any ideas?
Hi everybody!
I may have an alternative to killing SIPs altogether:
All SIP DLLs are registered under HKEY_CLASSES_ROOT\CLSID, each with its unique identifier. The name of the SIP (which you see in the menu is stored in the default value) SIP key has two sub keys: InProcServer which tells the system where to find the DLL and IsSIPInputMethod with it's default value set to one.
One idea is to create a fake SIP key that will point to a non existent DLL and then select that SIP in the menu. The system will try to call up the SIP but it will fail until you select a valid one.
Hope this will help
Hardware Keyboard only in Landscape
On the Universal the combination of PQZ (to assign different SIPs to landscape and portrait, should work on other devices too) and PHMs "NoDoSIP" (registers a SIP that does nothing) works perfectly. Disable all SIPs not needed at all by setting the Reg Value (search for the SIP by name in the registry) Default under IsSIPInputMethod for that method to 0. You can rename your remaining SIPs there as well.
I'm skeptical, but willing to try...
As the originator of the quoted post in this thread I'm skeptical but certainly open minded that this solution would work.
And yes my method does require a reboot to enable/disable, so it's certainly not for the occasional use of the SIP.
In the past I had tried all manner of null kb's, and UID registry string swaps and other things to prevent unwanted SIP pop-ups.
What I would like is to have it ONLY come up when I invoke it - and NEVER on it's own. I wouldn't use it much (and haven't on two HW keyboard devices over the past year) but sure it would be handy for the odd time I need to type in portrait mode.
I may give this a shot after dinner tonight and see how it goes - at the very least I can always go back to my admittedly draconian total elimination of the SIP's that I have now.
I'll post my results later tonight.
-Joel (a042349)
And??
Works like a charm, right?
In landscape it just displays the hardware keyboard icon and the arrow to even allow to manually invoke any other SIP "on the fly".
And in portrait the selected SIP gets activated automatically.
Works flawlessly for me (on my Universal) since month.
Right man, works like a charm! Thanks for this hint!
GREAT
Its the little things that make my tilt a better device to use. I tried phmppcpt.rpr_arm_siponly.cab on my tilt with dutty's pre April 29th cab and it works to eliminate the landscape keyboard in messaging, notes and contacts, however I have a beta version of opera mobile 9.5 and it seems to have mind of its own, doing the exact oposite and making both keyboards nearly unusable. Anyone else experience this?, hopefully Opera will provide users with a choice of hardware keyboard only and not having the SIP popping up. I presume that Opera had a feature to do exactly what .cab does just for that application and now the .cab is reversing it. Seems to do about the same thing in Internet Explorer.
im using opera 9.5 too.. and nothing seems any different after installing the cab... SIP still pops up.. any idea how i could solve it?
Thanks.
the ironic part is that ez imput kb does an automatic switch between keaboards when flipped from portrait to landscape, is there a script or a reg hack edit that does this??? cuz we can use that engine to make the sip automatically change to null kb when switched to landscape, fully eliminating pop ups and soft keyboards when using your querty
no2chem nueslidingkb
i use no2chem's nueslidingkb on my mogul. it allows you to set different SIPs on protrait and landscape as well as customizing the sliding sounds. it works very well, i have intellipad on portrait and nullKB on landpscape.
It however does not work on my Fuze, it doesn't change the SIP to the set one when switched to landscape, maybe needs an update? i hope no2chem checks it out.

auto rotate not working in apps and startmenu?

has anyone experienced this...?
autorotation works in some apps like: music and phototab, messaging, opera....
but like the start menu NOT! and also apps like Resco file explorer...
is this possible? to make rotation work in all apps???
Apps rotation
Good point
It should be.
There is a white list that lists which apps auto rotate.
Never used it, but I might need to for this one.
kurniawan77 said:
has anyone experienced this...?
rotation works in some apps like: music and phototab, messaging, opera....
but like the start menu NOT! and also apps like Resco file explorer...
is this possible? to make rotation work in all apps???
Click to expand...
Click to collapse
You might want to look at Gyrator.
You "just" have to add application entries in the registry. Their was a tool that do it for olders phones (Diamond2, etc.). G-Config was its name. The problem is the app using the "stylet entered" event.... That, obviously, cannot be used by our HD2... Maybe the author may change things to work with HD2
alright... i thought i have read it somewhere about the whitelist... but i just can't find it.
One of u knows the .exe for startmenu? to start with...
The sensor whitelist exists on registry keys HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\WhiteList for Window classes or HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\ModuleName for program names.
For instance, sensor can be enabled in the Start Menu (default/honeycomb one) and S2U2 with the following:
Code:
[HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\WhiteList]
"Start"="MSSTARTMENU"
"S2U2"="S2U2"
[HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\ModuleName]
"S2U2"="\Program Files\S2U2\s2u2.exe"
Hopefully, Gyrator will work without stylus one day.
Hopefully, Gyrator will work without stylus one day.
Click to expand...
Click to collapse
Gyrator works on HD2 as long as you know the Windows Class Names of apps. Some are given on the website of Gyrator.
Yunabeco said:
Hopefully, Gyrator will work without stylus one day.
Click to expand...
Click to collapse
bartveld said:
Gyrator works on HD2 as long as you know the Windows Class Names of apps. Some are given on the website of Gyrator.
Click to expand...
Click to collapse
He was referring to the fact that you used to be able to "teach" Gyrator a new class/window name by running the app in question and removing the stylus. This prompted Gyrator to get said info from the topmost application. Was a very nice feature. I don't know if there's any spy type applications for windows mobile, but you need one if you don't know this info.
Yes, that particular function was what I was referring to. As for finding out window class names, I'm using Dotfred's Task Manager, which has a tab showing window class names, although it involves looking in a long list instead of just pressing a button while in the window.
EDIT: Correcting my mistake quickly: Tap-holding a process name, tapping Details and choosing the Windows tab shows the windows opened by that particular process. Why I didn't find that out before is beyond me.
alright... tried a few things but no go
[HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\WhiteList]
Name: Start
String: MSSTARTMENU (Didn't find MSSTARTMENU in HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\Rai either.....
and tried
[HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\ModuleName]
Name: RescoExplorer
String: \Program Files\Resco Explorer\Explorer.exe
[HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\WhiteList]
Name: RescoExplorer
String: RescoExplorer
But still no go!!
I don't know if this is me just being stupid or just the program.
I have the navipanel activated on my HD2 and can access copilot etc in landscape.
however when I select the dial feature the phone app comes up but it is still in portrait mode.
I installed Gyrator and the phone app does now rotate whenever I turn the phone to landscape or portrait.
But when I call the phone app up while the phone is in landscape it still opens it in portrait.
What I would like to know is is there any way of calling the phone app up and for it to immediately appear in landscape format?
Would using the rotatescreen.exe file be more useful for me?
I hope that makes sense and appreciate any advice you may have.
Paul.
Yunabeco said:
The sensor whitelist exists on registry keys HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\WhiteList for Window classes or HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\ModuleName for program names.
For instance, sensor can be enabled in the Start Menu (default/honeycomb one) and S2U2 with the following:
Code:
[HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\WhiteList]
"Start"="MSSTARTMENU"
"S2U2"="S2U2"
[HKEY_CURRENT_USER\Software\HTC\HTCSENSOR\GSensor\ModuleName]
"S2U2"="\Program Files\S2U2\s2u2.exe"
Hopefully, Gyrator will work without stylus one day.
Click to expand...
Click to collapse
excellent! Thanks that works. Btw, what would be teh modulename and whitelist name for the messaging (SMS/MMS)? I'm assuming for the modulename is TMAIL? What about for whitelist name? THanks again
Works for me too!
Shame there is no nice rotating animation like in photo veiwer but at least it works!
Cheers!
I'm using Zensor2 for auto rotating. Works well for me.
this app is amazing, thanks for the tip!!!
only thing I'm still wondering is how to disable the auto-rotation for the WM6.5 lock screen. I've been googling to find out the window class name but have been unable to find it, and I cant run dotfred task manager once the device is locked- anybody else that might know how to prevent the lock screen from rotating??
thanks a lot in advance!
I upgraded to the HD2 this week from a Tytn 2 and use my phone in my car usually for the sat nav and have the phone set sideways in the holder to give me widescreen.
However, whenever I needed to use the phone on the HD2 the dialer screen would always appear in portrait and so I have had to learn to dial with my head tilted to the side!!!
After posting about my problems with getting the phone app to rotate I did a bit of detective work and think I have fixedd it.
I added the following registry key to whitelist in the GSensor bit of the registry.
Name Data
Phone \Windows\cprog.exe
After a restart voila, the phone dialer will now open up in landscape.
I hope this is helpful to others who want to use the phone in landscape.
Paul
How well does zensor2 work here, and does it autostart with the phone? It is possible to set up exceptions in zensor2?
hi, nice to see that im not the only one expirience problems with it. i switch back to use 'changescreen' app to turn the screen. i used it bevore on athena and it has some real nice options.
its working well on hd2 so i keep it.
regards mad
firstandlast said:
I upgraded to the HD2 this week from a Tytn 2 and use my phone in my car usually for the sat nav and have the phone set sideways in the holder to give me widescreen.
However, whenever I needed to use the phone on the HD2 the dialer screen would always appear in portrait and so I have had to learn to dial with my head tilted to the side!!!
After posting about my problems with getting the phone app to rotate I did a bit of detective work and think I have fixedd it.
I added the following registry key to whitelist in the GSensor bit of the registry.
Name Data
Phone /Windows/cprog.exe
After a restart voila, the phone dialer will now open up in landscape.
I hope this is helpful to others who want to use the phone in landscape.
Paul
Click to expand...
Click to collapse
Thanks! It's helped me!!
firstandlast said:
I upgraded to the HD2 this week from a Tytn 2 and use my phone in my car usually for the sat nav and have the phone set sideways in the holder to give me widescreen.
However, whenever I needed to use the phone on the HD2 the dialer screen would always appear in portrait and so I have had to learn to dial with my head tilted to the side!!!
After posting about my problems with getting the phone app to rotate I did a bit of detective work and think I have fixedd it.
I added the following registry key to whitelist in the GSensor bit of the registry.
Name Data
Phone \Windows\cprog.exe
After a restart voila, the phone dialer will now open up in landscape.
I hope this is helpful to others who want to use the phone in landscape.
Paul
Click to expand...
Click to collapse
I have done this, and it works great... except for when opening the phone app whilst in the Navi Panel.
When the Navi Panel is in Portrait, and you access the phone, it starts in Portrait, but allows you to rotate to landscape. However, when you use Navi Panel in landscape, and access the phone, the phone screen opens in Portrait and does not rotate! I'm sure there is a logical reason, but i'm afraid i'm not that clever...

two little apps: automatic rotation & wifi/display stay active - update 28/12

Hello
The Mega is my first smartphone, and thanks to xda I found lots of usefull info and apps to customize it just like i want
I think now it's time to share some apps I did mostly for my own use, but maybe usefull for some other people.
Well, here are two simple applications:
RotateMon
- The first, "rotatemon" (stupid name I know... ) is designed to run invisible in background and simply rotate the screen to landscape if one the following apps are launched: sms /mms ; opera mobile 10 and notes (notes.exe)
When you exit the app, the screen is restored to previous orientation. (meaning if you already are in landscape, you will stay in landscape)
I did this app because i couldn't found something doing this the way i want. I know there are mortscript scripts to do this, but not exactly like this. (and there's a problem with tmail.exe with this method, because mortscripts checks if a windows exist, but sometimes tmail.exe runs in background with the same window title "SMS / MMS" as the active window, so we must check if it is really active or in background...)
I know it's possible too to assign a long key press to the action "rotate sceeen", but I was tired of long pressing this key everytime i launched opera or the sms program...
Well just try it if you want, and let me know what you think about it, it's very usefull for me, maybe for you too
You can launch it at startup like I did (for example with sktools or something equivalent).
Please understand that I did it for myself, so it's "customized" for me (the apps that are monitored to trigger the rotation). If it is usefull for someone else I'll be happy to provide a more "user friendly" version (with the ability to configure what apps are monitored for example). Don't hesitate to ask
StayAlive -update 28/12/2010: now with a nice interface, install cab, more user friendly -
Another very simple program, designed to keep wifi "alive" even when the device is in sleep mode. It's a simple switch: ON/OFF, based on the registry key Comm\BCMSDDHD1\Parms\HTCKeepWifiOnWhenUnattended , you can switch the "StayAlive state" when wifi is on or off, doesn't matter, and the state is keep after a soft reset.
This tool can the display alive too, it provides a simple switch On/OFF to keep the display alive (doesn't prevent locking, well sometimes it locks and sometimes not, don't really know why..., but the screen stay on). Please note that the screen will not stay on at full backlight level, it will stay on at the "lower" backlight level (to prevent too much power drain...)
Ps:Sorry for my poor english
how to remove this software from phone?
rotatemon
Mobtel063 said:
how to remove this software from phone?
rotatemon
Click to expand...
Click to collapse
You just have to delete the program folder. If it's running, kill it with a taskmanager before of course (or soft reset). If you put it in your startup, remove it before, then kill the process or soft reset, then delete the folder.
No modifications are made to the system
ROTATEMON
seb3773 said:
RotateMon
Please understand that I did it for myself, so it's "customized" for me (the apps that are monitored to trigger the rotation). If it is usefull for someone else I'll be happy to provide a more "user friendly" version (with the ability to configure what apps are monitored for example). Don't hesitate to ask
Click to expand...
Click to collapse
Hi seb3773 I like you rotatemon very much. It is what I need, but since I have used Swype I had to turn it off. When the screen rotate my swype keyboard don't rescale well and the screen is cut out on te right side.
I would be grateful if you could disable sms rotation in your program?
or maybe some "user friendly" version above-mentioned?
I'm proud if it is usefull for you too A more user friendly version is coming soon, as i'm actually unemployed , i've plenty of time to do it. I intend to program a configuration interface with some nice features. It will be ready in 1/2 days
Great work
good works, man.
I wonder whether you can add-in one more switch not to connect 3G or smthng.
I'm having problem with that. When i accidentally press on browser icon, it start connecting to 3G network and i got to pay data charges.
It would be good if we can turn off. Thanks

Screen rotation for SQ 320x320

I did a great many searches and have tried every screen rotate program I could find but none of them work on my Saga. Even enabling the orientation settings in the registry via Adv Config did nothing. So am I right in assuming this feature is disabled on square screens? I ask because a some software change the orientation to landscape which is just annoying on a qwertybar phone. Is there any solution to this? Maybe a small launching app that traps a programs call to flip the screen, or would that throw of stylus coordinates? If I knew what to look for I wouldn't even mind Hex editing the few particular apps that do this (not many work on my phone period) and just nop-ing the call in the exe. My experience with winmo coding is virtually non-existant though so I'm not sure what to look for. Guess I can hook it to a debugger in the emulator and just start poking around but I'd prefer a simpler solution if anyone knows one.

Categories

Resources