Post Reply
Les Caudle 2002-01-10 10:12
I modified your demo code slightly so that it would move the notepad to the 3rd monitor and set the left position to the left edge of the monitor.
The code works as long as I comment out the wnd.left = mon.left
As I checked it in single step debug mode in VB6 to see if the values all checked out, I'm confused.
Private Sub Form_Load() Const SHOWSTATE_HIDDEN = 0 Const SHOWSTATE_MINIMIZED = 1 Const SHOWSTATE_NORMAL = 2 Const SHOWSTATE_MAXIMIZED = 3 Const SHOWSTATE_MAXIMIZED_DESKTOP = 4 Dim util, wnd, sys, mon Set util = CreateObject("UltraMon.Utility") If util.Run("%WINDIR%\notepad.exe") = True Then Set wnd = CreateObject("UltraMon.Window") If wnd.Find("", "", 0, util.ProcessID, 5000) = True Then Set sys = CreateObject("UltraMon.System") Set mon = sys.Monitors("3") wnd.Monitor = 3 'wnd.Left = mon.Left wnd.ShowState = SHOWSTATE_NORMAL wnd.ApplyChanges 0 End If End If End Sub
Thanks, Les Caudle
|
Christian Studer 2002-01-10 10:26
Window.ApplyChanges fails if you try to set both the monitor and position of the window (setting the monitor implies a change in position).
You should set either the Monitor property or position properties (Left, Top).
There are several other invalid combinations of setting changes, I'll document this in the next release of the SDK (you will always get the 'invalid procedure call or argument - code 800A0005' error).
Christian Studer - www.realtimesoft.com
|
Post Reply
|