|
Post by metro on Mar 31, 2018 6:25:24 GMT -5
nomainwin 'Center Window WindowWidth=400:WindowHeight=200 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
button #1.movewin, "Move Window API",[moveWindow],UL,10,10 button #1.movebtn, "Move Button LB",[moveButtonLB],UL,10,100 open "Moving Test" for window as #1 #1 "trapclose [quit]" wait
[quit] close #1:end
[moveWindow] 'this code shows how to move the window 'with the MoveWindow API function hWindow = hwnd(#1) 'handle of window calldll #user32, "MoveWindow",_ hWindow as ulong,_ 'handle of window 200 as long,_ 'x location of window 200 as long,_ 'y location of window 550 as long,_ 'width of window 350 as long,_ 'height of window 1 as long,_ 'repaint flag, 1=yes,0=no result as long 'nonzero = success wait
[moveButtonLB] 'this code shows how to move a control 'with the native LOCATE command #1.movebtn "!locate 200 100 120 50" #1 "refresh" wait
|
|
xtal
Junior Member
Posts: 61
|
Post by xtal on Apr 7, 2018 7:56:00 GMT -5
Interesting..... I added a couple of button, hope you don't mind....
button #1.movewin, "Move Window API",[moveWindow],UL,10,10
button #1.movebtn, "Move Button LB",[moveButtonLB],UL,10,100
button #1.quit, "Quit",[quit],UL,10,50
button #1.quit, "Restart",[Rst],UL,10,75
open "Moving Test" for window as #1
#1 "trapclose [quit]"
wait
[quit] close #1:end
[moveWindow]
'this code shows how to move the window
'with the MoveWindow API function
hWindow = hwnd(#1) 'handle of window
calldll #user32, "MoveWindow",_
hWindow as ulong,_ 'handle of window
200 as long,_ 'x location of window
200 as long,_ 'y location of window
550 as long,_ 'width of window
350 as long,_ 'height of window
1 as long,_ 'repaint flag, 1=yes,0=no
result as long 'nonzero = success
wait
[moveButtonLB]
'this code shows how to move a control
'with the native LOCATE command
#1.movebtn "!locate 200 100 120 50"
#1 "refresh"
wait
[Rst]
hWindow = hwnd(#1) 'handle of window
calldll #user32, "MoveWindow",_
hWindow as ulong,_ 'handle of window
UpperLeftX as long,_ 'x location of window
UpperLeftY as long,_ 'y location of window
550 as long,_ 'width of window
350 as long,_ 'height of window
1 as long,_ 'repaint flag, 1=yes,0=no
result as long 'nonzero = success
#1.movebtn "!locate 10 100 120 50"
#1 "refresh"
wait
|
|