How to drag a window by pulling a gadget?
Posted: Sat May 11, 2024 8:20 am
How to drag a window by pulling a gadget?
it works in AutoIt3, here is the code
Code: Select all
; $GUI_WS_EX_PARENTDRAG = 1048576 = $100000 (AutoIt3) = WS_EX_NOINHERITLAYOUT ?
If OpenWindow(0, 0, 0, 270, 160, "Drag a window by pulling the gadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TextGadget(0, 10, 10, 250, 140, "Drag a window by pulling the gadget")
SetWindowLongPtr_(GadgetID(0),#GWL_EXSTYLE,GetWindowLongPtr_(GadgetID(0),#GWL_EXSTYLE) | $100000)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIfCode: Select all
#include <GUIConstantsEx.au3>
GUICreate('My Program', 250, 260)
GUICtrlCreateLabel('Drag a window by pulling the gadget', 5, 5, 150, 150, -1, $GUI_WS_EX_PARENTDRAG)
GUISetState()
While 1
If GUIGetMsg() = -3 Then Exit
WEnd