Search the Community
Showing results for tags 'frame'.
-
; https://www.autoitscript.com/forum/topic/211986-creates-a-rectangle-frame/ ;---------------------------------------------------------------------------------------- ; Title...........: _GuiFrame.au3 ; Description.....: Creates a rectangle frame ; AutoIt Version..: 3.3.16.1 Author: ioa747 ; Note............: Testet in Win10 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <WindowsConstants.au3> #include <WinAPIGdi.au3> ;Example: Global $aCoord, $hPoint, $hFrame = _GuiFrame("", 100, 100, 200, 200, 5, 0xFFFFFF, 255) ;********************************** Do $aCoord = PixelSearch(100, 100, 200, 200, 0xFFFFFF, 0, 1, 0) ;0xFFFFFF White If Not @error Then ConsoleWrite("found White at X,Y: " & $aCoord[0] & "," & $aCoord[1] & @CRLF) $hPoint = _GuiFrame("", $aCoord[0], $aCoord[1], $aCoord[0] + 1, $aCoord[1] + 1, 3, 0xFF0000) Sleep(4000) GUIDelete($hPoint) EndIf Sleep(10) Until GUIGetMsg() = -3 ; GUI_EVENT_CLOSE ;********************************** ; #FUNCTION# -------------------------------------------------------------------------------------------------------------------- ; Name...........: _GuiFrame ; Description....: Creates a rectangle frame ; Syntax.........: _GuiFrame($sTitle, $iLeft, $iTop, $iRight, $iBottom [, $iThickness = 2 [, $iColor = 0xFF0000 [, $iTransparency = 150 [, $hWndParent = 0]]]]) ; Parameters.....: $sTitle - The title of frame. ; $iLeft - The left coordinate of frame. ; $iTop - The top coordinate of frame. ; $iRight - The right coordinate of frame. ; $iBottom - The bottom coordinate of frame. ; $iThickness - [optional] The thickness of frame (default = 1). ; $iColor - [optional] The color of frame (default = 0xFF0000). ; $iTransparency - [optional] The transparency of frame, in the range 1 - 255 (default = 150). ; $hWndParent - [optional] The parent window handle (default = 0). ; Return values..: The handle of the created frame. ; Author ........: ioa747 ; Notes .........: Note that coordinate, are the internal frame dimensions. ; Dependencies...: #include <WinAPIGdi.au3>, #include <WindowsConstants.au3> ;-------------------------------------------------------------------------------------------------------------------------------- Func _GuiFrame($sTitle, $iLeft, $iTop, $iRight, $iBottom, $iThickness = 1, $iColor = 0xFF0000, $iTransparency = 150, $hWndParent = 0) If $iThickness < 1 Or $iThickness = Default Then $iThickness = 1 If $iColor = -1 Or $iColor = Default Then $iColor = 0xFF0000 If $iTransparency < 1 Or $iTransparency = Default Or $iTransparency > 255 Then $iTransparency = 150 Local $iWidth = $iRight - $iLeft + (2 * $iThickness) + 1 Local $iHeight = $iBottom - $iTop + (2 * $iThickness) + 1 Local $hGUI = GUICreate($sTitle, $iWidth, $iHeight, $iLeft - $iThickness, $iTop - $iThickness, _ $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_NOACTIVATE), $hWndParent) GUISetBkColor($iColor, $hGUI) WinSetTrans($hGUI, "", $iTransparency) ;255 = Solid, 0 = Invisible. GUISetState(@SW_SHOWNOACTIVATE, $hGUI) Local $hOuter_rgn, $hInner_rgn, $hCombined_rgn $hOuter_rgn = _WinAPI_CreateRectRgn(0, 0, $iWidth, $iHeight) $hInner_rgn = _WinAPI_CreateRectRgn($iThickness, $iThickness, $iWidth - $iThickness, $iHeight - $iThickness) $hCombined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) _WinAPI_CombineRgn($hCombined_rgn, $hOuter_rgn, $hInner_rgn, $RGN_DIFF) _WinAPI_DeleteObject($hInner_rgn) _WinAPI_SetWindowRgn($hGUI, $hCombined_rgn) Return $hGUI EndFunc ;==>_GuiFrame ;-------------------------------------------------------------------------------------------------------------------------------- Another example #include <WindowsConstants.au3> #include <WinAPIGdi.au3> #include <WinAPISys.au3> _Example1() Func _Example1() Local $iGuiFrame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME) Local $iThickness = 10 Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(0, ''Hello World!'', ''Hi! Move this window around'')"') Local $hWnd = WinWaitActive('Hello World!', '', 3) Local $aPos = WinGetPos($hWnd) Local $iLeft = $aPos[0] + $iGuiFrame Local $iTop = $aPos[1] Local $iRight = $aPos[0] + $aPos[2] - $iGuiFrame Local $iBottom = $aPos[1] + $aPos[3] - $iGuiFrame Local $hFrame = _GuiFrame("", $iLeft, $iTop, $iRight, $iBottom, $iThickness, 0xFF0000, 150, $hWnd) ConsoleWrite("$hFrame=" & $hFrame & @CRLF) Local $sStrPos While WinExists($hWnd) $aPos = WinGetPos($hWnd) If $sStrPos <> $aPos[0] & ";" & $aPos[1] Then WinMove($hFrame, '', $aPos[0] - $iThickness + $iGuiFrame, $aPos[1] - $iThickness) $sStrPos = $aPos[0] & ";" & $aPos[1] EndIf Sleep(10) WEnd EndFunc ;==>_Example1 ; #FUNCTION# -------------------------------------------------------------------------------------------------------------------- ; Name...........: _GuiFrame ; Description....: Creates a rectangle frame ; Syntax.........: _GuiFrame($sTitle, $iLeft, $iTop, $iRight, $iBottom [, $iThickness = 2 [, $iColor = 0xFF0000 [, $iTransparency = 150 [, $hWndParent = 0]]]]) ; Parameters.....: $sTitle - The title of frame. ; $iLeft - The left coordinate of frame. ; $iTop - The top coordinate of frame. ; $iRight - The right coordinate of frame. ; $iBottom - The bottom coordinate of frame. ; $iThickness - [optional] The thickness of frame (default = 1). ; $iColor - [optional] The color of frame (default = 0xFF0000). ; $iTransparency - [optional] The transparency of frame, in the range 1 - 255 (default = 150). ; $hWndParent - [optional] The parent window handle (default = 0). ; Return values..: The handle of the created frame. ; Author ........: ioa747 ; Notes .........: Note that coordinate, are the internal frame dimensions. ; Dependencies...: #include <WinAPIGdi.au3>, #include <WindowsConstants.au3> ;-------------------------------------------------------------------------------------------------------------------------------- Func _GuiFrame($sTitle, $iLeft, $iTop, $iRight, $iBottom, $iThickness = 1, $iColor = 0xFF0000, $iTransparency = 150, $hWndParent = 0) If $iThickness < 1 Or $iThickness = Default Then $iThickness = 1 If $iColor = -1 Or $iColor = Default Then $iColor = 0xFF0000 If $iTransparency < 1 Or $iTransparency = Default Or $iTransparency > 255 Then $iTransparency = 150 Local $iWidth = $iRight - $iLeft + (2 * $iThickness) + 1 Local $iHeight = $iBottom - $iTop + (2 * $iThickness) + 1 Local $hGUI = GUICreate($sTitle, $iWidth, $iHeight, $iLeft - $iThickness, $iTop - $iThickness, _ $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_NOACTIVATE), $hWndParent) GUISetBkColor($iColor, $hGUI) WinSetTrans($hGUI, "", $iTransparency) ;255 = Solid, 0 = Invisible. GUISetState(@SW_SHOWNOACTIVATE, $hGUI) Local $hOuter_rgn, $hInner_rgn, $hCombined_rgn $hOuter_rgn = _WinAPI_CreateRectRgn(0, 0, $iWidth, $iHeight) $hInner_rgn = _WinAPI_CreateRectRgn($iThickness, $iThickness, $iWidth - $iThickness, $iHeight - $iThickness) $hCombined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) _WinAPI_CombineRgn($hCombined_rgn, $hOuter_rgn, $hInner_rgn, $RGN_DIFF) _WinAPI_DeleteObject($hInner_rgn) _WinAPI_SetWindowRgn($hGUI, $hCombined_rgn) Return $hGUI EndFunc ;==>_GuiFrame ;-------------------------------------------------------------------------------------------------------------------------------- Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
-
Link and example: FrameGrabber.dll What about my question regarding returning a bitmap handle or bitmap data rather than saving the grabbed frame to disk? Actually I would talk about VScript because I'm curious but Jon doesn't want it but can you show me the code please? You said it is similar to AU3 code. I want to understand how you did it. Thanks.
-
I know some have posted about this before but.... Is there any work around to do cross-frame scripting in IE. I know it's a security feature in IE. I just find it hard to believe its not possible. I am sure there is some kind of JavaScript or jquery alternative? Specifically I am trying to use autoitscripts within frame(s), or at a minimum, read the full source of few webpages past where I have to login. Its a high security site and only IE is the only browser allowed to login. Here is an example of the tag.