Post Reply

Forums -> UltraMon™ SDK -> How to Determine the HWnd of a window on a particular Monitor
Matt   2006-01-22 00:31
Hi guys,
An application I am writing has to allow the user to fire up an application, and then send it to a particular monitor. This part is easy, I can select the Application running on monitor 1 and send it to Monitor 3 for example.

The next part is that I have to be able to bring back an application from Monitor 3, back to monitor 1 so that it can be worked on.

How can I determine the HWnd of a Window(s) on a particular monitor?

I tried to simply track it by using a variable to keep the Hwnd of the window I sent there originally, but it can change. An example is sending "Windows Picture and Fax Viewer" to Monitor 3. I know the HWnd when I sent it there - but if I double click a .jpg file on monitor 1, it updates the Windows Picture and Fax Viewer with the new picture on Monitor 3 - AND changes the HWnd. Now I can't retrieve that window. (basic example, but good enough for my point)

Thanks in advance guys,

Matt.
Christian Studer   2006-01-22 01:51
You could do this by searching for the window's title or class:

Set wnd = CreateObject("UltraMon.Window") If wnd.Find("*Windows Picture and Fax Viewer", "", FINDWND_TITLE, 0, 0) = True Then MsgBox "HWnd is = 0x" & Hex(wnd.HWnd) & " procId = " & wnd.ProcessId End If If wnd.Find("", "ShImgVw:CPreviewWnd", FINDWND_CLASS, 0, 0) = True Then MsgBox "HWnd is = 0x" & Hex(wnd.HWnd) & " procId = " & wnd.ProcessId End If

Christian Studer - www.realtimesoft.com
Forums -> UltraMon™ SDK -> How to Determine the HWnd of a window on a particular Monitor

Post Reply