ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Removed Areas > AutoHotkey

Preventing fullscreen and getting back when that's failed

<< < (3/3)

oblivion:
Get the simplest case working first before adapting it.
-MilesAhead (July 28, 2011, 01:03 PM)
--- End quote ---

I did that; still failed. I asked over at the AHK forum; lots of people read my post, but nobody answered.

Eventually, I came to the comclusion that the reason it didn't work was because a fullscreen DOS app doesn't have the same attributes that are being tested for to detect a fullscreen Windows app, and racked my brains for a while to see if I could come up with an alternative approach.

I discovered that (under XP, anyway) Alt-Enter with the desktop as the foreground app brings up display properties. That led me to a plan...


--- ---#IfWinActive, MyCode
; MyCode should be replaced with the appropriate window title -- can be set in a batchfile with Title "<whatever>"
; semi-disable Alt+Enter
!Enter::
SetMouseDelay, 70
click 2000,2000 ; click somewhere far, far away from any open windows
; Alt-enter on desktop brings up XP display properties, in a fullscreen DOS app it pushes it back to a window
send !{Enter}
click 275,430 ; the Cancel button on the XP Display Properties dialog, regardless of tab
WinActivate, MyCode
return
So I don't actually test for the state, I do something that affects both states differently and deal with the outcome -- I click cancel, or I click in the window with the DOS app in it, which just selects it or some text in it depending on whether quickedit mode is on or not. Either way, I have a solution.

I felt quite clever.  :D Although I grant it's a lot less elegant than I'd like.

--tim

MilesAhead:
Sometimes it's just easier to send some keys or clicks. AutoIt3/AHK is handy then.

I've been waiting years for FreeCommander file manager to add a /Layout=n command line switch so I could open it to a combination of tabbed folders.

In the meantime I use an AutoIt3 app that launches it, waits for it to be active, then Sends Alt-1 to open the top Layout. Kludge but it works.

Navigation

[0] Message Index

[*] Previous page

Go to full version