Sver
Full Member
Posts: 145
|
Post by Sver on Nov 25, 2023 5:24:00 GMT -5
' move resize window (textbox too)
nomainwin button #main.b, "Move Me",[moveMe],UL,10,10,100,30 button #main.move, "Move Window",[moveWindow],UL,120,10,100,30 open "Move a Button" for window as #main #main "trapclose [quit]" wait
[quit] close #main:end
[moveMe]
#main.b "I've been moved!"
hButton = HWND(#main.b)
calldll #user32, "MoveWindow",_ hButton as ulong, _ 'control handle 50 as long,_ 'x location of control 150 as long,_ 'y location of control 200 as long,_ 'desired width of control 50 as long,_ 'desired height of control 1 as long,_ 'repaint flag,0=false,1=true ret as long 'nonzero=success wait
[moveWindow]
hMain = HWND(#main)
calldll #user32, "MoveWindow",_ hMain as ulong, _ 'window handle 10 as long,_ 'x location of window 20 as long,_ 'y location of window 730 as long,_ 'desired width of window 590 as long,_ 'desired height of window 1 as long,_ 'repaint flag,0=false,1=true ret as long 'nonzero=success
'we'll only move window once, then disable button
#main.move "!disable"
wait
|
|