Post Reply

Forums -> UltraMon™ -> Detecting the monitor number where the active app resides?
Rene Canlas   2008-01-27 06:48
Hi!

I have my PC connected to a 20-inch IBM LCD monitor and to a 46-inch Samsung LCD TV. I have created a script to move VLC between the two displays. What I want to do is make VLC go full-screen when it's "sent" to the Samsung LCD TV, and have it go back to windowed state when I send it back to the IBM LCD monitor. I figure I need a way to detect which monitor is hosting VLC, so i know when to make it full screen or not.

Any help would be much appreciated!

Rene
Christian Studer   2008-01-27 09:11
You could do this with code like this:Set wnd = CreateObject("UltraMon.Window") If wnd.GetForegroundWindow() = True Then MsgBox "Foreground window is on monitor " & wnd.Monitor & "." End If

Christian Studer - www.realtimesoft.com
Rene Canlas   2008-01-27 12:40
Thanks, it worked like a charm. One more thing if you don't mind...

How do you detect if an application is running full-screen, windowed, or minimized?

Rene
Christian Studer   2008-01-28 09:20
You can check the window object's ShowState property.

Fullscreen mode may have SHOWSTATE_NORMAL though just like windowed mode, this depends on how the application implements fullscreen mode.

Christian Studer - www.realtimesoft.com
Rene Canlas   2008-06-02 06:24
Thanks again!

How would I access the window title of the foreground window? I need to determine if VLC is the current foreground window.
Christian Studer   2008-06-02 11:52
You can do this with the window object's Title property.

Christian Studer - www.realtimesoft.com
Forums -> UltraMon™ -> Detecting the monitor number where the active app resides?

Post Reply