Jump to content

Controls disappear partly if Windows Explorer window overlaps


Recommended Posts

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 by supersonic
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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:

#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 by supersonic
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...