Stuart 2007-03-26 11:26
I know this has been over many times before but I'm struggling. I need to move an Internet Explorer window to another monitor. I have the process ID for the app and I just need to place it on monitor x.
Thanks
|
Christian Studer 2007-03-27 09:07
You could do this with the following code:Dim wnd As New UltraMonWindow
If wnd.GetAppMainWindow(processId, 5000) = True Then
wnd.Monitor = 2
wnd.ApplyChanges 0
End If
Christian Studer - www.realtimesoft.com
|
Stuart 2007-03-27 13:43
Thank you so much. I had spent so long trying to work out how to do this. It works perfectly.
|
Stuart 2007-04-21 10:23
Hi,
I all of a sudden have a problem with this code. The Sub below has not been changed since it was created. It now gives the error, "Method 'Monitor' of 'IUltraMonWindow' failed" on the line "wnd.MONITOR = MONITOR + 1"
Private Sub DisplayCard(MONITOR As String)
Dim strCmd As String
Dim wnd As New UltraMonWindow
strCmd = "C:\Program Files\Internet Explorer\iexplore -k " & App.Path & "\" & MONITOR & ".html"
dblIEID(MONITOR) = Shell(strCmd, vbMaximizedFocus)
If wnd.GetAppMainWindow(dblIEID(MONITOR), 5000) = True Then
wnd.MONITOR = MONITOR + 1
wnd.ApplyChanges 0
End If
End Sub
I still have Ultramon in the available references. The iexplore app opens etc. Any help appreciated.
Stuart
|
Stuart 2007-04-21 11:01
Just tried removing and reinstalling ultramon. Ran regsvr32 ultramon.dll Still no better.
|
Christian Studer 2007-04-22 09:00
Shouldn't be related to the component registration, otherwise creating the window object should fail as well.
My guess would be that you need to cast MONITOR to Long, the Monitor property is of type Long:
wnd.Monitor = CLng(MONITOR) + 1
Christian Studer - www.realtimesoft.com
|