Monamo
Active Members-
Posts
470 -
Joined
-
Last visited
-
Days Won
1
Monamo last won the day on November 1 2011
Monamo had the most liked content!
About Monamo
- Birthday 09/03/1974
Profile Information
-
Member Title
Sushi
-
Location
U.S.
Recent Profile Visitors
512 profile views
Monamo's Achievements
Universalist (7/7)
4
Reputation
-
GoogleGonnaSaveUs reacted to a post in a topic:
Incrementing variable
-
SorryButImaNewbie reacted to a post in a topic:
Script to list current windows
-
DucViet321 reacted to a post in a topic:
Setting the selection color of a listview
-
anandchakru reacted to a post in a topic:
Detect Locking and Unlocking of a PC
-
Simple Script with HotKeySet doesn't work
Monamo replied to foxnbk's topic in AutoIt General Help and Support
Based on your wording, I assume this is the full content of your script. If that's the case, then basically what you need to do is to include some form of loop to keep the script active while it's waiting for input (in the form of your hotkey). Give this a shot (press ESC to exit the script): HotKeySet("{F4}", "StartProg") HotKeySet("{ESC}","_ExitIt") While 1 Sleep(10) Wend Func _ExitIt() Exit() EndFunc Func StartProg() Sleep (100) MouseClick ("left", 569, 728) Sleep (100) MouseClick ("left", 607, 732) Sleep (100) MouseClick ("left", 469, 658) Sleep (100) EndFunc -
Looks like it's just going for one pass too many in your For... loop. Try changing that line to: For $i1=1 To (UBound($get_dirs)-1)
-
Just added $ before new_docent. that's where I think the error is since you say that the value for $new_docent30 = GUICtrlRead($docent30) Not in this case. You wouldn't insert the $ manually as Eval() will, well, evaluate the data and interpret it as a variable after processing the string data.i.e., Eval("firststring" & "secondstring") would be interpreted as $firststringsecondstring
-
Change your style entry to: BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL)
-
The issue was because the script was written based upon AutoIt v3.2.10.0 (as noted in the original post). There were code changes made in subsequent releases that caused other #include entries to be required. The code in the original post has been updated to support AutoIt v3.3.0.0. Enjoy!
-
When you put the opening and closing tags for your function, do you actually call the function in your code separately? That is... test() Func test() ; code block EndFunc
-
Current Build: v1.2 (27 FEB 2009) I've had to go through hoops too many times trying to track down the originating process when a random notification/dialog pops up on my system. I wrote the following as a quick way to trace them. Running the script provides you with a small GUI that contains a combobox of visible windows. Selecting a window from the list will provide a messagebox with process information (process executable, file location, PID) and will open the containing folder in Windows Explorer. If it's of use to you, have at it. Otherwise, thanks for taking a look. Comments welcome. Version History: v1.0 (26 FEB 2009) :Note:Codebase is for AutoIt 3.2.10.0 (still at this build by work mandate), so those running the later builds will have to account for the replacement of the GUIConstants.au3 reference with GUIConstantsEx.au3 and possible others. v1.2 (27 FEB 2009) : Codebase updated to function with AutoIt v3.3.0.0 (Yay for VMWare) Window_Tracer_v1_2.au3 Edit: code update
-
Does the folder "World of Warcraft" already exist on your desktop? Based upon your sample default data, it would try to drop the file into a resulting path of: C:\Users\Ashley\Desktop\World of Warcraft\BackgroundDownloader.exe I don't see any checks for an appropriate folder structure before attempting to drop the file - if that destination folder doesn't exist, you're gonna come up short.
-
There have been changes made to the language since this was first posted (note that the post is from 2005). I didn't dig too deeply, but here's the code with a couple quick modifications to allow it to function with AutoIt v3.3.0.0 (not thoroughly tested, but I leave the rest to you for implementation for your usage): CODE#cs Admin_Popup Show computer information or launch shell when hotkey is pressed -John Taylor May-24-2005 - code modifications added to allow functionality with AutoIt v3.3.0.0 on 05 FEB 2009 #ce #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> #NoTrayIcon Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) ;Opt ("RunErrorsFatal", 0 ) - parameter no longer valid as of release 3.2.12.0 Dim $Info_Title = "System Info" Dim $Shell_Title = "Run Shell" Dim $UsernameID Dim $PasswordID Dim $Shell_Win Dim $_In_Shell = 0 HotKeySet("^!~", "OnInfo") ; control alt ~ HotKeySet("+^!{TAB}", "OnShell") ; shift control alt tab While 1 Sleep(1000) WEnd Func OnShell() Dim $SubmitID $_In_Shell = 1 $Shell_Win = GUICreate($Shell_Title, 270, 150) GUISetState() GUICtrlCreateLabel("Username:", 10, 30) $UsernameID = GUICtrlCreateInput("Administrator", 65, 30, 120) GUICtrlCreateLabel("Password:", 10, 60) $PasswordID = GUICtrlCreateInput("", 65, 60, 120, -1, $ES_PASSWORD) $SubmitID = GUICtrlCreateButton("Submit", 10, 90,50,20,$BS_DEFPUSHBUTTON ) GUICtrlSetOnEvent($SubmitID, "onsubmit") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") ControlFocus($Shell_Title, "", $PasswordID) While 1 = $_In_Shell Sleep(1000) WEnd EndFunc ;==>OnShell Func onsubmit() Dim $u, $p $u = GUICtrlRead($UsernameID) $p = GUICtrlRead($PasswordID) RunAs($u,"",$p,1,@ComSpec,"C:\") If @error Then MsgBox(16,"Error","Unable to launch Command Prompt. Please verify the credentials used.") EndIf ;RunAsSet($u, "", $p, 1) ;Run(@ComSpec, "C:\") OnExit() EndFunc ;==>onsubmit Func OnExit() $_In_Shell = 0 ;MsgBox(0,"Debug","starting OnExit()") GUIDelete($Shell_Win) EndFunc ;==>OnExit Func OnInfo() Dim $data[15] Dim $i = 0 Dim $output = "" $data[1] = "Computer name: " & @ComputerName $data[2] = "User name:" & @UserName $data[3] = "---------------------------------------" $data[4] = "1st IP: " & @IPAddress1 $data[5] = "2nd IP: " & @IPAddress2 $data[6] = "---------------------------------------" $data[7] = "OS: " & @OSVersion & " " & @OSServicePack For $i = 1 To 7 $output = $output & $data[$i] & @CR Next MsgBox(0, $Info_Title, $output, 7) EndFunc ;==>OnInfo ; end of script
-
What email client are you using?
-
For those that typically have "Hide file extensions for known file types" disabled in Windows XP, it's an annoyance (at least for me) that using the Windows hotkey "F2" to rename files manually causes you to have to take care to avoid clearing the file extension. Lifehacker had an AHK script (they're big on AHK) to address this, and I've converted it to AutoIt for those that might want to use it. My recommendation would be to include it inside of any "persistent" scripts that you have running all the time (say, inside of a system monitoring script, whatever) since it seems kind of excessive to have a compiled version of this running standalone. Unless, of course, you don't have any other "always on" scripts. Hope it's of use to some of you out there. HotKeySet("{F2}", "_AnalyzeRename") While 1 Sleep(10) WEnd Func _AnalyzeRename() HotKeySet("{F2}"); prevent infinite loop gotcha Send("{F2}") If (_WinGetClass(WinGetTitle('')) = "CabinetWClass") Or (_WinGetClass(WinGetTitle('')) = "Progman") Then $oldClipboard = ClipGet() Sleep(100) Send("^c") $sFilename = ClipGet() $iExtPosition = StringInStr($sFilename, ".", 0, -1) If $iExtPosition <> 0 Then $iPosition = StringLen($sFilename) - $iExtPosition $i = 0 Send("^{HOME}") Do Send("+{RIGHT}") $i += 1 Until $i = ($iExtPosition - 1) Send("{SHIFTDOWN}{SHIFTUP}") EndIf ClipPut($oldClipboard) EndIf HotKeySet("{F2}", "_AnalyzeRename"); re-enable hotkey EndFunc Func _WinGetClass($hWnd) ; credit = SmOke_N from post http://www.autoitscript.com/forum/index.php?showtopic=41622&view=findpost&p=309799 If IsHWnd($hWnd) = 0 And WinExists($hWnd) Then $hWnd = WinGetHandle($hWnd) Local $aGCNDLL = DllCall('User32.dll', 'int', 'GetClassName', 'hwnd', $hWnd, 'str', '', 'int', 4095) If @error = 0 Then Return $aGCNDLL[2] Return SetError(1, 0, '') EndFunc
-
GUICtrlSetColor($progressBar,0xFF0000)
-
Short answer -> check here. Methodology: You'll need to change the "Wallpaper" value in the registry under HKEY_CURRENT_USER\Control Panel\Desktop to update the path to the new image ("WallpaperStyle" changes stretch/center/tile option), then run: RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters Happy scripting.
-
Look into: _IsPressed()Send() or ControlSend()in the help file
-
What you're encountering is the keyboard "Repeat Delay" setting (Control Panel -> Keyboard Settings). There is a default delay when pressing a keyboard key before it automatically repeats the keypress activity. As for DLL/UDF access to a modification of this property, I'm unsure - but hopefully this information will help narrow down your search criteria.