wuruoyu Posted May 4, 2016 Share Posted May 4, 2016 (edited) OS: Win7 (same issue on multiple computers) Using GUIOnEventMode Here is how I create the input and edit #NoTrayIcon #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> #include <GuiTab.au3> #include <EditConstants.au3> Opt("GUIOnEventMode", 1) _main() Func _main() $main = GUICreate("main",368,343,-1,-1,-1,-1) GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") GUICtrlCreateEdit("this is an edit control",23,194,325,67,BitOr($ES_READONLY,$WS_VSCROLL),$WS_EX_CLIENTEDGE) GUICtrlCreateInput("This is an inputbox",19,269,325,20,-1,$WS_EX_CLIENTEDGE) GUICtrlCreateButton("button",248,303,100,27,-1,-1) $tab = GUICtrlCreatetab(4,0,363,186,-1,-1) GuiCtrlSetState(-1,2048) GUICtrlCreateTabItem("Page 1") GUICtrlCreateGroup("Group",14,25,341,150,-1,-1) GUICtrlCreateEdit("this is an edit control",20,55,325,67,BitOr($ES_READONLY,$WS_VSCROLL),$WS_EX_CLIENTEDGE) GUICtrlCreateInput("This is an inputbox",20,140,325,20,-1,$WS_EX_CLIENTEDGE) GUICtrlCreateTabItem("Page 2") _GUICtrlTab_SetCurFocus($tab,0) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd EndFunc Func _exit() Exit EndFunc Reproduce the problem: 1. Launch program 2. Press Win+L to lock computer 3. Unlock computer 4. GUICtrlCreateInput & GUICtrlCreateEdit borders disappear (seems to do that when edit and inputbox controls are inside the tab) Edited May 15, 2016 by wuruoyu Link to comment Share on other sites More sharing options...
AutoBert Posted May 4, 2016 Share Posted May 4, 2016 Make a complete runable reproducer script. Link to comment Share on other sites More sharing options...
wuruoyu Posted May 14, 2016 Author Share Posted May 14, 2016 On May 4, 2016 at 1:21 PM, AutoBert said: Make a complete runable reproducer script. Updated with reproducer script. Thanks! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 14, 2016 Moderators Share Posted May 14, 2016 wuruoyu, I cannot reproduce that effect on my machine (Win 7) - the controls are still visible after a lock/unlock cycle. And is there a reason you use such a convoluted method of adding the controls to your tabitems rather then just creating them immediately after each tabitem is created? 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...
wuruoyu Posted May 14, 2016 Author Share Posted May 14, 2016 1 hour ago, Melba23 said: wuruoyu, I cannot reproduce that effect on my machine (Win 7) - the controls are still visible after a lock/unlock cycle. And is there a reason you use such a convoluted method of adding the controls to your tabitems rather then just creating them immediately after each tabitem is created? M23 Thank you for testing Melba23. I've used ISN AutoIt Studio to create the GUI, and that was how it generates the code. I've updated the reproducer script, it should be much cleaner now. but still having the disappearing border issue... it looks like it's only doing that when controls are inside the tab. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 14, 2016 Moderators Share Posted May 14, 2016 wuruoyu, Still works for me every time. M23 P.S. When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily. 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...
wuruoyu Posted May 15, 2016 Author Share Posted May 15, 2016 anyone else could help me test it on their machine? I've tested on 30 different workstations and all having the same issue. Link to comment Share on other sites More sharing options...
AutoBert Posted May 15, 2016 Share Posted May 15, 2016 no problems on win10 x64 with autoit 3.3.14.2 Link to comment Share on other sites More sharing options...
orbs Posted May 15, 2016 Share Posted May 15, 2016 1 hour ago, wuruoyu said: I've tested on 30 different workstations is it possible that all of those workstations are of the same hardware (or at least the same video card), with the same buggy video driver? do you get the same issue in safe mode? Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
wuruoyu Posted May 15, 2016 Author Share Posted May 15, 2016 These are Lenovo ThinkCentre M90p with intel integrated graphic, running x64 or x86 Win7. I doubt there are graphic driver issues as we have over thousands of workstations with the same setup that never experience such issue with any other programs, or programs are created with WPF or Winforms Link to comment Share on other sites More sharing options...
LarsJ Posted May 15, 2016 Share Posted May 15, 2016 wuruoyu, I can confirm the issue on my old XP. Not on Windows 7. The problem is directly related to the Tab control. It has nothing to do with OnEvent mode. You'll see the same issue in MessageLoop mode. Something on your PCs must provoke the problem. But I don't think you can do anything on the PCs. You have to solve the problem in the AutoIt code. Generally there may be some small issues associated with using Tab controls. I think this repaint problem is an example. If you move the mouse across the control you'll probably see that the border will be repainted. An easy workaround is to create the controls in a child window and place the child window on top of the Tab control. Because the controls are created in a real window (and not a Tab control), there will not be any update issues. If you create a child window for each Tab item you just have to hide the previous child window and show the new child window when you click a Tab item. Another solution is to force a repaint of the controls when the problem occurs. That's what happens when you move the mouse across the control. But I think this solution is more difficult, and the problem can occur in various situations. The workaround with the child window is a general solution. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
orbs Posted May 15, 2016 Share Posted May 15, 2016 or avoid using tab controls altogether. speaking for myself, i find the graphics of the tab control somewhat unaesthetic (although functional). as an alternative, i group my controls in arrays, so i can hide and show them easily. so by clicking a label on the GUI, the user can hide currently visible controls and show a specific group of controls (not to be confused with the "Group" control!), thus achieving the same functionality as using tab control. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
wuruoyu Posted May 15, 2016 Author Share Posted May 15, 2016 Thank you LarsJ for pointing me to right direction. I would prefer to go with the force repaint solution. _WinAPI_RedrawWindow($main) Calling the above function makes the borders reappear. Is there is way to constantly check if Windows is changed from lock to unlock state? and only call the above function one time when Windows is unlocked. telmob 1 Link to comment Share on other sites More sharing options...
LarsJ Posted May 15, 2016 Share Posted May 15, 2016 I think you can check that with the WM_WTSSESSION_CHANGE message (GUIRegisterMsg). Test wParam = WTS_SESSION_UNLOCK. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
wuruoyu Posted May 15, 2016 Author Share Posted May 15, 2016 Thanks again LarsJ, got it working with $EVENT_OPEN_DESKTOP_CHANGED & _WinEventHook_Proc cheers 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