 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Khaim Guest
|
Posted: Thu Jul 12, 2007 7:32 pm Post subject: Detect window fullscreenness |
|
|
| 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
|
Posted: Thu Jul 12, 2007 8:33 pm Post subject: |
|
|
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 |
|
 |
Dewi Morgan
Joined: 03 Oct 2005 Posts: 186
|
Posted: Tue Jul 31, 2007 9:49 am Post subject: |
|
|
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 |
|
 |
Andreone
Joined: 20 Jul 2007 Posts: 257 Location: Paris, France
|
Posted: Tue Jul 31, 2007 10:10 am Post subject: |
|
|
| Maybe you can check if the window has not the WS_CAPTION style (eg no title bar) |
|
| Back to top |
|
 |
Dewi Morgan
Joined: 03 Oct 2005 Posts: 186
|
Posted: Tue Jul 31, 2007 3:22 pm Post subject: |
|
|
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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Tue Jul 31, 2007 8:49 pm Post subject: |
|
|
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 |
|
 |
Dewi Morgan
Joined: 03 Oct 2005 Posts: 186
|
Posted: Tue Jul 31, 2007 10:43 pm Post subject: |
|
|
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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Tue Jul 31, 2007 11:07 pm Post subject: |
|
|
the active window is always first in the alt-tab list _________________
(Common Answers) |
|
| Back to top |
|
 |
Dewi Morgan
Joined: 03 Oct 2005 Posts: 186
|
Posted: Thu Aug 02, 2007 1:55 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|