Rexit Posted March 2, 2019 Share Posted March 2, 2019 Hi, I'm new to the forums but have been trying to learn AutoIT for a few weeks now and managed to automate some cool stuff at the startup of my pc etc... I was thinking about 1 cool thing I don't think is possible in AutoIT but I felt like asking before giving up. Is there a way to make draw an overlay that is "always on top" around a window. I would put a label somewhere there with the status of the part of the animation it's doing. I would also need the option of it being "click throughable", that's the best way I can say it. Thanks in advance. Link to comment Share on other sites More sharing options...
Nine Posted March 2, 2019 Share Posted March 2, 2019 @Rexit Take a look at this thread and run uez code. Let see if that it's close enough to go further. It hasn't have the click throughable thing. But could serve as a starter... “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...
Rexit Posted March 2, 2019 Author Share Posted March 2, 2019 11 minutes ago, Nine said: @Rexit Take a look at this thread and run uez code. Let see if that it's close enough to go further. It hasn't have the click throughable thing. But could serve as a starter... The ability to click through is the most important part... Link to comment Share on other sites More sharing options...
Malkey Posted March 4, 2019 Share Posted March 4, 2019 This may help you. I haven't been able to drag the border with Notepad or the main GUI. Someone else may be able to help with this if this is the type of idea you wanted. expandcollapse popup#include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIGdi.au3> #include <WinAPIHObj.au3> #include <WinAPISysWin.au3> Global $iBorder = 50, $hGUIMain, $hWndBorder ;Local $hGUIMain = GUICreate("Example") ; or Run("notepad.exe", "") $hGUIMain = WinWait("[CLASS:Notepad]", "", 10) WinSetOnTop($hGUIMain, "", 1) GUISetState(@SW_SHOW, $hGUIMain) $aPos = WinGetPos($hGUIMain) ;Get windowsize $hWndBorder = _GuiBorder($aPos, "Window's Title: " & WinGetTitle($hGUIMain)) ;ConsoleWrite("$hWndBorder: " & $hWndBorder & @CRLF) ;ConsoleWrite("$hGUIMain: " & $hGUIMain & @CRLF) GUIRegisterMsg($WM_MOUSEMOVE, "_WinMove") GUIRegisterMsg($WM_WINDOWPOSCHANGING, "_WinMove") While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Or Not WinExists($hGUIMain) Or Not WinExists($hWndBorder) Then If WinExists($hWndBorder) Then GUIDelete($hWndBorder) If WinExists($hGUIMain) Then WinClose($hGUIMain) ExitLoop EndIf WEnd Func _GuiBorder($aGUIPos, $sText = "Window information") Local $iWidth = 2 * $iBorder + $aGUIPos[2] Local $iHeight = 2 * $iBorder + $aGUIPos[3] Local $hGUI, $aSize, $hRegion, $hRegion1, $hRGN $hGUI = GUICreate("GDI+", $iWidth, $iHeight, $aGUIPos[0] - $iBorder, $aGUIPos[1] - $iBorder, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0x00FFFF) ;Set window background color to blue GUICtrlCreateLabel($sText, 0, 0, $iWidth - 10, 30, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetFont(-1, 12, 600) GUISetState(@SW_SHOW) _GDIPlus_Startup() $aSize = WinGetPos($hGUI) ;Get windowsize $hRegion1 = _GDIPlus_RegionCreateFromRect($iBorder + 7, $iBorder + 1, $aSize[2] - $iBorder * 2 - 14, $aSize[3] - $iBorder * 2 - 8) $hRegion = _GDIPlus_RegionCreateFromRect(0, 0, $aSize[2], $aSize[3]) _GDIPlus_RegionCombineRegion($hRegion, $hRegion1, 3) $hRGN = _GDIPlus_RegionGetHRgn($hRegion, 0) ;Create GDI region from GDI+ region _WinAPI_SetWindowRgn($hGUI, $hRGN) ;Set window region ;Clean up resources _WinAPI_DeleteObject($hRGN) _GDIPlus_RegionDispose($hRegion) _GDIPlus_RegionDispose($hRegion1) _GDIPlus_Shutdown() Return $hGUI EndFunc ;==>_GuiBorder Func _WinMove($hWnd, $Command, $wParam, $lParam) If BitAND(WinGetState($hWnd), 32) Then Return $GUI_RUNDEFMSG ;ConsoleWrite($hWnd & @CRLF) If $hWnd = $hWndBorder Then $aPos = WinGetPos($hWndBorder) WinMove($hGUIMain, "", $aPos[0] + $iBorder, $aPos[1] + $iBorder) EndIf EndFunc ;==>_WinMove Netol 1 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