Hi everyone. I was hoping you would be able to help me with a problem.
I bought a Toshiba Tablet PC a few weeks ago (loving it) and included with it are little programs made by Toshiba that help with things such as hardware specific features (ie. the Fn key which lets me change brightness or volume with a key combination, etc.). This was quite handy but there is a couple of problems. First, these little programs are only installed when I use my Toshiba OEM Windows XP Installation CD. And now that I've sworn off XP and moved to Vista, these programs are no longer available. And secondly, I don't know about you guys but I find the evasiveness and user experiences of these little applets annoying. They have their own notification icons which animate and being a fairly picky guy, I don't really like a lot of clutter in the notification area.
So! I decided to write my own little programs that would run in the background and perform these tasks for me instead of relying on Toshiba's software. There's one program that I miss quite a bit: when I change the physical screen orientation from 'notebook mode' to 'tablet mode' my screen does not rotate automatically to primary portrait like it used to. This is the program that I'm currently trying to write.
Now, my question. Is there a way to detect what the physical position of the screen is (whether its upright or clipped down in tablet mode) so that I can change the screen orientation appropriately I'm using C# Express Edition 2005 and .NET Framework 3.0.
lol Very sorry for the rambling; I thought the extra information might clarify my question.
Thanks!
Ryan

Physical Screen Orientation
Dan.Jurden
Just to clarify: the original question in this thread is about the physical orientation of the screen (i.e. whether the screen of your convertible TabletPC is in 'Laptop' or 'Tablet' position).
Most OEM system (when configured properly) adjust the (software) screen orientation automatically, when the physical orientation changes, so the EnumDisplaySettings (which reports the 'software' orientation) will report the correct orientation. However, if the OEM system does not make this adjustment, then there is no Windows API that you can call to figure out the physical orientation directly.
It is the same as if you turn your desktop monitor physically upside-down. Obviously there is no Windows API that could detect that kind of change in your physical environment.
Thanks!
malignate
Here is an article pertaining to screen rotation for tablet PCs. You might find it useful.
http://msdn2.microsoft.com/en-us/library/ms812142.aspx
Chopaka
There is no API in the Tablet (or in the Windows) SDK that would report the physical orientation of the screen of your Toshiba Tablet. This is an OEM specific implementation, and you will need a utility from Toshiba that detects the physical rotation of the screen and triggers the appropriate change of the display settings.
I am not sure if Toshiba has published the Vista RTM version of that utility yet. You should check Toshiba's web site for that.
Thanks, Stefan Wick
hanjg82
I tried the Tablet PC SDK as you suggested element109, but I can't see anything that is applicable.
This is turning out to be quite a puzzler.
Terry Smith
Thanks for your reply element109,
Your code is helpful for detecting the image's orientation on the screen. But I want to know if there is a way to detect what mode my Tablet is in (if the lid is rotated and down for tablet mode, or not rotated and upright for notebook mode) so that I can make the dimension swap that you talk about myself. This is because my Tablet PC no longer does this for me automatically, which is the reason I want to write the application in the first place.
Thank you for your suggestion though. All replies are very much appreciated.
Ryan
dasryms
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm);
The return value is nonzero (okay), but dm.dmDisplayOrientation always is zero, regardless of the rotation.
Since the system does not map the array keys according to the screen orientation (WHY ), I have to do that mapping myself, prior to reacting on e.g. VK_UP.
DoDi
Learning VB
Hi
better you can use
EnumDisplaySettings
api this will solve your problem and this api will assist you to get your present display settings.And for how to use this api search it on msdn2.microsoft.com.
bye
robdken
If you want to create a generic solution, just compare the Width and Height properties once you have the Bounds (System.Windows.Forms.Screens.PrimaryScreen.Bounds). If the Width is wider than the height, you are in landscape mode (normal).
Hope that helps, Joe
Justin1021
This property will give you your screen dimensions, I'm guessing the dimensions will be swapped when you switch modes.
System.Windows.Forms.Screen.PrimaryScreen.Bounds
This property will give you your screen working area, if my guess above is inaccurate.
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea
Marukocc
This does not return the physical orientation of your hardware. On a convertible TabletPC your hardware can be, for example, in laptop mode, but the screen can be set to portrait orientation. In this case the API would not tell you that your hardware is in laptop mode.
As indicated in my previous post, you need an OEM specific utility to automatically rotate the screen orientation when the physical orientation changes.
Thanks, Stefan Wick
MA2005
You can download the tablet pc sdk, there's probably a sample.
http://www.microsoft.com/downloads/details.aspx familyid=4b14b74a-27e4-42c4-862f-273f6302ea4f&displaylang=en