jhonson 0 Posted June 14, 2019 Hello, i'm learning autoit and i have come up with a problem. I wanted to create a help window from a button click, everything works clean except for the button which flickers. The flickering stops when i remove "GUICtrlSetState($help, $GUI_ENABLE)" line from the script and also when the "help" or "ok" button is clicked the flickering stops. What am i doing wrong? #RequireAdmin #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $main = GUICreate("", 317, 317, 1030, 115, $WS_POPUPWINDOW ,$WS_EX_TOPMOST) GUICtrlCreateLabel("", 0, 0, 222, 30, -1, $GUI_WS_EX_PARENTDRAG) Global $helpwindow = 9999, $ok GUISetState(@SW_SHOW) HotKeySet ("{numpad9}", "MyExit") $help = GUICtrlCreateButton("", 227, 3, 24, 24) While 1 $msg = GUIGetMsg() Select Case $msg = $help GUICtrlSetState($help, $GUI_DISABLE) $helpwindow = GUICreate("", 317, 317, 1030, 115, $WS_POPUPWINDOW ,$WS_EX_TOPMOST) GUISetState(@SW_SHOW) $ok = GUICtrlCreateButton("OK", 161, 277, 150, 34) Case $msg = $ok GUIDelete($helpwindow) GUICtrlSetState($help, $GUI_ENABLE) ;flickering stops when this line is removed EndSelect WEnd Func MyExit() Exit EndFunc Share this post Link to post Share on other sites
Zedna 279 Posted June 14, 2019 (edited) #RequireAdmin #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $main = GUICreate("", 317, 317, 1030, 115, $WS_POPUPWINDOW ,$WS_EX_TOPMOST) $help = GUICtrlCreateButton("", 227, 3, 24, 24) GUICtrlCreateLabel("", 0, 0, 222, 30, -1, $GUI_WS_EX_PARENTDRAG) GUISetState(@SW_SHOW) $helpwindow = GUICreate("", 317, 317, 1030, 115, $WS_POPUPWINDOW ,$WS_EX_TOPMOST) $ok = GUICtrlCreateButton("OK", 161, 277, 150, 34) HotKeySet ("{numpad9}", "MyExit") While 1 $msg = GUIGetMsg() Select Case $msg = $help GUISetState(@SW_SHOW, $helpwindow) GUICtrlSetState($help, $GUI_DISABLE) Case $msg = $ok GUISetState(@SW_HIDE, $helpwindow) GUICtrlSetState($help, $GUI_ENABLE) EndSelect WEnd Func MyExit() Exit EndFunc Edited June 14, 2019 by Zedna 1 jhonson reacted to this Resources UDF ResourcesEx UDF AutoIt Forum Search Share this post Link to post Share on other sites
jhonson 0 Posted June 14, 2019 Thank you @Zedna, it was such a simple fix. Share this post Link to post Share on other sites
Nine 992 Posted June 14, 2019 You do not even need 2 GUIs. Just one would work like this : ;#RequireAdmin #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $main = GUICreate("", 317, 317, 1030, 115, $WS_POPUPWINDOW ,$WS_EX_TOPMOST) $help = GUICtrlCreateButton("", 227, 3, 24, 24) GUICtrlCreateLabel("", 0, 0, 222, 30, -1, $GUI_WS_EX_PARENTDRAG) $ok = GUICtrlCreateButton("OK", 161, 277, 150, 34) GUICtrlSetState (-1, $GUI_HIDE) GUISetState(@SW_SHOW) HotKeySet ("{numpad9}", "MyExit") While 1 Switch GUIGetMsg() Case $help GUICtrlSetState($ok, $GUI_SHOW) GUICtrlSetState($help, $GUI_HIDE) Case $ok GUICtrlSetState($ok, $GUI_HIDE) GUICtrlSetState($help, $GUI_SHOW) EndSwitch WEnd Func MyExit() Exit EndFunc Not much of a signature but working on it... Spoiler Block all input without UAC Save/Retrieve Images to/from Text Tool to search content in au3 files Date Range Picker Sudoku Game 2020 Overlapped Named Pipe IPC x64 Bitwise Operations Multi-keyboards HotKeySet Fast and simple WCD IPC GIF Animation (cached) Share this post Link to post Share on other sites