Search the Community
Showing results for tags 'z-order'.
Found 2 results
Hi All, I'd like to move a window to the top of the stack without it being active. I think it's called z-order in programming? I've tried these 2 options (commenting out 1 at a time obviously), but the 1st doesn't seem to do anything, and the 2nd prevents it from being moved behind the other programs even after clicking on it and then clicking on another window behind it: Local $hWnd = WinGetHandle("[CLASS:MSPaintApp]") _WinAPI_SetWindowPos($hWnd, $HWND_TOP, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOMOVE, $SWP_NOSIZE)) _WinAPI_SetWindowPos($hWnd, $HWND_TOPMOST, 0, 0, 0, 0, BitOR($SWP_FRAMECHANGED, $SWP_NOMOVE, $SWP_NOSIZE)) What can I do to move something to the top of the z-order while allowing it to be manually moved back in the z-order? Thanks!
jmon posted a topic in AutoIt General Help and SupportHello, How come in this example, when I click on label 2, I get the notification for Label 1? I have 2 controls overlapping, and I cannot disable them. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $GUI, $LABEL1, $LABEL2 $GUI = GUICreate("Test", 800, 600) $LABEL1 = GUICtrlCreateLabel("Label 1", 40, 40, 700, 520) GUICtrlSetBkColor(-1, 0xFF0000) $LABEL2 = GUICtrlCreateLabel("Label 2", 100, 100, 600, 400) GUICtrlSetBkColor(-1, 0x00FF00) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch Sleep(50) WEnd Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $hWndFrom Case GUICtrlGetHandle($LABEL1) MsgBox(0, "Click received", "Label 1 was clicked") Case GUICtrlGetHandle($LABEL2) MsgBox(0, "Click received", "Label 2 was clicked") EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Thanks in advance for your help.