VAN0 Posted June 10, 2020 Share Posted June 10, 2020 (edited) Hello. When both ControlFocus() and _WinAPI_CallWindowProc() used, Autoit window get's resized to full height of the monitor when it's not in focus and click on the bottom or top edge of the window, while cursor is changed to resize: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Global $hGUI = GUICreate("test", 400, 200, 200, 200, $WS_SIZEBOX) Global $hLabel = GUICtrlGetHandle(GUICtrlCreateLabel("test", 0, 0)) ControlFocus($hGUI, "", $hLabel) GUISetState() $wProcHandle = DllCallbackRegister("_WindowProc", "int", "hwnd;uint;wparam;lparam") $wProcOld = _WinAPI_SetWindowLong($hLabel, $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle)) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd _WinAPI_SetWindowLong($hLabel, $GWL_WNDPROC, $wProcOld) DllCallbackFree($wProcHandle) GUIDelete($hGui) Exit Func _WindowProc($hWnd, $Msg, $wParam, $lParam) Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $Msg, $wParam, $lParam) EndFunc Just click outside of "test" window so it's no longer active, then move cursor to the bottom edge until it changes to arrow up/down and click, the window stretches all across the screen. If any of these two lines removed, it fixes the issue. Any ideas why this happening? Windows 10 x64 1909, Autoit 3.3.14.5 [EDIT] this issue has been fixed in Autoit v3.3.15.1 Edited June 12, 2020 by VAN0 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 10, 2020 Moderators Share Posted June 10, 2020 VAN0, I am afraid i cannot reproduce the effect on my Win10 x64 machine with v3.3.14.5. The cursor certainly changes (as I would expect) but clicking merely activates the GUI - there is no change in size. 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...
Nine Posted June 10, 2020 Share Posted June 10, 2020 Same as M23. Tested on Win10 and Win7 without issue. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
VAN0 Posted June 10, 2020 Author Share Posted June 10, 2020 (edited) Prior clicking on the edge, did you make sure the window was NOT in focus? Edited June 10, 2020 by VAN0 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 10, 2020 Moderators Share Posted June 10, 2020 VAN0, Yes. 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...
Nine Posted June 10, 2020 Share Posted June 10, 2020 (edited) Yes, I minimized every windows. Then I clicked your window to make it focus. Then I clicked on the desktop a few times to make sure your window was out of focus. Then I went to the bottom edge and clicked it, and nothing happened (except usual behavior). Edited June 10, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
VAN0 Posted June 10, 2020 Author Share Posted June 10, 2020 Well, not sure than. That video I recorded on freshly installed Windows 10, all default settings, only freshly downloaded and installed Autoit, SciTE and CamStudio. Also tested it on not-so-fresh Windows 7 32bit - same issue. At the moment my theory is somehow that window is treating single click on the edge as double click when it get focused (I bet not many people know this Windows feature, when you can double click on top/bottom edge of a window to stretch it vertically). If it doesn't for you, perhaps there is some kind of setting disabled in Windows itself, that would explain why this issue doesn't reproduce. Link to comment Share on other sites More sharing options...
VAN0 Posted June 10, 2020 Author Share Posted June 10, 2020 After further investigation I can confirm it's in fact the double click issue. However ControlFocus() doesn't seem to play any role in this. Here is another example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Global $hGUI = GUICreate("test", 400, 200, 0, 0, $WS_SIZEBOX) GUISetState() $wProcHandle = DllCallbackRegister("_WindowProc", "int", "hwnd;uint;wparam;lparam") $wProcOld = _WinAPI_SetWindowLong($hGUI, $GWL_WNDPROC, DllCallbackGetPtr($wProcHandle)) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd _WinAPI_SetWindowLong($hGUI, $GWL_WNDPROC, $wProcOld) DllCallbackFree($wProcHandle) GUIDelete($hGUI) Exit Func _WindowProc($hWnd, $iMsg, $wParam, $lParam) If $iMsg = $WM_LBUTTONDBLCLK Then MsgBox("", "Double Click!", "You double clicked!") Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $iMsg, $wParam, $lParam) EndFunc To confirm it's working: double click inside the window, it should show a message box. Than as before, single click inside the window while it was NOT in focus, it still shows message box for me. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 11, 2020 Moderators Share Posted June 11, 2020 VAN0, Nope, single clicking in the non-focused window still just activates it for me - no MsgBox appears. There must be something very strange going on in your setup. 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...
VAN0 Posted June 12, 2020 Author Share Posted June 12, 2020 (edited) Very strange indeed. And just to confirm, actual double click inside the window does produce message box? and double click on bottom edge stretches it across the screen, on your system? And I've tested so far on 3 different physical computers and 2 virtual, same reproducible result everywhere. P.S. Well, at least I'm not alone on this one: Edited June 12, 2020 by VAN0 Link to comment Share on other sites More sharing options...
Danyfirex Posted June 12, 2020 Share Posted June 12, 2020 Hello. I get the issue using AutoIt 3.3.14.5 No issue using Beta AutoIt 3.3.15.1 Try using Beta and check if you get the issue. Saludos VAN0 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
VAN0 Posted June 12, 2020 Author Share Posted June 12, 2020 Thank you! Whatever was changed between 3.3.15.0 and 3.3.15.1 seems to fixed this issue. 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