supersonic Posted January 21, 2014 Share Posted January 21, 2014 (edited) Hi, I noticed a strange behavior if a Windows Explorer window overlaps my GUI. The controls used in the reproducer provided below disappear partly. The controls become visible again by clicking the tabs (Tab 1 -> Tab 2 -> Tab 1). If the tab control is disabled this behavior doesn’t happen. Also strange is that only Windows Explorer windows cause this behavior - at least on my computer (W7-32, AutoIt V3.3.8.1 and V3.3.11.3). Other windows (e. g. Notepad, Word, Excel, etc.) seem to work fine. Can anyone reproduce this? How can this be solved? Greets, -supersonic. Code: #include <GUIConstantsEx.au3> Global $hGUI1 = GUICreate("TEST", 300, 300, @DesktopWidth - 350, 50) Global $hGUI1_T = GUICtrlCreateTab(1, 1, 298, 298) Global $hGUI1_T0 = GUICtrlCreateTabItem("Tab 1") Global $hGUI1_LV0 = GUICtrlCreateListView("Column 1|Column 2|Column 3", 10, 30, 280, 140) Global $hGUI1_I0 = GUICtrlCreateInput("Input 1", 10, 180, 280, 21) Global $hGUI1_I1 = GUICtrlCreateInput("Input 2", 10, 210, 280, 21) Global $hGUI1_I2 = GUICtrlCreateInput("Input 3", 10, 240, 280, 21) GUICtrlCreateTabItem("") Global $hGUI1_T1 = GUICtrlCreateTabItem("Tab 2") GUICtrlCreateTabItem("") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Edited January 21, 2014 by supersonic Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 21, 2014 Moderators Share Posted January 21, 2014 supersonic,I get some interference with other GUIs as well as Explorer windows - something similar was mentioned recently. I assume it is something to do with the tab redrawing as it only seems to affect controls within a tab structure, but I have no idea how to prevent it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
supersonic Posted January 21, 2014 Author Share Posted January 21, 2014 M23, this is really bad news! I tried to solve this with AdlibRegister, WM_* and some control redraw stuff - without any usable results (= flickering)... Link to comment Share on other sites More sharing options...
supersonic Posted January 22, 2014 Author Share Posted January 22, 2014 (edited) Hi, in my case I figured out the following "workaround". It is up to 90+ % reliable and unfortunately it takes some time (~ 500 ms) the (partly) missing controls to become visible again - more than I expected... Code: expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <WinAPIEx.au3> #include <WindowsConstants.au3> ;~ Global $iTheme = _WinAPI_GetThemeAppProperties() ;~ _WinAPI_SetThemeAppProperties(1) Global $hGUI1 = GUICreate("TEST", 300, 300, @DesktopWidth - 350, 50) Global $hGUI1_T = GUICtrlCreateTab(1, 1, 298, 298) Global $hGUI1_T0 = GUICtrlCreateTabItem("Tab 1") Global $hGUI1_T0_LV0 = GUICtrlCreateListView("Column 1|Column 2|Column 3", 10, 30, 280, 140) GUICtrlCreateTabItem("") Global $hGUI1_T1 = GUICtrlCreateTabItem("Tab 2") Global $hGUI1_T1_I0 = GUICtrlCreateInput("Input 1", 10, 180, 280, 21, $ES_READONLY) Global $hGUI1_T1_I1 = GUICtrlCreateInput("Input 2", 10, 210, 280, 21, $ES_READONLY) Global $hGUI1_T1_I2 = GUICtrlCreateInput("Input 3", 10, 240, 280, 21, $ES_READONLY) GUICtrlCreateTabItem("") ;~ _WinAPI_SetThemeAppProperties($iTheme) GUIRegisterMsg($WM_ACTIVATE, "_WM_WORKAROUND") GUIRegisterMsg($WM_ACTIVATEAPP, "_WM_WORKAROUND") ;~ GUIRegisterMsg($WM_COMMAND, "_WM_WORKAROUND") ; ??? GUIRegisterMsg($WM_KILLFOCUS, "_WM_WORKAROUND") GUIRegisterMsg($WM_SETFOCUS, "_WM_WORKAROUND") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _AdlibRegister() Switch WinGetState($hGUI1, "") Case 0, 7, 15 Switch GUICtrlSendMsg($hGUI1_T, $TCM_GETCURSEL, 0, 0) ; _GUICtrlTab_GetCurFocus() Case 0 GUICtrlSetBkColor($hGUI1_T0_LV0, 0xFFFFFF) Case 1 ; Seems to be needed only if '_WinAPI_SetThemeAppProperties(1)'!? GUICtrlSetBkColor($hGUI1_T1_I0, 0xFFFFFF) GUICtrlSetBkColor($hGUI1_T1_I1, 0xFFFFFF) GUICtrlSetBkColor($hGUI1_T1_I2, 0xFFFFFF) EndSwitch EndSwitch AdlibUnRegister("_AdlibRegister") ; Self-unregistering!!! EndFunc ;==>_AdlibRegister Func _WM_WORKAROUND($hWnd, $iMsg, $iwParam, $ilParam) AdlibRegister("_AdlibRegister", 500) ; Less then 500 ms maybe too short!? Return $GUI_RUNDEFMSG EndFunc ;==>_WM_WORKAROUND Edited January 22, 2014 by supersonic Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now