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
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
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.
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 ^^):
#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
Thanks in advance
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;
RichieRich88
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):
$oIE.navigate("http://coin/sites/west/CentralDivision/WIFulfillCenter/Lists/SRO%20Filler%20Work/AllItems.aspx") $n = 0 $way = 0 $n = $n + .05 $n = $n + .1 $n = $n + .2 $n = $n + .3 $Way = 2 _ShowBrowser($Way) QuitPop() GUISetControlsVisible($Main_Gui) While 1 $z = $z + .4 $z = $z + 1 $z = $z + 2 $z = $z + 3 $n = 196 While 1 $n = $n - .3 $n = $n - .1 $n = $n - .05
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
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)
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?
Hi again :)
How can I get android devices names connected to a network? using _TCPIpToName() it throws the error 11004
WSANO_DATA 11004Valid 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
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
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
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:
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 . 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.
danke schon mal im vorraus
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
#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
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?
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"
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?
hi my friends
I want to make script Pressing the buttons ctrl + maj + k
Pressing the buttons at the same time
I tried to do it
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:
#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
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...
Here is my script:
#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
I don't understand how to make this work??
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")
$id_uname and $id_pass are input boxes, and can somebody explain to me how to do return value func becouse I'm new??
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