Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

TrayTip @CRLF

$
0
0

Hello Guys,

i try to make a new line in a TrayTip. I stuck on it, but i know that i have to add @CRLF but i do not know where exactly. Can someone Please make an example script?

Thanks in Advance and sorry for my bad english, i am german  :bye:


Window redraw

$
0
0

Hi All,

 

When I use below script, my window is redrawn from position x to position y, but what I need is the actual window drag from position x to position y. Any better ideas?

Same with WinMove command, windows redraws but doens't do actual drag.

 

 

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
 
Global $hGUI, $idButton, $aMPos
;Creating a window with "Start drag" button
$hGUI = GUICreate("GUI In Drag", 300, 300)
$idButton = GUICtrlCreateButton("START Drag", 50, 50, 200, 200)
GUISetState()
 
;Getting positon of the button
$buttonhwnd = WinGetHandle(ControlGetHandle($hGUI, "", $idButton))
$pos = WinGetPos($buttonhwnd)
 
 
;Move mouse on top of Start Drag button
Sleep(5000)
MouseClickDrag("left", $pos[0] + 100, $pos[1] - 60, 600, 700)

Button not working when clicked again.

$
0
0

Hi everyone,

 

Hope you're fine today :)

 

I'm facing a little issue. I'm sure this might be nothing for you but I can't figure it out by myself. 

 

Here's the code (not written by me, credits to supdw2k for this huge help ^^):

AutoIt         
#include <Array.au3> #include <ButtonConstants.au3> #include <ColorConstants.au3> #include <ComboConstants.au3> #Include <Constants.au3> #include <Crypt.au3> #include <Date.au3> #include <File.au3> #Include <FontConstants.au3> #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <GuiListView.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiButton.au3> Global $Images = "C:\Windows\ATL_Laptop\Resources\Images\" Opt("GUIOnEventMode", 1) Global Const $sINIFile = "test.ini" Global $aCheckboxes ManualActions() Func ManualActions()     Global $ManualActionsGui = GuiCreate("Automated Task List Suite", 460, 480, -1, -1)      GUISetBkColor (0xFFFFFF)     GUICtrlCreatePic ($Images & "\SAClogo.jpg", 110, 10, 240, 80)     GUICtrlCreateLabel ("---MANUAL ACTIONS---" , 173, 100, 300, -1)     GUICtrlSetFont (-1, 8.5, 700, 0)     Local $ResetAll = GuiCtrlCreateButton ("Reset Everything",  10 , 440, 97,  30)     Local $SaveAndQuit = GUICtrlCreateButton ("Save and Quit", 360, 440, 97, 30)     Local $iX = 10, $iY = 120     $aCheckboxes = _ReadINI()     For $x = 0 To UBound($aCheckboxes) - 1         Local $idCheckBox = _CreateCheckbox($aCheckboxes[$x][0], $iX, $iY)         If _Crypt_HashData($aCheckboxes[$x][0] & "|" & $sINIFile & "|" & $GUI_CHECKED, $CALG_MD5) = $aCheckboxes[$x][1] Then             GUICtrlSetState(-1, BitOR($GUI_CHECKED, $GUI_DISABLE))         EndIf         $aCheckboxes[$x][0] = $idCheckBox         $iY += 20     Next         GUISetOnEvent ($GUI_EVENT_CLOSE, "_Exit", $ManualActionsGui)     GUICtrlSetOnEvent ($ResetAll, "_ResetAll")         GUICtrlSetOnEvent ($SaveAndQuit , "_Exit")     GUISetState()     While 1 Sleep(10)  WEnd EndFunc   ;==>GenGUI Func _ResetAll() GUIDelete ($ManualActionsGui) FileDelete ($sINIFile) ManualActions() EndFunc Func _Checked()     If GUICtrlRead(@GUI_CtrlId) = 1 Then GUICtrlSetState(@GUI_CtrlId, $GUI_DISABLE) EndFunc   ;==>_Checked Func _CreateCheckbox($sLabel, $iX, $iY)     Local $idCheckBox = GUICtrlCreateCheckbox($sLabel, $iX, $iY, -1, -1)     GUICtrlSetOnEvent(-1, "_Checked")     Return $idCheckBox EndFunc   ;==>_CreateCheckbox Func _Exit()     _WriteINI()     Exit EndFunc   ;==>_Exit Func _GenINIFile()  Local $aCheckboxes[14] = ["Put a label with hostname on the computer?", "Check if AHCI is set in the BIOS", "Add all applications in AD?", "Check the installed drivers?", "Customize all desktop icons?", _    "Restore User's data?", "Connect to the VPN once?", "Update Firefox and Google Chrome ?", "Restore user's Bookmarks?", "Deploy CrashPlanPro, remove new licence and send a mail to the Service Desk?", _    "Check if printers the User needs are present?", "Copy SAPlogin.ini from former Computer (if needed)?", "Encrypt the Disk with PGP?", "Update Remedy database?"]     FileClose(FileOpen($sINIFile, 2))     For $x = 0 To UBound($aCheckboxes) - 1         IniWrite($sINIFile, "Checkbox_Labels", $x, $aCheckboxes[$x])         IniWrite($sINIFile, "Checkbox_States", $x, "")     Next EndFunc   ;==>_GenINIFile Func _ReadINI()     If Not FileExists($sINIFile) Then _GenINIFile()     Local $aCheckbox_Labels = IniReadSection($sINIFile, "Checkbox_Labels")     If @error Then Return SetError(1, 0, 0) ;If INIReadSection Failed Set Error = 1     Local $aCheckbox_States = IniReadSection($sINIFile, "Checkbox_States")     If @error Then Return SetError(2, 0, 0) ;If INIReadSection Failed Set Error = 2     Local $aCheckboxes[$aCheckbox_Labels[0][0]][2]     For $x = 0 To ($aCheckbox_Labels[0][0] - 1)         $aCheckboxes[$x][0] = $aCheckbox_Labels[$x + 1][1]         $aCheckboxes[$x][1] = $aCheckbox_States[$x + 1][1]     Next     Return $aCheckboxes EndFunc   ;==>_ReadINI Func _WriteINI()     For $x = 0 To UBound($aCheckboxes) - 1         IniWrite($sINIFile, "Checkbox_Labels", $x, GUICtrlRead($aCheckboxes[$x][0], 1))         IniWrite($sINIFile, "Checkbox_States", $x, _Crypt_HashData(GUICtrlRead($aCheckboxes[$x][0], 1) & "|" & $sINIFile & "|" & GUICtrlRead($aCheckboxes[$x][0]), $CALG_MD5))     Next EndFunc   ;==>_WriteINI    

When ran the first time, my buttons are working. But as soon as the Gui is recreated, thzy are not working anymore. 

I think the came from the _ResetAll function but for me, this should work.

 

I don't know what I'm missing there and I hope you can give me a hand on this  :sweating:

 

Thanks in advance :)

Hide .exe

$
0
0

Hey im new here sorry if this is in the wrong place or has already been spoken about.

 

im trying to run a .exe but would like it hidden in the background. 

 

i have done this but no luck;

 

$var = MsgBox(4, "TRICKY", "Welcome to TRICKY, Would you like to INSTALL now?")
 
If $var = 6 Then
run ("c:\Users\Tricky\Desktop\GUI\Installation\Setup Factory Runtime-FILES\ProgramFilesFolder\x.exe", @SW_HIDE)
EndIf
If $var = 7 Then
MsgBox(0, "NO", "NO")
EndIf
 
any help would be good thanks

 

RichieRich88

Issue with While Loop

$
0
0

Ok sorry if this counts as a Re-Post. I posted the question in my original thread but have not gotten any feedback, figured I would phrase it a little differently.

 

So, I have a full-screen (Static Dimensions for my screen) pop-up window activated by a button. Using WinSetTrans and a While loop when the window is called via the button I want it to fade in. ESC is set as a hotkey to exit the window and fade out and then deleting the GUI window and controls.

 

My issue is that on the machine that I am scripting on, it works beautifully. While on other systems with different specs it will close faster or slower by a huge margin.

 

Is there a way to have a constant fade speed regardless of the CPU processing?

 

Here is a snippet (sorry if my code is still messy looking, still working on etiquette lol):

AutoIt         
  1. Func PopJobForm()
  2. global $BG = GUICreate("Job Forms", 1440, 900, -1, -1, BitOR($WS_SYSMENU,$WS_POPUP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
  3. global $Main_Gui = GUICreate("", 1440, 900, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
  4. global $G = GUICtrlCreateLabel("Press ESC to Close", 1140, 12, 288, 36, $SS_CENTER)
  5. global $GUIActiveX = GUICtrlCreateObj ($oIE, 35, 75, 1360, 768)
  6. local $oIE = ObjCreate("Shell.Explorer.2")
  7. $oIE.navigate("http://coin/sites/west/CentralDivision/WIFulfillCenter/Lists/SRO%20Filler%20Work/AllItems.aspx")
  8. HotKeySet("{ESC}", "QuitPop")
  9.  
  10.  
  11. $n = 0
  12. $way = 0
  13.    WinSetTrans($Main_Gui,"",0)
  14.         WinSetTrans("Job Forms","",$n)
  15.         if $n <= 35 then
  16.             $n = $n + .05
  17.         ElseIf $n > 35 And $n < 75 Then
  18.             $n = $n + .1
  19.         ElseIf $n > 75  And $n < 120 Then
  20.             $n = $n + .2
  21.         ElseIf $n > 120 And $n < 195 Then
  22.             $n = $n + .3
  23.          ElseIf $n > 195 AND $Way = 0 And $n < 250 Then
  24.             $Way = 2
  25.             _ShowBrowser($Way)
  26.          EndIf
  27. QuitPop()
  28.  
  29. Func _ShowBrowser($oNF)
  30.    GUISetControlsVisible($Main_Gui)
  31.    GUISetState(@SW_SHOW,$Main_Gui)
  32.    If $oNF = 2 Then
  33.    Local $z = 0
  34.    While 1
  35.         WinSetTrans($Main_Gui,"",$z)
  36.         if $z <= 35 then
  37.             $z = $z + .4
  38.         ElseIf $z > 35 And $z < 75 Then
  39.             $z = $z + 1
  40.         ElseIf $z > 75  And $z < 120 Then
  41.             $z = $z + 2
  42.         ElseIf $z > 120 And $z < 195 Then
  43.             $z = $z + 3
  44.          ElseIf $z > 195 and $z < 250 Then
  45.             WinSetTrans($Main_Gui,"",255)
  46.             ExitLoop
  47.         EndIf
  48.      WEnd
  49.     EndIf
  50.  
  51.  
  52. Func QuitPop()
  53.    $n = 196
  54.  
  55.    While 1
  56.       if $n <=  1 then
  57.          $n = $n - .3
  58.          exitloop
  59.       ElseIf $n < 75 Then
  60.          $n = $n - .1
  61.       ElseIf $n < 300 and $n > 75 Then
  62.          $n = $n - .05
  63.       EndIf
  64.       WinSetTrans($Main_Gui,"",$n)
  65.       WinSetTrans($BG,"",$n)
  66.    HotKeySet("{ESC}")
  67.    GUIDelete( $GUIActiveX )
  68.    GUIDelete( $Main_Gui )
  69.    GUIDelete( $BG )

Chrome text search

$
0
0

Hi,

I'm new here

I hope you can help me with my problem

 

I want to make a simple tool with "InputBox" to check "url" in Google chrome and search for a text and if it finds it, it shows MsgBox

 

extract icon from .exe and draw it

$
0
0

I'm new to AutoIt. So thanks for any help. Is there a simple way to extract an icon from an .exe file and then draw it in my main window?

This is the code so far (out of the greater context and broken down to the main problem)

AutoIt         
  1. #include <WindowsConstants.au3>
  2. #include <GUIConstantsEx.au3>
  3. #include <WinAPIShellEx.au3>
  4. #include <WinAPI.au3>
  5.  
  6. Global Const $iGlobalWindowWidth = 840
  7. Global Const $iGlobalWindowHeigth = 525
  8.  
  9. Global Const $cWhite = 0xFFFFFF
  10.  
  11. Local $hGlobalWindow = GUICreate ( "Test", $iGlobalWindowWidth, $iGlobalWindowHeigth)
  12. GUISetBkColor ( $cWhite )
  13.  
  14. $hIcon = _WinAPI_ShellExtractIcon(@systemdir & "\notepad.exe" , 0, 32, 32)
  15. $hDC = _WinAPI_GetDC( $hGlobalWindow )
  16. _WinAPI_DrawIconEx($hDC, 100, 100, $hIcon, 20, 20)    ; That function doesn't work like I want.
  17.  
  18. GUISetState ( @SW_SHOW, $hGlobalWindow )
  19.  
  20.     Case $GUI_EVENT_CLOSE
  21.             _Exit()
  22.     EndSwitch
  23.  
  24. Func _Exit()
  25.     _WinAPI_ReleaseDC($hGlobalWindow, $hDC)
  26.     _WinAPI_DestroyIcon($hIcon)
  27.     Exit
  28. EndFunc   ;==>_Exit

In the end I want to extract the largest icon with the highest resolution out of the exe and draw it 20 x 20 pixel in something with a handle return. GuiCtrlCreateIcon would have been great because of its simple structure but if there's something similar I won't bother. I found nothing yet so perhaps someone had a similar problem in the past and can help me out?

Get android devices hostname in a lan network

$
0
0

Hi again :)
 
How can I get android devices names connected to a network? using _TCPIpToName() it throws the error 11004
 

WSANO_DATA 11004

 

Valid name, no data record of requested type.

The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. The usual example for this is a host name-to-address translation attempt (using gethostbyname orWSAAsyncGetHostByName) which uses the DNS (Domain Name Server). An MX record is returned but no A record—indicating the host itself exists, but is not directly reachable.


dns gives me this

 

F6uT3BN.png

 

My router can retrieve the phone name, so is not impossible, but don't know how he does it :|

 

This java command InetAddress.getByName(IpAddres).getHostName() returns IpAddres, no big help


reading From the last

$
0
0

Hi 

 

I try to make script like this 

 

$script = "12345"

 

msgbox(0, "Hi", $script)

 

but I want script reading $script From the last 

 

so the problem i want msgbox give me :

 

$b = 54321

Using relative to move in circle?

$
0
0

This is probably going to sound confusing, but I was just thinkin about REG and mouse pos and stuff and I was wondering if you could manipulate them with autoit to make x + 1 or y + 1  (your original coords are (2,4) then to (3,5) after x + 1 or y + 2) and it turns out you could and i was really interested with it because upon just thinking about it i was wondering how one would go about moving the mouse in a circle... just increasing/decreasing x or y. I would figure this would be difficult, right?

Here is the function : 

Func _MouseMoveRelative ($iX, $iY) RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse","MouseSpeed","REG_SZ",0) RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse","MouseSensitivity","REG_SZ",10)     Local Const $MOUSEEVENTF_MOVE = 0x01     DllCall ("user32.dll", "int", "mouse_event", _                                 "int", $MOUSEEVENTF_MOVE, _                                 "int", $iX, _                                 "int", $iY, _                                 "int", 0, _                                 "int", 0) RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse","MouseSpeed","REG_SZ",1) RegWrite("HKEY_CURRENT_USER\Control Panel\Mouse","MouseSensitivity","REG_SZ",20) EndFunc

I'm such a freak c:

RANDOM

$
0
0

hi leute. Hoffe jemand von euch spricht Deutsch und kann mir helfen.

 

ich versteh das mit dem RANDOM nicht. Möche mein Script gerne so programieren dass er einen zufalsbuchstabe/Zahl eingibt. DAS MÖCHTE ICH ABER NICHT in einer msgbox sondern einfach als eingabe :thumbsup: . Gibt es kein kommando? kann mir jemand das vlt schreiben so dass ich einfach coppy + pasten kann? welche buchstaben oder zahlen sind mir egal... einfach alle die auf meiner tastatur sind und keine zeichen bitte lol. Hoffe ihr könnt mir helfen und warte spannend auf eine antwort. :shifty:  danke schon mal im vorraus

Is it possible to press a button and delay part of its actions?

$
0
0

Ok im trying on a gui that i need to disable the button to stop multi press and continue on with the button commands that it has to perform

then after 30 secs i want the button to come alive again

 

Ive made an example with sleep but it holds the processes i want to run as well

Is there a way to set a timer? or something that doesnt hold the shellexecute?

 

I cant put the shellexecute at the top button kill must be first as the real gui has long process to do and double press would happen again buythe time it got to the kill button

AutoIt         
#include <GUIConstantsEx.au3> #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 Example() Func Example()     ; Create a GUI with various controls.     Local $hGUI = GUICreate("Example")     Local $idOK = GUICtrlCreateButton("OK", 200, 200, 85, 25)     ; Display the GUI.     GUISetState(@SW_SHOW, $hGUI)     ; Loop until the user exits.     While 1         Switch GUIGetMsg()             Case $GUI_EVENT_CLOSE                 ExitLoop         Case $idOK             _ButtonDelay($idOK) ; now trying like this but it holds the shellexecute as well ;~          GUICtrlSetState($idOK, $GUI_DISABLE) ; was disabling like this <<<<             ShellExecute('ncpa.cpl') ;but i dont want this to wait 30 secs before it works, it cant be at the top as i have really complicated ones         EndSwitch     WEnd     ; Delete the previous GUI and all controls.     GUIDelete($hGUI) EndFunc   ;==>Example Func _ButtonDelay($button)     GUICtrlSetState($button, $GUI_DISABLE)     Sleep(3000) ;<<<< need something better than this that doesnt halt the processes     GUICtrlSetState($button, $GUI_ENABLE) EndFunc

If i havent explained myself correctly just ask for another try

How to wait some time after event in IE?

$
0
0

I need function to wait some time after "onselectstart event and then succesfully return without doing anything - to not disturb process of selection

_IEHeadInsertEventScript($oIE, "document", "onselectstart", "document.setTimeout( , 3333); return true")

but this do not wait - is there is "sleep(timeout)" equivalent in java script?

How to find the max number of data filled cell in excel

$
0
0

Hi all,

I want to use _Excel_RangeRead function inside a loop, but how to know the maximum number of the cell  which contained data.So that i can start looping like this "For $i = 2 to Upper number"

 

Hide all controls in GUI

$
0
0

Hello, I am trying to hide all the controls in my GUI. Is it possible to do an easier way than to use GUICtrlSetState on every single Control I have?


send key

$
0
0

hi my friends

 

I want to make script Pressing the buttons ctrl + maj + k

 

kbkoreanblack.jpg

 

 

 

 

 

 

Pressing the buttons at the same time

 

I tried to do it

 

Send("{LCTRL}")
Send("{LSHIFT}")
Send("{k}")
 
i think its Not like that !

how to see what lies behind a window? (magnifier problem)

$
0
0

I'm again on a script that simulates a lens on the screen, here my previous effort that works quite well but only in one mode, that is: it magnifies the area around the mouse while you move it and it shows the zoomed area into the "lens" window that stays somewhere on the screen.

In the new mode that I would like to achieve, should be magnifyed the area that lies behind the "lens" window and when you move that window it should magnify what's behind it.
Unfortunately here arises the problem, the magnifier magnifies itself recursively, (because it capture the surface of the "lens" itself and not what's behind) with the unwanted result of a zoom area that seems empty.

To see the unwanted effect, just change the value of the variable $bFollowMouse from True to False anf then move the "magnifier" window around.

(the problem is that the function _ScreenCapture_Capture() should be able to capture behind a window)

(I wish the function _ScreenCapture_Capture() where able to capture behind a window)

My question is:
Is there a way to read the content that lies behind the "lens" window? (hopefully avoiding ways like turn off the "lens" windows, make the SnapShot of what's behind, and turn on the "lens" window again, that should result in an ugly flickering effect)

any advise is welcome,
thanks

 

Here the listing:

AutoIt         
#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> Global Const $iWidth = 400, $iHeight = 200 ; lens (window) dimensions Global $iMagnify = 5 ; zoom factor Global $bCaptureCursor = False ; If True the cursor will be captured with the image Global $bFollowMouse = True ; If true,  magnifies at mouse position by following it ;                             If false, magnifies portion of screen behind lens (behind the window) ; Global $g_hGUI, $g_hGfxCtxt, $g_hBitmap, $g_hGraphics Global $aLensDim[2], $aViewFinder[2], $CaptureX = $iWidth / ($iMagnify * 2), $CaptureY = $iHeight / ($iMagnify * 2) Example() Func Example()     AutoItSetOption("GUIOnEventMode", 1)     _GDIPlus_Startup() ;initialize GDI+     $g_hGUI = GUICreate("Magnifier", $iWidth, $iHeight, -1, -1, -1, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)     $aLensDim = WinGetClientSize($g_hGUI)     $idPic = GUICtrlCreatePic("", 0, 0, $aLensDim[0], $aLensDim[1], -1, $GUI_WS_EX_PARENTDRAG) ; jast as background to allow drag by client area     GUISetState(@SW_SHOW)     ;create buffered graphics frame set for smoother gfx object movements     $g_hGraphics = _GDIPlus_GraphicsCreateFromHWND($g_hGUI) ;create a graphics object from a window handle     $g_hBitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $g_hGraphics)     $g_hGfxCtxt = _GDIPlus_ImageGetGraphicsContext($g_hBitmap)     GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")     Local $g_hBitmap2 = 0     Do         $g_hBitmap2 = SnapShot()         _GDIPlus_GraphicsClear($g_hGfxCtxt, 0xFF000000) ;clear bitmap for repaint         _GDIPlus_GraphicsDrawImage($g_hGfxCtxt, $g_hBitmap2, 0, 0) ;draw bitmap to backbuffer         _GDIPlus_GraphicsDrawImageRect($g_hGraphics, $g_hBitmap, 0, 0, $iWidth, $iHeight) ;copy drawn bitmap to graphics handle (GUI)         _GDIPlus_BitmapDispose($g_hBitmap2)     Until Not Sleep(10) ;sleep 10 ms to avoid high cpu usage EndFunc   ;==>Example Func SnapShot()     If $bFollowMouse Then ; take snapshot around the mouse         $aViewFinder = MouseGetPos()     Else ; take the snapshot behind the "lens"  <-------------- this will capture the surface of the lens not what's behind <-----------------         $aViewFinder = _WinAPI_GetClientScreenPos($g_hGUI)         $aViewFinder[0] = $aViewFinder[0] + ($aLensDim[0] / 2)         $aViewFinder[1] = $aViewFinder[1] + ($aLensDim[1] / 2)     EndIf     ; Capture region (at mouse position or behind the lens)     $hHBITMAP = _ScreenCapture_Capture("", $aViewFinder[0] - $CaptureX, $aViewFinder[1] - $CaptureY, $aViewFinder[0] + $CaptureX, $aViewFinder[1] + $CaptureY, $bCaptureCursor)     ; http://www.autoitscript.com/forum/topic/130856-enlargezoom-image-after-screencapture/?p=910694     ; Create a Bitmap object from the bitmap handle     $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hHBITMAP)     ; Dispose of the original capture since we now have a bitmap image we can use with GDIPlus.     _WinAPI_DeleteObject($hHBITMAP)     ; Get the graphics context of the bitmap image.     $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)     ; Creates a new Bitmap object based on the Graphic object with a new width and height.     $hHBITMAP = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphic)     ; Dispose of the Graphic context now we have a newly sized bitmap image as a canvas.     _GDIPlus_GraphicsDispose($hGraphic)     ; Get the graphics context of the newly sized bitmap image     $hGraphic = _GDIPlus_ImageGetGraphicsContext($hHBITMAP)     ; Draw the original image onto the newly sized image.     _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iWidth, $iHeight) ; 200, 200)     ; Dispose of the Graphic context now we have drawn the original image to it.     _GDIPlus_GraphicsDispose($hGraphic)     ; Dispose of the original image.     _GDIPlus_ImageDispose($hImage)     Return ($hHBITMAP) EndFunc   ;==>SnapShot Func _Exit()     ;cleanup GDI+ resources     _GDIPlus_GraphicsDispose($g_hGfxCtxt)     _GDIPlus_GraphicsDispose($g_hGraphics)     _GDIPlus_BitmapDispose($g_hBitmap)     _GDIPlus_Shutdown()     GUIDelete($g_hGUI)     Exit EndFunc   ;==>_Exit ; #FUNCTION# ==================================================================================================================== ; http://www.autoitscript.com/forum/topic/107966-window-space-position-size/?p=761415 ; Name...........: _WinAPI_GetClientScreenPos ; Description ...: Returns the onscreen x y of a client area of a window. ; Syntax.........: _WinAPI_GetClientScreenPos($hWindow) ; Parameters ....: $hWindow     - Identifies an open handle to a window ; Return values .: Success       - Array ;                   [0] x ;                   [2] y ;                  Failure       - False ; Author ........: Nemcija ; Remarks .......: For minimized windows values wouldn't be correct! ; Related .......: _WinAPI_GetClientRect ; =============================================================================================================================== Func _WinAPI_GetClientScreenPos($hWindow)     Local $tLocalClientRect, $tPoint, $aiReturnValue[2]     $tLocalClientRect = _WinAPI_GetClientRect($hWindow)     If @error Then Return SetError(@error, @extended, False)     $tPoint = DllStructCreate("int X;int Y")     DllStructSetData($tPoint, "X", DllStructGetData($tLocalClientRect, "Left"))     DllStructSetData($tPoint, "Y", DllStructGetData($tLocalClientRect, "Top"))     _WinAPI_ClientToScreen($hWindow, $tPoint)     If @error Then Return SetError(@error, @extended, False)     $aiReturnValue[0] = DllStructGetData($tPoint, "X")     $aiReturnValue[1] = DllStructGetData($tPoint, "Y")     Return $aiReturnValue EndFunc   ;==>_WinAPI_GetClientScreenPos

AautoIt login bot unknown error

$
0
0

Hello, I'm making the autoit login bot program and I have this error that when I input a username and pass into input box on browser it inputs only number 4, idk why it does not display any error...  :ermm:

 

Here is my script:

AutoIt         
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> $Form1 = GUICreate("Travian Bot", 285, 140, 460, 226) $G_Login = GUICtrlCreateGroup("Login", 8, 8, 273, 129) $id_uname = GUICtrlCreateInput("Username", 16, 24, 257, 21) $id_pass = GUICtrlCreateInput("Password", 16, 56, 257, 21) $b_login = GUICtrlCreateButton("Login", 16, 88, 257, 41) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $b_login     Global $iOE = _IECreate("http://ts1.travian.com/")     Local $Username = _IEGetObjByName ($iOE, "name")     Local $Password = _IEGetObjByName ($iOE, "password")     Local $Button = _IEGetObjByName ($iOE, "s1")     _IEFormElementSetValue ($Username, "" & $id_uname)     _IEFormElementSetValue ($Password, "" & $id_pass)     _IEAction ($Button, "Click")     EndSwitch  WEnd

AutoIt Unknown Error

webcam capture scripts .

$
0
0

hello everyone im new here  and i have a question 

does anyone here know any script to capture webcam photos and save them secretly to a path ? 

thank you 

Viewing all 12506 articles
Browse latest View live