I've scoured the net for answers but nothing is particularily relevant and I'm yet to find a solution to my problem.

I'm developing a windows app to be used on toughbook laptops. They use a program called Display Rotation Tool (IDRot.exe) to rotate the screen (shortcut alt+x). My form needs to be in landscape for some aspects and portrait for others. I'm trying to replicate doing alt+x with a button press but am getting nowhere fast. I've tried using SendKeys and PostMessage but the issue comes with the MainWindowHandle. In effect, IDRot is just a process that runs in the background and sits in the system tray so MainWindowHandle returns as 0 with a blank title. There is no active window for me to switch to to send the keys/message.

Anybody got any advice on other avenues to investigate?

(By just pressing alt+x manually the screen can be rotated with any window active but not within my windows app)