AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Detect window fullscreenness

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Khaim
Guest





PostPosted: Thu Jul 12, 2007 7:32 pm    Post subject: Detect window fullscreenness Reply with quote

Is there a function to return this? I want to know if it's a fullscreen app or a normal app, and then turn off things like the Windows key if it's fullscreen. WinGetPos doesn't seem like it would work.
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Thu Jul 12, 2007 8:33 pm    Post subject: Reply with quote

WinGet, MinMax or Winget Style or Winget ExStyle should giev you enough information, or at least close enough?

you could also compare WinGetPos with A_ScreenWidth and A_ScreenHeight
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
Dewi Morgan



Joined: 03 Oct 2005
Posts: 186

PostPosted: Tue Jul 31, 2007 9:49 am    Post subject: Reply with quote

It's not immediately obvious to me which of the style settings could be guaranteed to be always set in a fullscreen window, and to never be set in, say, a merely maximized window. There doesn't seem to be a WS_FULLSCREEN or anything similar listed anywhere.

By "Fullscreen" I mean: no window trimmings. Hitting start button either does nothing, or minimizes the application. Applicaton has full control over the video card, so can make maximum use of directx/opengl acceleration.

By "Maximized" I mean: window trimmings (such as minimise button, etc) visible. Hitting Start button causes start menu to appear and overlay the maximized window.

Is there a guaranteed way to tell if an app is fullscreen?
_________________
Yet another hotkeyer.
Back to top
View user's profile Send private message
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Tue Jul 31, 2007 10:10 am    Post subject: Reply with quote

Maybe you can check if the window has not the WS_CAPTION style (eg no title bar)
Back to top
View user's profile Send private message
Dewi Morgan



Joined: 03 Oct 2005
Posts: 186

PostPosted: Tue Jul 31, 2007 3:22 pm    Post subject: Reply with quote

Install programs generally run maximized, with no trimmings, and on-top, but not "fullscreen" by the above definition.

Reason I ask is I want to be able to tell whether a program running would object to having a window grab focus.
Fullscreen games would object strongly, might crash, might kill the character.
Fullscreen youtube videos would minimise.

Maximised-but-windowed apps generally handle it better than fullscreen apps. For exaple, install programs don't usually mind a bit if you pop a window in front of them, because they are "proper windows".

Trouble is, I'm not sure if there's an OS-detectable state to say "the application with focus has taken control of the video and is not letting windows do its windowsy stuff."

Treating such applications well (and disabling noncritical popup windows in a script when such applications have focus) is a "tax" that all good scripts probably ought to pay.
_________________
Yet another hotkeyer.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Tue Jul 31, 2007 8:49 pm    Post subject: Reply with quote

some fullscreen apps change the resolution, you could maybe detect that the resolution has changed?

also, I remember (older) fullscreen games that still have a title bar, etc, but they were off the screen, so checking for the caption style may not be the right thing.

as far as taxes, I would see (without knowing anything about your app) if you can eliminate some of the notifications, or allow the user to disable them temporarily. For example, windows will tell me that my desktop has unused icons while I am watching a movie or something, and that's really annoying. If there was a way to globally tell all programs that I don't want to be bothered, then it would wait till later. I understand that this is pretty much what you are proposing, but it's also useful to pop up less things, or pop up without stealing focus.
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
Dewi Morgan



Joined: 03 Oct 2005
Posts: 186

PostPosted: Tue Jul 31, 2007 10:43 pm    Post subject: Reply with quote

Trouble is, screen resolution doesn't always change, and only acting politely sometimes isn't good enough for me.

One of the things I've noticed about fullscreen apps in Win2k and above is that they are always listed first in the alt-tab list. This suggests that Windows does know what makes a fullscreen app count as "fullscreen", but goodness knows how they do it.

For me, the main apps affected by this is my "when the mouse moved to the hot corner, pop up the Trillian contact list" script. Which is a pretty low-priority thing. I just disable the script when playing a fullscreen game that allows cursor movement.

However, I do want to know the answer anyway, since I like knowing how to pay my "taxes" properly. That, and because I hate kludging where I suspect there might be a more elegant and canonical answer :)
_________________
Yet another hotkeyer.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 8255
Location: Maywood, IL

PostPosted: Tue Jul 31, 2007 11:07 pm    Post subject: Reply with quote

the active window is always first in the alt-tab list
_________________

(Common Answers)
Back to top
View user's profile Send private message Visit poster's website
Dewi Morgan



Joined: 03 Oct 2005
Posts: 186

PostPosted: Thu Aug 02, 2007 1:55 pm    Post subject: Reply with quote

Nope. The alt-tab list is organised by Z-order.

So bring up, say, task manager, and a couple of explorer windows. Alt-tab all you want, tarkman will remain as the first item in the list.

So: fullscreen windows are always-on-top, are SysGet -> SM_CXFULLSCREEN x SM_CYFULLSCREEN rather than SysGet -> SM_CXMAXIMIZED x SM_CYMAXIMIZED, are on the primary screen, and are not minimised.

Even on a single-monitor system, it is not safe to assume they are the active application, as there may be virtual desktops, virtual monitors, remote monitors (Synergy), etc.

Trouble is, if you can have a window fullscreened on a monitor other than the main one (not sure if you can) then you might not spot some fullscreen apps. In that case, need a way to get the equivalent of AM_CX/YFULLSCREEN for monitors other than the default.
_________________
Yet another hotkeyer.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group