Search the Community
Showing results for tags '_winapi_setparent'.
-
Hello, I've stumbled upon an issue trying to change how one of my child windows behaves and looked through the forum for an answer however the closest I got to was this post: https://www.autoitscript.com/forum/topic/201385-solved-gui-design-layering-transparency-_winapi_setparent-with-guictrlcreatepic-doesnt-work/ So for the sake of simplicity I'll be borrowing the original code with a couple of changes. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> Local $hMainGUI = GUICreate("Main Background - Example 4", 500, 500, 0, 0, -1) GUISetBkColor(0x000000) GUISetState() Local $hGUIOverlay = GUICreate("Test 4", 500, 500, 0, 0, -1, $WS_EX_LAYERED) GUISetBkColor(0x0000F4) Local $idButton = GUICtrlCreateButton("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 50, 255, 40) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 100, 255, 40) _WinAPI_SetLayeredWindowAttributes($hGUIOverlay, 0x0000F4) GUISetState() _WinAPI_SetParent($hGUIOverlay, $hMainGUI) _WinAPI_MoveWindow($hGUIOverlay, 0, 0, 500, 500) ConsoleWrite(WinGetHandle($hMainGUI) & @CRLF) Local $Check While 1 $Msg = GUIGetMsg() Select Case $Msg = $idButton If $Check = True Then Local $hWndHandle = _WinAPI_SetParent($hGUIOverlay, $hMainGUI) ConsoleWrite($hWndHandle) ;~ $Pos = WinGetPos($hMainGUI) ;~ _WinAPI_MoveWindow($hGUIOverlay, 0, 0, 500, 500) $Check = False Else _WinAPI_SetParent($hGUIOverlay, 0) _WinAPI_MoveWindow($hGUIOverlay, 0, 0, 500, 500) $Check = True EndIf Case $Msg = $GUI_EVENT_CLOSE GUIDelete($hGUIOverlay) GUIDelete($hMainGUI) Exit EndSelect WEnd My problem is trying to attach the child window back to the main AFTER it was detached. Currently the way I'm overcoming this problem is by deleting and re-creating the child window with all its controls with the proper parent handle (example from my own script): ...BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW), $hMainGUI... To be honest, not sure if this is even possible.
-
I am sure this is something simple but I can’t get this to display without a white box at the top of the GUI. #include <GUIConstantsEx.au3> #include <IE.au3> #include <WinAPI.au3> $oIE = _IECreate("about:blank", 0, 0) $IE_window_child = _IEPropertyGet($oIE, "hwnd") $Form1 = GUICreate("Test", @DesktopWidth, @DesktopHeight, 0, 0) _WinAPI_SetParent($IE_window_child, $Form1) GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE