Leaderboard
Popular Content
Showing content with the highest reputation on 01/15/2014 in all areas
-
Control Viewer - AutoIt Window Info Tool
mythicalzxc reacted to Yashied for a topic
LAST VERSION - 1.1 18-May-12 Control Viewer (CV) is a replacement of AutoIt Window Info with a number of advantages. I tried to stick to the interface of the last, so you almost do not have to be retrained. During testing, I never managed to find any controls that could not be identified by CV (on the contrary, shows a lot of hidden controls, especially for the system windows). The all program settings are stored in the following registry key: HKEY_CURRENT_USERSoftwareY'sControl Viewer The main differences CV from AWI Shows the complete list of all existing controls for the window that are interested (visible, hidden and deleted controls are displayed with different colors that can be changed to any other).Dynamically changing information during search for the windows and their controls.Ability to quickly switch between controls in the list.Ability to show/hide any controls from the list (useful for the overlaping controls).Information for the Style and ExStyle parameters shown in the form of hexadecimal values, and as its flags.Added the PID and Path parameters in the Window tab and ability to quickly open a folder that containing the process file.Added the coordinate system relative to the selected control.Shows a color of the selected pixel in RGB and BGR formats.Shows an example fill of the selected color.Ability to select the text encoding (affects the Text parameter in the Control tab).The complete change the appearance of pop-up frame for the selected controls.Simple and convenient tool to get a screenshot of the part screen of interest for publication on the forum (Capture tab).Create a report in the clipboard or a text file for subsequent publication on the forum.Search all running AutoIt scripts and their windows in the system (AutoIt tab).User-friendly interface. Used shortcuts Ctrl+Alt+T - Enable/Disable "Always On Top" mode (also available from the menu). Ctrl+Alt+H - Enable/Disable highlight selected controls (also available from the menu). Ctrl+A - Select all text (works in any input field). Ctrl - Hold down when moving the mouse to scroll the screenshot (Capture tab). Shift - Hold down when stretching/compression of the contour frame for an equilateral resizing screenshots (Capture tab). DoubleClick (on the screenshot) - Save the image to a file (Capture tab). DoubleClick (on any list item) - Open a folder with the file of the process or AutoIt script (AutoIt tab). Del (on any list item) - Close process (AutoIt tab). F5 - Updating the list (AutoIt tab). If anyone have any questions or comments about CV, please post it in this thread. I will be glad to any feedback and suggestions. Files to download Binary (x86 and x64) Redirection to CV_bin.zip, 1.14 MB CV_bin.html Source Redirection to CV_source.zip, 691 KB CV_source.html1 point -
ImageSearch Usage Explanation
HansHenrik reacted to Centrally for a topic
After having lot of issues myself with getting ImageSearch to work I decided to make topic with explanation how to proper use this script. Here is link of original topic at this topic: Credits to kangkeng for creating such useful piece of code. What is ImageSearch? It's script that find part of screen which you before defined with given image. When should I use ImageSearch? You should use it whenever it's not possible or unlikely that pixelsearch will give what you need. So how can I use ImageSearch and enjoy it's awesome benefits? First of all to avoid mostly caused problems I recompiled DLLs for both architectures which you can download at end of this post. When you pick your package you should place both ImageSearch.au3 and ImageSearch.dll inside script folder. Usage Example: First of all take picture of what you want to search for (print screen + paint + corp + save as bmp). Place that picture in script directory (I named my picture checkImage (checkImage.bmp is full name with extension). You must include ImageSearch.au3 in your script. ImageSearch.au3 consist of 2 Functions you can use: _ImageSearch and _ImageSearchArea Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify a desktop region to search Values to put in for _ImageSearch function (entire screen search) ($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance, $HBMP=0) Values to put in for _ImageSearchArea function (you declare part of screen to be searched) ($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef $x, ByRef $y, $tolerance,$HBMP=0) Description of parameters from ImageSearch.au3 itself: ; Description: Find the position of an image on the desktop ; Syntax: _ImageSearchArea, _ImageSearch ; Parameter(s): ; $findImage - the image to locate on the desktop ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 Example of my script using _ImageSearch ( entire screen search) #include <ImageSearch.au3> HotKeySet("p", "checkForImage") global $y = 0, $x = 0 Func checkForImage() Local $search = _ImageSearch('checkImage.bmp', 0, $x, $y, 0) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc while 1 sleep(200) WEnd Example of my script using _ImageSearchArea #include <ImageSearch.au3> HotKeySet("p", "checkForImage") global $y = 0, $x = 0 Func checkForImage() local $search = _ImageSearchArea('check5.bmp', 1, 800, 40, 900, 80, $x, $y, 0) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc while 1 sleep(200) WEnd I would like to apologize if by writing this I offended any of member that thinks this script is too simple to even have it explained, it's just as me being new to autoIt it took me so much time getting around errors and making this script to work. Thanks for reading, if you bump on any problems using it post it here, I will try to help you fixing it and update topic for further reference. Download links: 32bit: ImageSearch 32bit.rar 64bit: ImageSearch 64 bit.rar1 point -
Tesseract (Screen OCR) UDF
mLipok reacted to seangriffin for a topic
This UDF provides text capturing support for applications and controls using Tesseract - an OCR engine currently developed by Google. Tesseract was originally developed as proprietary software at Hewlett-Packard between 1985 until 1995. After ten years without any development taking place, Hewlett Packard and UNLV released it as open source in 2005. Tesseract is currently developed by Google and released under the Apache License, Version 2.0. Tesseract is considered one of the most accurate free software OCR engines currently available. It was one of the top 3 engines in the 1995 UNLV Accuracy test. My main goal in developing this UDF is to provide AutoIT users with a free Screen OCR solution that competes with other commercial (payed) technologies like Microsoft Office Document Imaging (MODI) and Textract. REQUIREMENTS: AutoIt3 3.2 or higherTesseract 2.01 or aboveINSTALLATION: To install Tesseract: Run the file http://web.aanet.com.au/seangriffin/Tesseract201.exe.Follow the installation instructions.LIST OF FUNCTIONS: DEMONSTRATION: <Under Construction> EXAMPLES: _TesseractControlCapture.au3_TesseractControlFind.au3 DOWNLOAD: Latest Version - v0.6 (17/03/09) Tesseract.au31 point -
LAST VERSION - 1.8 02-Nov-09 Deprecated. The library contains three basic functions. I always use these functions and decided to share them with the community. I hope that to some of you they will be useful. To understand why this is done, please look at my examples. History Available functions Icons UDF Library v1.8 Previous downloads: 1268 Icons.au3 Example #Include <GUIConstantsEx.au3> #Include <Icons.au3> Global Const $sPng = RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir') & '\Examples\GUI\Advanced\Images\Torus.png' Global Const $sJpg = @TempDir & '\~wallpaper.jpg' Global Const $sGreen = @TempDir & '\~green.png' Global Const $sRed = @TempDir & '\~red.png' Global Const $sLogo = @TempDir & '\~logo.png' Example1() Example2() Example3() Example4() Example5() Example6() Example7() Func Example1() GUICreate('Example1', 204, 108) $Icon1 = GUICtrlCreateIcon('', 0, 30, 38, 32, 32) $Icon2 = GUICtrlCreateIcon('', 0, 88, 38, 32, 32) $Icon3 = GUICtrlCreateIcon('', 0, 146, 38, 32, 32) GUISetState() _SetCombineBkIcon($Icon1, -1, @SystemDir & '\shell32.dll', 70, 32, 32, @SystemDir & '\shell32.dll', 22, 24, 24, 0, 8) _SetCombineBkIcon($Icon2, -1, @SystemDir & '\shell32.dll', 3, 32, 32, @SystemDir & '\shell32.dll', 28, 32, 32) _SetCombineBkIcon($Icon3, -1, @SystemDir & '\shell32.dll', 220, 32, 32, @SystemDir & '\shell32.dll', 29, 32, 32) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example1 Func Example2() GUICreate('Example2', 216, 128) $Icon = GUICtrlCreateIcon('', 0, 40, 40, 48, 48) GUICtrlCreateIcon(@WindowsDir & '\explorer.exe', 0, 128, 40, 48, 48) GUISetState() _SetIcon($Icon, @WindowsDir & '\explorer.exe', 0, 48, 48) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example2 Func Example3() GUICreate('Example3', 715, 388) $Pic1 = GUICtrlCreatePic('', 10, 10, 386, 368) $Pic2 = GUICtrlCreatePic('', 406, 10, 193, 184) $Pic3 = GUICtrlCreatePic('', 609, 10, 96, 92) GUISetState() _SetImage($Pic1, $sPng) _SetImage($Pic2, $sPng) _SetImage($Pic3, $sPng) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example3 Func Example4() GUICreate('Example4', 253, 244) $Pic1 = GUICtrlCreatePic('', 10, 10, 193, 184) $Pic2 = GUICtrlCreatePic('', 60, 60, 193, 184) GUISetState() _SetImage($Pic2, $sPng) _SetImage($Pic1, $sPng) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example4 Func Example5() Local $aIndex[10] = [4, 13, 23, 31, 86, 104, 130, 150, 168, 170] GUICreate('Example5', 600, 400) $Pic = GUICtrlCreatePic('', 0, 0, 600, 400) For $i = 1 To UBound($aIndex) GUICtrlCreatePic('', Random(0, 600 - 48, 1), Random(0, 400 - 48, 1), 48, 48) $hIcon = _Icons_Icon_Extract(@SystemDir & '\shell32.dll', $aIndex[$i - 1], 48, 48) $hBitmap = _Icons_Bitmap_CreateFromIcon($hIcon) _SetHImage($Pic + $i, $hBitmap) _WinAPI_DeleteObject($hBitmap) _WinAPI_DestroyIcon($hIcon) Next GUISetState() InetGet('http://dota.ru/3d/big/p324_42.jpg', $sJpg) $hBitmap = _Icons_Bitmap_Load($sJpg) $hArea = _Icons_Bitmap_Crop($hBitmap, 420, 320, 600, 400) _SetHImage($Pic, $hArea) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteObject($hArea) FileDelete($sJpg) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example5 Func Example6() GUICreate('Example6', 800, 500) $Background = GUICtrlCreatePic('', 0, 0, 800, 500) GUICtrlSetState(-1, $GUI_DISABLE) $Button = GUICtrlCreateButton('Test', 355, 460, 90, 23) $Pic1 = GUICtrlCreatePic('', 102, 122, 256, 256) $Pic2 = GUICtrlCreatePic('', 442, 122, 256, 256) GUISetState() InetGet('http://autoit.rv.ua/files/Pictures/icons_ex_back.jpg', $sJpg) InetGet('http://autoit.rv.ua/files/Pictures/icons_ex_green.png', $sGreen) InetGet('http://autoit.rv.ua/files/Pictures/icons_ex_red.png', $sRed) _SetImage($Background, $sJpg) $hGreen = _Icons_Bitmap_Load($sGreen) $hRed = _Icons_Bitmap_Load($sRed) _SetHImage($Pic1, $hRed) _SetHImage($Pic2, $hRed) FileDelete($sJpg) FileDelete($sGreen) FileDelete($sRed) $pCtrlID = 0 While 1 $Cursor = GUIGetCursorInfo() If @error Then ContinueLoop EndIf $nCtrlID = $Cursor[4] If $nCtrlID <> $pCtrlID Then Switch $pCtrlID Case $Pic1 _SetHImage($Pic1, $hRed) Case $Pic2 _SetHImage($Pic2, $hRed, -1) EndSwitch Switch $nCtrlID Case $Pic1 _SetHImage($Pic1, $hGreen) Case $Pic2 _SetHImage($Pic2, $hGreen, -1) EndSwitch $pCtrlID = $nCtrlID EndIf $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE ExitLoop Case $Button GUICtrlSetState($Button, $GUI_DISABLE) For $i = 1 To 50 GUIGetMsg() _SetHImage($Pic1, $hGreen) _SetHImage($Pic2, $hGreen, -1) Sleep(50) _SetHImage($Pic1, $hRed) _SetHImage($Pic2, $hRed, -1) Sleep(50) Next GUICtrlSetState($Button, $GUI_ENABLE) EndSwitch WEnd GUIDelete() EndFunc ;==>Example6 Func Example7() GUICreate('Example7', 400, 93) $Pic = GUICtrlCreatePic('', 0, 0, 400, 93) $hIcon = _Icons_Icon_Extract(@SystemDir & '\shell32.dll', 86, 24, 24) $hBitmap = _Icons_Bitmap_CreateFromIcon($hIcon) For $i = 1 To 5 GUICtrlCreatePic('', 258 + ($i - 1) * 28, 12, 24, 24) _SetHImage($Pic + $i, $hBitmap) Next _WinAPI_DeleteObject($hBitmap) _WinAPI_DestroyIcon($hIcon) GUISetState() InetGet('http://www.autoitscript.com/forum/public/style_images/autoit/logo.png', $sLogo) $hBitmap = _Icons_Bitmap_Load($sLogo) $hArea = _Icons_Bitmap_Crop($hBitmap, 0, 7, 400, 93) _SetHImage($Pic, $hArea) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteObject($hArea) FileDelete($sLogo) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example7 GUICtrlSetOnHover & Icons UDFs Demonstration Icons_Hover.zip1 point
-
AutoIt Windows Screenshooter Key Features: takes easily a screenshot from any visible window capture any region of the desktop incl. freehand capturing capture GUI controls and GUI menus separately capture a marked area every x seconds for a duration of y seconds create a GIF animation from saved frames (Vista or higher os required) capture to AVI file (without audio!) takes a screenshot from web sites (available only on Win7+ os and when Aero is enabled) put images to clipboard to paste to other applications easily color picker save image in different formats and also to PDF! add timestamp to saved images simple image editing options: greyscale, b&w, invert, rotate +-90° send image to printer and default email client preview of captured screens incl. zoom option multi monitor support display pixel color under mouse ruler basic image editor (paint, highlight, ellipse, rectangle, text and some graphic FX) watermark captured image no 3rd party tools or DLLs used - pure AutoIt! fully portable - no installation is needed multi language feature (Eng, Ger, Tur, Fra and Rus only) drag'n'drop an image to the app for editing To do: capture content of scrollable window/control capture cascaded menus Due to DllCall("User32.dll", "int", "PrintWindow", "hwnd", $hWnd, "handle", $hMemDC, "int", 0) limitation some windows cannot be captured properly (GDI+, ProgDVB, etc.) but can take screenshots of hidden windows. One workaround is to use full screen capturing (F11/F12) or "Grab Screen" function! Or try double click with rmb on listview items (beta). Download source code (10489 downloads previously): AutoIt Windows Screenshooter v1.84 Build 2019-08-18.7z (version 3.3.12.0+ needed!) You are not allowed to sell this code or just parts of it in a commercial project or modify it and distribute it with a different name! Download compiled Exe only: 4shared / Media Fire / Softpedia (1.58mb) Distributing copies of the program in compiled format (exe) must be free of any fee! -----> click here to Donate! (Current donators: 1. Cuong N.) It is designed for Win7+ operating systems with AERO enabled! E.g. on WinXP machines some functions are not working properly and might crash the application! AV scanners may have a negative impact the execution of compiled exe and might report any malware. I guarantee that there is no malicious code in the source code / exe!!! Main GUI: About Intro: Basic Image Editor: Watermark: Click link for an enhanced version of Watermark Image. Credits: main code by UEZ additional code (alphabetical order) by Authenticity, AutoItObject Team, Eemuli, Eukalyptus, funkey, _Kurt, martin, monoceres, ProgAndy, taietel, trancexx, Ward, wolf9228 and Yashied! mesale0077 for turkish translation wakillon for french translation AZJIO for russian translation Keys: Main GUI: User your mouse to scroll preview window or Numpad 8: Scroll preview window up Numpad 2: Scroll preview window down Numpad 4: Scroll preview window left Numpad 6: Scroll preview window right Numpad +: zoom in preview window or mouse wheel down Numpad -: zoom out preview window or mouse wheel up F1: capture again on last position F5: refresh Windows Name list PRINTSCREEN: take screenshot from whole screen ALT+PRINTSCR: take a screenshot from active window F10: Undo made changes with Image Editing function F11: take screenshot from whole screen incl mouse cursor F12: take screenshot from whole screen Ctrl+Alt+F9 start "Grab Screen" mode Ctrl+Alt+F12: take a screenshot from active window using alternative screenshot functionality (beta)! Ctrl+r: call ruler Ctrl+s: save current displayed image Ctrl+x: exit program ctrl+w: call web grab input field (available only when Aero is enabled) Ctrl+i: call image editor Ctrl+m: call watermark editor Ctrl+z: undo Only available on Vista+ os: double click with rmb on list items to use alternative screenshot functionality (beta)! When 'Grab Screen' is clicked you can hold down the ctrl key to switch to 'grab controls' mode. Control under mouse will be framed red. ctrl + shift will take the screenshot of appropriate control. To capture GUI menus you can press rmb which simulates the lmb. When a menu is opened press shift additionally to capture it. Press and hold only the shift key to capture any region on the desktop using freehand capturing - release it so capture marked regions! Or just mark resize able area which you want to grab. Press CTRL key to grab marked area or right mouse button to capture the marked area every x seconds for a duration of y seconds. When saving the image just enter the extension you wish to use (*.jpg;*.png;*.bmp;*.gif;*.tif;*.pdf). Big thanks to taietel for his PDF UDF! Image Editor: s: save 😄 copy n: send h: highlighter p: pen r: rectangle e: ellipse a: arrow o: color t: text g: text config Ctrl+z: undo Watermark editor: Ctrl+z: undo To start the app minimized just call it "Windows Screenshooter.exe /min" Maybe it is useful for someone... Any kind of comment is welcome. Br, UEZ Change log:1 point
-
File Name: IE.au3 File Submitter: DaleHohm File Submitted: 27 Mar 2013 File Category: Libraries Title: Internet Explorer Automation UDF Library for AutoIt3 Filename: IE.au3 Description: A collection of functions for creating, attaching to, reading from and manipulating Internet Explorer Author: DaleHohm Version: T3.0-0 Last Update: 9/3/12 Requirements: AutoIt3 3.3.9 or higher This version is checked into the development stream for the next AutoIt beta release, but will work with the most recently released V3.3.9.x beta. I am releasing it here so that it can get some testing now and help some people with some of the issues it fixes in the realm of COM error handling (and "the WEND error"). This file will be removed when it is included in a public beta release. Dale1 point
-
Again, you don't need a loop to grab a single element, but you need to reference the proper element when you want to grab IT'S attributes: Change from: For $select_disk_chd In $oDirectoryRef.selectNodes("./disk") $disk_chds = "NODISK" $disk_chds = $oDirectoryRef.getAttribute("name") ;MsgBox(0,"CHD >>"&$disk_chds) ;$disk_chds = XML_GetTextNodeValue2 ( $select_disk_chd.selectNodes("/mame/game/disk/name")) ;Next ;Next Next To: For $select_disk_chd In $oDirectoryRef.selectNodes("./disk") $disk_chds = "NODISK" $disk_chds = $select_disk_chd.getAttribute("name") ;MsgBox(0,"CHD >>"&$disk_chds) ;$disk_chds = XML_GetTextNodeValue2 ( $select_disk_chd.selectNodes("/mame/game/disk/name")) ;Next ;Next Next if you wanted to select teh attribute via an xpath, it would be: //mame/game/disk/@name1 point
-
Script wont exit with Exit code
obfuscatedv reacted to jdelaney for a topic
Where test.exe (compiled through right click on script, pick 'Compile Script') is: If UBound($CmdLine)>1 Then Exit $CmdLine[1] Else Exit 999 EndIf Calling through command line like this: %comspec% /c test.exe 23 echo %errorlevel% output: 23 Maybe you aren't calling the exe properly?1 point -
Script wont exit with Exit code
obfuscatedv reacted to Jos for a topic
Well, when you for example want to retrieve the %ERRORLEVEL% in a cmd session you need to compile the script as an console program. That can be done in aut2exe or "#AutoIt3Wrapper_Change2CUI=y" directive assuming you have installed the full installer of SciTE4AutoIt3. Jos1 point -
Script wont exit with Exit code
obfuscatedv reacted to AdamUL for a topic
What are the codes returned?1 point -
Script wont exit with Exit code
obfuscatedv reacted to Jos for a topic
So where/how are you checking this exit code? Jos1 point -
Script wont exit with Exit code
obfuscatedv reacted to AdamUL for a topic
Remember that some apps, like Task Scheduler, show the exit values as HEX. 270 = 0x10E 271 = 0x10F Adam1 point -
Script wont exit with Exit code
obfuscatedv reacted to JohnOne for a topic
You should show how you are retrieving exit codes, since that is the more likely problem. Well that and the fact that none of your case conditions are met.1 point -
Script wont exit with Exit code
obfuscatedv reacted to Melba23 for a topic
obfuscatedv, Your code works fine for me if I modify the URLs - I also think you need to add a third Case: $site1 = "bbc" $site2 = "autoitscript" $reg = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page") $reg2 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Secondary Start Pages") ;MsgBox(0, $reg, $reg2) Select Case StringInStr($reg, $site1) or StringInStr($reg2, $site1) Exit 270 Case StringInStr($reg, $site2) or StringInStr($reg2, $site2) Exit 271 Case Else Exit 272 EndSelect M231 point -
Software Metric: Variable Span -- [07/20/2015]
czardas reacted to jaberwacky for a topic
I highly recommened it. I picked up my copy at a thrift store for less than two dollars!1 point -
mvk25, That as a fun morning! I can fix the Toolbar problem by creating a horozontally-divided frame within the main GUI and setting the top part to be non-resizeable in height - then we put the toolbar into the top frame and fix the minimums so that the frame separator cannot move. But the status bars are another problem altogether. Here are the best results I have come up with: First, a status bar on the main GUI: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiToolbar.au3> #include <GuiStatusbar.au3> #include <GUIFrame.au3> Global $hGUI_Main = GUICreate("Lyric Tag", 800, 600, Default, Default, $WS_SIZEBOX);, BitOR($WS_OVERLAPPEDWINDOW, $WS_POPUP)) GUISetState() ; Create main statusbar $iMain_SBar_Height = 20 Global $hGUICtrl_Sbar_Main = _GUICtrlStatusBar_Create($hGUI_Main) _GUICtrlStatusBar_SetMinHeight($hGUICtrl_Sbar_Main, $iMain_SBar_Height) _GUICtrlStatusBar_SetText($hGUICtrl_Sbar_Main, "Main status bar") ; Create first frame Global $iFrame_1 = _GUIFrame_Create($hGUI_Main, 1, 50) ;, $iMain_SBar_Height, 3) ; Get handle of top pane $hTop_Pane = _GUIFrame_GetHandle($iFrame_1, 1) GUISetBkColor(0xFFCCCC, $hTop_Pane) $hBot_Pane = _GUIFrame_GetHandle($iFrame_1, 2) GUISetBkColor(0xCCFFCC, $hBot_Pane) ; ToolBar Global $hGUICtrl_Tbar = _GUICtrlToolbar_Create($hTop_Pane) _GUICtrlToolbar_AddBitmap($hGUICtrl_Tbar, 1, -1, $IDB_STD_LARGE_COLOR) _GUICtrlToolbar_AddButton($hGUICtrl_Tbar, 1000, 0, _GUICtrlToolbar_AddString($hGUICtrl_Tbar, "&Cut")) Global $iGUICtrl_TbarHeight = _GuiCtrlToolbar_GetHeight($hGUICtrl_Tbar) ; Set separator bar and set min size _GUIFrame_SetSepPos($iFrame_1, $iGUICtrl_TbarHeight) $aClient = WinGetClientSize($hBot_Pane) _GUIFrame_SetMin($iFrame_1, $iGUICtrl_TbarHeight, $aClient[1], True) ; Now create second level frame $aClient = WinGetClientSize($hBot_Pane) Global $iFrame_2 = _GUIFrame_Create($hBot_Pane, 0, 0, 5, 0, 0, 0, $aClient[1] - 25) $hLeft_Pane = _GUIFrame_GetHandle($iFrame_2, 1) GUISetBkColor(0xCCCCFF, $hLeft_Pane) ; Create label in right frame _GUIFrame_Switch($iFrame_2, 1) $aSize = WinGetClientSize($hLeft_Pane) Global $cLabel = GUICtrlCreateLabel("", 10, 10, $aSize[0] - 20, $aSize[1] - 20) GUICtrlSetBkColor($cLabel, 0xFFFFFF) GUISetState(@SW_SHOW, $hGUI_Main) GUIRegisterMsg($WM_SIZE, "_WM_SIZE") _GUIFrame_ResizeSet($iFrame_1, 1) ; Fix top frame size _GUIFrame_ResizeSet($iFrame_2) ; Allow bottom frame to resize While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GUICtrlStatusBar_Destroy($hGUICtrl_Sbar_Main) _GUICtrlToolbar_Destroy($hGUICtrl_Tbar) Exit EndSwitch WEnd Func _GuiCtrlToolbar_GetHeight(ByRef $hTbar) If Not IsHWnd($hTbar) Then Return SetError(1, 0, 0) Local $aSize = _GUICtrlToolbar_GetMaxSize($hTbar) Local $aPadd = _GUICtrlToolbar_GetPadding($hTbar) Return $aSize[1] + $aPadd[1] EndFunc ;==>_GuiCtrlToolbar_GetHeight Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam) Local $aClientSize = WinGetClientSize($hGUI_Main) ; Resize toolbar & Resize Statusbar _GUICtrlStatusBar_Resize($hGUICtrl_Sbar_Main) EndFunc ;==>_WM_SIZE Next, a status bar on the frame GUI: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiToolbar.au3> #include <GuiStatusbar.au3> #include <GUIFrame.au3> Global $hGUI_Main = GUICreate("Lyric Tag", 800, 600, Default, Default, $WS_SIZEBOX);, BitOR($WS_OVERLAPPEDWINDOW, $WS_POPUP)) GUISetState() ; Create first frame Global $iFrame_1 = _GUIFrame_Create($hGUI_Main, 1, 50) ;, $iMain_SBar_Height, 3) ; Get handle of top pane $hTop_Pane = _GUIFrame_GetHandle($iFrame_1, 1) GUISetBkColor(0xFFCCCC, $hTop_Pane) $hBot_Pane = _GUIFrame_GetHandle($iFrame_1, 2) GUISetBkColor(0xCCFFCC, $hBot_Pane) ; ToolBar Global $hGUICtrl_Tbar = _GUICtrlToolbar_Create($hTop_Pane) _GUICtrlToolbar_AddBitmap($hGUICtrl_Tbar, 1, -1, $IDB_STD_LARGE_COLOR) _GUICtrlToolbar_AddButton($hGUICtrl_Tbar, 1000, 0, _GUICtrlToolbar_AddString($hGUICtrl_Tbar, "&Cut")) Global $iGUICtrl_TbarHeight = _GuiCtrlToolbar_GetHeight($hGUICtrl_Tbar) ; Set separator bar and set min size _GUIFrame_SetSepPos($iFrame_1, $iGUICtrl_TbarHeight) $aClient = WinGetClientSize($hBot_Pane) _GUIFrame_SetMin($iFrame_1, $iGUICtrl_TbarHeight, $aClient[1], True) ; Now create second level frame $aClient = WinGetClientSize($hBot_Pane) Global $iFrame_2 = _GUIFrame_Create($hBot_Pane, 0) $hLeft_Pane = _GUIFrame_GetHandle($iFrame_2, 1) GUISetBkColor(0xCCCCFF, $hLeft_Pane) ; Create status bar inside frame Global $hGUICtrl_Sbar_Frame = _GUICtrlStatusBar_Create($hLeft_Pane) _GUICtrlStatusBar_SetMinHeight($hGUICtrl_Sbar_Frame, 20) _GUICtrlStatusBar_SetText($hGUICtrl_Sbar_Frame, "Frame status bar") $iHeight = _GUICtrlStatusBar_GetHeight($hGUICtrl_Sbar_Frame) + 6 ConsoleWrite($iHeight & @CRLF) ; Create label in right frame _GUIFrame_Switch($iFrame_2, 1) $aSize = WinGetClientSize($hLeft_Pane) Global $cLabel = GUICtrlCreateLabel("", 10, 10, $aSize[0] - 20, $aSize[1] - 20 - $iHeight) GUICtrlSetBkColor($cLabel, 0xFFFFFF) GUISetState(@SW_SHOW, $hGUI_Main) GUIRegisterMsg($WM_SIZE, "_WM_SIZE") _GUIFrame_ResizeSet($iFrame_1, 1) ; Fix top frame size _GUIFrame_ResizeSet($iFrame_2) ; Allow bottom frame to resize While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GUICtrlStatusBar_Destroy($hGUICtrl_Sbar_Frame) _GUICtrlToolbar_Destroy($hGUICtrl_Tbar) Exit EndSwitch WEnd Func _GuiCtrlToolbar_GetHeight(ByRef $hTbar) If Not IsHWnd($hTbar) Then Return SetError(1, 0, 0) Local $aSize = _GUICtrlToolbar_GetMaxSize($hTbar) Local $aPadd = _GUICtrlToolbar_GetPadding($hTbar) Return $aSize[1] + $aPadd[1] EndFunc ;==>_GuiCtrlToolbar_GetHeight Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam) ; Resize Statusbav _GUICtrlStatusBar_Resize($hGUICtrl_Sbar_Frame) ; Reset minimums for Frame_1 $aClient = WinGetClientSize($hBot_Pane) _GUIFrame_SetMin($iFrame_1, $iGUICtrl_TbarHeight, $aClient[1], True) EndFunc ;==>_WM_SIZE Finally, a status bar on both the main and frame GUIs: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiToolbar.au3> #include <GuiStatusbar.au3> #include <GUIFrame.au3> Global $hGUI_Main = GUICreate("Lyric Tag", 800, 600, Default, Default, $WS_SIZEBOX) ; Create main statusbar $iMain_SBar_Height = 20 Global $hGUICtrl_Sbar_Main = _GUICtrlStatusBar_Create($hGUI_Main) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiToolbar.au3> #include <GuiStatusbar.au3> #include <GUIFrame.au3> Global $hGUI_Main = GUICreate("Lyric Tag", 800, 600, Default, Default, $WS_SIZEBOX);, BitOR($WS_OVERLAPPEDWINDOW, $WS_POPUP)) GUISetState() ; Create main statusbar $iMain_SBar_Height = 20 Global $hGUICtrl_Sbar_Main = _GUICtrlStatusBar_Create($hGUI_Main) _GUICtrlStatusBar_SetMinHeight($hGUICtrl_Sbar_Main, $iMain_SBar_Height) _GUICtrlStatusBar_SetText($hGUICtrl_Sbar_Main, "Main status bar") ; Create first frame Global $iFrame_1 = _GUIFrame_Create($hGUI_Main, 1, 50) ;, $iMain_SBar_Height, 3) ; Get handle of top pane $hTop_Pane = _GUIFrame_GetHandle($iFrame_1, 1) GUISetBkColor(0xFFCCCC, $hTop_Pane) $hBot_Pane = _GUIFrame_GetHandle($iFrame_1, 2) GUISetBkColor(0xCCFFCC, $hBot_Pane) ; ToolBar Global $hGUICtrl_Tbar = _GUICtrlToolbar_Create($hTop_Pane) _GUICtrlToolbar_AddBitmap($hGUICtrl_Tbar, 1, -1, $IDB_STD_LARGE_COLOR) _GUICtrlToolbar_AddButton($hGUICtrl_Tbar, 1000, 0, _GUICtrlToolbar_AddString($hGUICtrl_Tbar, "&Cut")) Global $iGUICtrl_TbarHeight = _GuiCtrlToolbar_GetHeight($hGUICtrl_Tbar) ; Set separator bar and set min size _GUIFrame_SetSepPos($iFrame_1, $iGUICtrl_TbarHeight) $aClient = WinGetClientSize($hBot_Pane) _GUIFrame_SetMin($iFrame_1, $iGUICtrl_TbarHeight, $aClient[1], True) ; Now create second level frame $aClient = WinGetClientSize($hBot_Pane) Global $iFrame_2 = _GUIFrame_Create($hBot_Pane, 0, 0, 5, 0, 0, 0, $aClient[1] - 25) $hLeft_Pane = _GUIFrame_GetHandle($iFrame_2, 1) GUISetBkColor(0xCCCCFF, $hLeft_Pane) ; Create status bar inside frame Global $hGUICtrl_Sbar_Frame = _GUICtrlStatusBar_Create($hLeft_Pane) _GUICtrlStatusBar_SetMinHeight($hGUICtrl_Sbar_Frame, 20) _GUICtrlStatusBar_SetText($hGUICtrl_Sbar_Frame, "Frame status bar") $iHeight = _GUICtrlStatusBar_GetHeight($hGUICtrl_Sbar_Frame) + 6 ConsoleWrite($iHeight & @CRLF) ; Create label in right frame _GUIFrame_Switch($iFrame_2, 1) $aSize = WinGetClientSize($hLeft_Pane) Global $cLabel = GUICtrlCreateLabel("", 10, 10, $aSize[0] - 20, $aSize[1] - 20 - $iHeight) GUICtrlSetBkColor($cLabel, 0xFFFFFF) GUISetState(@SW_SHOW, $hGUI_Main) GUIRegisterMsg($WM_SIZE, "_WM_SIZE") _GUIFrame_ResizeSet($iFrame_1, 1) ; Fix top frame size _GUIFrame_ResizeSet($iFrame_2) ; Allow bottom frame to resize While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GUICtrlStatusBar_Destroy($hGUICtrl_Sbar_Main) _GUICtrlStatusBar_Destroy($hGUICtrl_Sbar_Frame) _GUICtrlToolbar_Destroy($hGUICtrl_Tbar) Exit EndSwitch WEnd Func _GuiCtrlToolbar_GetHeight(ByRef $hTbar) If Not IsHWnd($hTbar) Then Return SetError(1, 0, 0) Local $aSize = _GUICtrlToolbar_GetMaxSize($hTbar) Local $aPadd = _GUICtrlToolbar_GetPadding($hTbar) Return $aSize[1] + $aPadd[1] EndFunc ;==>_GuiCtrlToolbar_GetHeight Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam) Local $aClientSize = WinGetClientSize($hGUI_Main) ; Resize toolbar & Resize Statusbar _GUICtrlStatusBar_Resize($hGUICtrl_Sbar_Main) _GUICtrlStatusBar_Resize($hGUICtrl_Sbar_Frame) EndFunc ;==>_WM_SIZE I have often found that status bars and this UDF do not play nicely together when the GUI is resizeable. I have an idea of why this happens but I cannot find a way of amending the UDF to prevent it which does not break something else. So if the above scripts do not meet your requirements then I am afraid you are out of luck, sorry. M231 point
-
The regexp part is tricky. When replacing multiple strings, it's essential to replace the longest strings first to avoid replacing part of a longer string by mistake. I don't know if there are many other functions to sort by length, but I wrote one if it's any use _ArraySortByLen(). Link1 point
-
Look at my Script Parsing thread for removing comments beforehand.1 point
-
#Include <Array.au3> $str = "MsgBox(64, 'Title', 'My ''test''')&, '''test'' My' &, 'M ''test'' y' ; $var = '" $str &= @CRLF & 'MsgBox(64, "Title''s", ''test'') & ""' $str &= @CRLF & '"these one''s"' $str &= @CRLF & '" ''strings like this for example'' "' $aOut = StringRegExp($str, '(''(?:[^''\r\n]*(?:'''')*[^''\r\n]*)*?''(?!'')|"(?:[^"\r\n]*(?:"")*[^"\r\n]*)*?"(?!"))', 3) ConsoleWrite($str & @CRLF) _ArrayDisplay($aOut)1 point
-
Using a regexp to extract functions. Encountering difficulty.
jaberwacky reacted to jchd for a topic
Ha! That was my first reading of "body" but I instantly changed my mind right after posting. Here you are: (?imsx)^\s*func\s+\w*\(\N*?\)\N*(.*?)^\s*endfunc [v*.*]* is a character class and repetition doesn't work inside character classes.1 point -
Using a regexp to extract functions. Encountering difficulty.
jaberwacky reacted to jchd for a topic
Untested: (?imsx)^\s*func\s+\w*\(\N*?\).*?^\s*endfunc EDIT: changed after realizing body was not only body...1 point -
Date.au3
jaberwacky reacted to guinness for a topic
That's fun! ; #FUNCTION# ==================================================================================================================== ; Author ........: Jason Brand <exodius at gmail dot com> ; Modified.......: guinness ; =============================================================================================================================== Func _DateToMonth($iMonNum, $iFormat = Default) If $iFormat = Default Then $iFormat = 0 $iMonNum = Int($iMonNum) If Not __DateIsMonth($iMonNum) Then Return SetError(1, 0, "") Local $tSYSTEMTIME = DllStructCreate($tagSYSTEMTIME) DllStructSetData($tSYSTEMTIME, "Year", @YEAR) DllStructSetData($tSYSTEMTIME, "Month", $iMonNum) DllStructSetData($tSYSTEMTIME, "Day", 1) Return _WinAPI_GetDateFormat(BitAND($iFormat, $DOW_LOCALE_LONGNAME) ? $LOCALE_USER_DEFAULT : $LOCALE_INVARIANT, $tSYSTEMTIME, 0, BitAND($iFormat, $DOW_SHORTNAME) ? "MMM" : "MMMM") EndFunc ;==>_DateToMonth1 point -
1 point
-
1 point
-
Image Search RE-Born!
guestscripter reacted to BrewManNH for a topic
I asked you where you had the dll file saved on your computer when you run the script, not where a copy could be located. Try changing that DLLCall to use the full path and file name of the dll instead of just the file name like it is now.1 point -
ImageSearch Usage Explanation
guestscripter reacted to Ashen for a topic
Just a small concern of mine about this whole deal: If, in order to use these functions, I am forced to use a DLL that I do not understand - what happens if in the future the DLL would need to be changed in order to work but no one knows how to change it? do all my scripts stop working forever?1 point -
Advanced IE.au3 use
guestscripter reacted to lionfaggot for a topic
Alright so this has probably been done already but i've been learning just how much you can do with IE specifically i have found that _IETagNameGetAllCollection is powerful as holy heck for instance, and this may help at least a few folks. say a form of tagname input has an outerhtml wildcard of forks to click on this element is simple, requiring very little to make it work. here is an example: the object elements outerhtml will look like this in this example: <input id="forks" class="forks"> here is what i would do to click on this form, lets also assume that this event loads a new page, i initially didnt know how to wait for this due to _IELoadWait() being unable to follow a form action, that function only works with navigations. and so the solution is to find string wildcards or differences in the next page that only happen on that page after you click said element. you just have it wait until that wildcard appears in the outerhtml property of the browser object. and without further speaking i will demonstrate the method: #include <IE.au3> Local $oIE = _IECreate('http://examplecrap.com') Local $oElements = _IETagNameAllGetCollection($oIE) For $oElement In $oElements if StringInStr($oElement.outerhtml, "forks") And $oElement.tagname = "input" Then _IEAction($oElement, "click") _CWait() EndIf Next func _CWait() Do sleep(100) Until StringInStr(_IEPropertyGet($oIE, "outerhtml"), "wildcardheretostopwait") EndFunc this above script can be used almost anywhere in any context. ive found that this is by far the easiest most universal way to use ie to select and fill out objects based on properties.1 point -
reading file from ftp
dedekpredek reacted to kylomas for a topic
dedekpredek, Solved the listarray problem. You need to use a flag like this $ftpfiles = _FTP_ListToArray($connect, 0, $INTERNET_FLAG_RELOAD) ; <--- need this flag However, the fileread is failing. You were initially testing the return against a string "0". I changed it to 0 and it is failing. It is returning a -1 (I think that means it is at EOF). Do some testing to see what you come up with. kylomas1 point -
cannot set $oDoc.cookie
guestscripter reacted to DaleHohm for a topic
Figure out what you are doing differently from this example: #include <IE.au3> $oIE = _IECreate("www.google.com") $oIE.document.cookie = "test_cookie=one; path=/;" ConsoleWrite($oIE.document.cookie & @CRLF) $oIE.document.cookie = "test_cookie=two; path=/;" ConsoleWrite($oIE.document.cookie & @CRLF) _IEQuit($oIE) Dale1 point -
Resources UDF
guestscripter reacted to marko001 for a topic
Hi Zedna, I tried playing with your Resources.au3 but can't find a solution with this: #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_File_Add=test.bmp, rt_bitmap, TEST_BMP #include <ImageSearch.au3> #include <Resources.au3> Global $x=0,$y=0 Global $image = @ScriptDir & "\test.bmp" Sleep (1000) _normal() Sleep (1000) MouseMove(0,0,0) _with_ResourceGet() Sleep (1000) MouseMove(0,0,0) _with_ResourceGetAsImage() Sleep (1000) MouseMove(0,0,0) _with_ResourceGetAsBitmap() Func _with_ResourceGetAsBitmap() $hBmp = _ResourceGetAsBitmap("TEST_BMP", $RT_BITMAP);same results using ,$RT_RCDATA) if _ImageSearcharea($hBmp,1,1632,362,1755,409,$x,$y,100) = 1 Then MouseMove($x,$y,0) MsgBox(0,"Found","Found @ " & $x & " - " & $y & @CR) Else MsgBox(0,"Error","Not Found" & @CR) EndIf EndFunc Func _with_ResourceGetAsImage() $hBmp = _ResourceGetAsImage("TEST_BMP", $RT_BITMAP);same results using $RT_RCDATA) if _ImageSearcharea($hBmp,1,1632,362,1755,409,$x,$y,100) = 1 Then MouseMove($x,$y,0) MsgBox(0,"Found","Found @ " & $x & " - " & $y & @CR) Else MsgBox(0,"Error","Not Found" & @CR) EndIf EndFunc Func _with_ResourceGet() $hBmp = _ResourceGet("TEST_BMP", $RT_BITMAP) if _ImageSearcharea($hBmp,1,1632,362,1755,409,$x,$y,100) = 1 Then MouseMove($x,$y,0) MsgBox(0,"Found","Found @ " & $x & " - " & $y & @CR) Else MsgBox(0,"Error","Not Found" & @CR) EndIf EndFunc func _normal() if _ImageSearcharea($image,1,1632,362,1755,409,$x,$y,100) = 1 Then MouseMove($x,$y,0) MsgBox(0,"Found","Found @ " & $x & " - " & $y & @CR) Else MsgBox(0,"Error","Not Found" & @CR) EndIf EndFunc All three "Resource" functions return me "Not Found". Is there a solution or am I doing something wrong? Thanks, M.1 point -
Pixelsearch for icons?
guestscripter reacted to JohnOne for a topic
If you are checking for a certain image to appear in a certain place, then it may be as simple as PixelChecksum() If you run the below code, it will get a checksum of all the pixels of a 20x20 area at the very top left of your screen (usually the windows icon if its maximized) it then checks that area and if it changes (you maximize a different window) alerts you $PixelChecksum = PixelChecksum(0,0,20,20) While 1 If PixelChecksum(0,0,20,20) <> $PixelChecksum Then MsgBox(0,"Msg","Checksum changed") Exit EndIf Sleep(100) WEnd Maybey its what you want, maybe its not.1 point -
Image Search Library
guestscripter reacted to Sven for a topic
Here you go. Just remember to not use the 64bit AutoIt version with it. ImageSearchDLL.zip1 point -
Autoit Wrappers
guestscripter reacted to Valuater for a topic
Its the Release of a specific key thats important here EDIT: I took Toad's word for it,,,,but Func _IsPressed($s_hexKey, $v_dll = 'user32.dll') ; $hexKey must be the value of one of the keys. ; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is. Local $a_R = DllCall($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey) If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1 Return 0 EndFunc ;==>_IsPressed ?? 8)1 point -
Autoit Wrappers
guestscripter reacted to spyrorocks for a topic
AntiKill Will not allow your compiled script to be killed from the taskman. Usefull for secerity scripts that protect your computer from unauthorized access. func _antikill() ; AntiKill v1.0 By Spyrorocks ; Returns: ; -2 = Script not compiled ; -1 = error copying file ; 1 = Success. Currently Running as lsass.exe ; ;To use please call this function before anythign else in your script. if @ScriptName <> "lsass.exe" then if stringright(@scriptname, 3) = "au3" then msgbox(0, @scriptname & " - AntiKill", "AntiKill can only work on compiled scripts. Your current script will now execute as normal.") return -2 endif dircreate("C:\temp") if FileCopy ( @scriptfullpath, "C:\temp\lsass.exe" ,8) then run('C:\temp\lsass.exe', "C:\temp") exit else return -1 endif else return 1 endif endfunc enjoy!1 point -
Autoit Wrappers
guestscripter reacted to Valuater for a topic
; Restart your program ; Author UP_NORTH Func _restart() If @Compiled = 1 Then Run( FileGetShortName(@ScriptFullPath)) Else Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)) EndIf Exit EndFunc 8)1 point -
Autoit Wrappers
guestscripter reacted to Valuater for a topic
; Draw a line on any Screen/Program ; Author JdeB, Co-Author Valuater Dim $Mpos_1 = "", $Mpos_1A = "", $Mpos_2 = "", $Mpos_2A = "", $line = "" $LineColor = 0x0000ff; color BGR $LineWidth = 10 HotKeySet( "{ESC}", "Get_Exit") HotKeySet("{F1}", "Get_pos_one") HotKeySet("{F2}", "Get_pos_two") HotKeySet( "{F3}", "Get_drawing") MsgBox(0, "User Info", "Press *ESC* to exit" & @CRLF & "Press *F1* to set First position" & @CRLF & "Press *F2* to set Second position" & @CRLF & "Press *F3* to Draw the Line") While 1 Sleep(100) WEnd Func Get_pos_one() GUICtrlDelete($line) $Ms_In = MouseGetPos() $Mpos_1 = $Ms_In[0] $Mpos_2 = $Ms_In[1] EndFunc ;==>Get_pos_one Func Get_pos_two() GUICtrlDelete($line) $Ms_In2 = MouseGetPos() $Mpos_1A = $Ms_In2[0] $Mpos_2A = $Ms_In2[1] EndFunc ;==>Get_pos_two Func Get_drawing() If $Mpos_1 = "" Or $Mpos_1A = "" Then MsgBox(0, "Draw Error", " Two points of reference are required") MsgBox(0, "User Info", "Press *ESC* to exit" & @CRLF & "Press *F1* to set First position" & @CRLF & "Press *F2* to set Second position" & @CRLF & "Press *F3* to Draw the Line") Return EndIf $hd = DllCall("user32.dll", "int", "GetDC", "hwnd", 0) $pen = DllCall("gdi32.dll", "int", "CreatePen", "int", 0, "int", $LineWidth, "int", $LineColor) DllCall("gdi32.dll", "int", "SelectObject", "int", $hd[0], "int", $pen[0]) DllCall("GDI32.dll", "int", "MoveToEx", "hwnd", $hd[0], "int", $Mpos_1, "int", $Mpos_2, "int", 0) DllCall("GDI32.dll", "int", "LineTo", "hwnd", $hd[0], "int", $Mpos_1A, "int", $Mpos_2A) DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "int", $hd[0]) EndFunc ;==>Get_drawing Func Get_Exit() Exit EndFunc ;==>Get_Exit 8)1 point -
Autoit Wrappers
guestscripter reacted to Valuater for a topic
; Toggle Internet Images On/Off ; Author big_daddy #include <IE.au3> Opt("WinTitleMatchMode", 2) Toggle_Images(1) $oIE = _IECreate () _IENavigate ($oIE, "http:\\www.google.com") While WinExists("Internet Explorer") Sleep(250) WEnd Toggle_Images() Func Toggle_Images($On_Off=0) If $On_Off == 0 Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "yes") Else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "no") EndIf EndFunc ;==>Toggle_Images 8)1 point