faustf Posted March 30, 2016 Share Posted March 30, 2016 hi guy how is possible set on top a line created with GUICtrlCreateGraphic ? i used GUICtrlSetState(-1 ,$GUI_ONTOP) but stay on top only is you not use nothing over the gui , if you put them a inputbox or edit box , the line go down the inputbox or edit i wanna create somthing like this (foto in attach) , how is possible to do ??? Link to comment Share on other sites More sharing options...
Danyfirex Posted March 30, 2016 Share Posted March 30, 2016 (edited) Hi. You can do something like this (its not the best way, but do the trick). need to be cleaned and free resource.... expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global $hDC, $hPen, $o_Orig #Region ### START Koda GUI section ### Form= Global $hGUI = GUICreate("Form1", 603, 348, 192, 124) Global $iLeft = 20, $iTop = 32 Global $Edit1 = GUICtrlCreateEdit("", $iLeft, $iTop, 561, 289) $hDC = _WinAPI_GetWindowDC(GUICtrlGetHandle($Edit1)) ; DC of entire screen (desktop) $hPen = _WinAPI_CreatePen($PS_SOLID, 2, 0xFF) $o_Orig = _WinAPI_SelectObject($hDC, $hPen) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $nMsg = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Draw() WEnd Func Draw() Local $aSize = 0 _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW) ; force redraw of Gui (Rect=0 Region=0) $aSize = ControlGetPos($hGUI, "", $Edit1) If Not IsArray($aSize) Then Return $aSize[0] = $aSize[0] - $iLeft $aSize[1] = $aSize[1] - $iTop _WinAPI_DrawLine($hDC, $aSize[0], $aSize[1] + 1, $aSize[2], $aSize[1] + 1) _WinAPI_DrawLine($hDC, $aSize[0], $aSize[1] + 1 + 20, $aSize[2] + 1, $aSize[1] + 20) _WinAPI_DrawLine($hDC, $aSize[0], $aSize[1] + 1 + 40, $aSize[2] + 1, $aSize[1] + 40) _WinAPI_DrawLine($hDC, $aSize[0] + 1, $aSize[1], $aSize[0] + 1, $aSize[3]) _WinAPI_DrawLine($hDC, $aSize[2] - 1, $aSize[1], $aSize[2] - 1, $aSize[2]) _WinAPI_DrawLine($hDC, $aSize[0], $aSize[3] - 1, $aSize[2], $aSize[3] - 1) _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE) ; then force no-redraw of Gui EndFunc ;==>Draw Saludos Edited March 30, 2016 by Danyfirex faustf 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...
faustf Posted March 30, 2016 Author Share Posted March 30, 2016 o thankz so mcuh Link to comment Share on other sites More sharing options...
faustf Posted March 30, 2016 Author Share Posted March 30, 2016 but how is possible cancel the rectangle??? Link to comment Share on other sites More sharing options...
faustf Posted March 30, 2016 Author Share Posted March 30, 2016 i answer me destroy eedit and recreate simply 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