Checking if a there is a Full Screen app running?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post by Rescator »

Mistrel wrote:
Rescator wrote:.. but if I do a fullscreen (like a movie player) it does not stay on top. Windows does this automatically.
If you set your application to on-top and it's higher in the z-order it will display on top of other on-top windows.
I have never had that happen, except in some rare cases like notification area balloontips or popupwindows from virus checkers etc. They tend to "steal" focus/flicker even during games. (I've had games crash due to this).

But I've never had any of my own PureBasic apps behave this way. Any idea how the Z order could end up causing that? Besides, doesn't window automatically give a higher z order to a frontmost + fullscreen anyway?
That is how the taskbar is obscured during fullscreen anyway.

I doubt the original poster is messing with Z orders in a unusual way? *poke*
User avatar
deseven
Enthusiast
Enthusiast
Posts: 367
Joined: Wed Jan 12, 2011 3:48 pm
Location: Serbia
Contact:

Re: Checking if a there is a Full Screen app running?

Post by deseven »

I wrote a simple procedure for this:

Code: Select all

Procedure.b isFullscreenActive()
  Protected fwnd.i,desktops.b,rc.RECT
  fwnd = GetForegroundWindow_()
  If fwnd <> GetDesktopWindow_() And fwnd <> GetShellWindow_()
    GetWindowRect_(fwnd,@rc)
    ExamineDesktops()
    If rc\left = 0 And rc\top = 0 And rc\right = DesktopWidth(0) And rc\bottom = DesktopHeight(0)
      ProcedureReturn #True
    EndIf
  EndIf
  ProcedureReturn #False
EndProcedure
Post Reply