Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/07/2012 in all areas

  1. AZJIO

    simple CD,DVD Launcher

    simple CD,DVD Launcher (En, Ru) Launcher.7z - v0.3, 288kb (exe+sources) All settings are stored in the file Launcher.ini [gui] Title=Launcher Width=180 Height=90 Margin=5 Row=2 FontSize= icon= ButMinW= ButMinH= GuiBkColor=3F3F3F ButColor= [1] name=Export hint=Export from the registry exe=regedit.exe arg=/e myfile.reg "HKEY_CURRENT_USERKeyboard LayoutPreload" Accelerators=Alt+1 ButColor=ffffff TextColor=db7100
    1 point
  2. GreenShot (http://getgreenshot.org/) is a nice, free for personal use, screen capture utility. It is designed to be running all the time (in the system notification tray) and triggered with a Global Hotkey (Print Scrn). I prefer to only run it when I need it and have it exit when I'm done, so I wrote this simple script. It starts the utility (if it's not already running), triggers a capture operation, waits for me to finish editing/saving the image, and then closes the utility. The only tricky part was determining when it was ready to accept a HotKey to start the capture. My solution was to monitor it's IO count. The only downside is that it leaves the tray icon visable until the next tray refresh, because I killed it instead of closing it down normally. (Known problem). - Alan G - GreenShot_Auto_X86_V1.0.zip ; ===================================================================== ; Start GreenShot ; Send it a PrintScreen keyboard commnad ; Wait for a capture ; Shut it down ; ===================================================================== Global $ProcessName = "Greenshot.exe" ; Process Name Global $WindowTitle = "Greenshot image editor" ; Image Editor Window Title Global $RunCmd = "C:\Program Files (x86)\Greenshot\Greenshot.exe" ; Program run Command Global $WorkingDir = "" ; Working Directory ; If GreenShot is not already running If NOT ProcessExists( $ProcessName ) Then ; Execute GreenShot If NOT ShellExecute( $RunCmd, "", $WorkingDir ) Then MsgBox( 16, @ScriptFullPath & " - Error", _ "Program failed to execute. $RunCmd = '" & $RunCmd & "'." ) Exit( 1 ) Else ; Wait for the GreenShot process to exist If NOT ProcessWait( $ProcessName, 5 ) Then MsgBox( 16, @ScriptFullPath & " - Error", _ "Process did not start. $ProcessName = '" & $ProcessName & "'." ) Exit( 1 ) Else ; Wait for a minimum number of IO (So we know it's ready) Global $Ready = False For $i = 1 To 20 Global $IOStats = ProcessGetStats( $ProcessName, 1 ) If $IOStats[1] > 4 Then $Ready = True ExitLoop EndIf Sleep( 250 ) Next ; $i If NOT $Ready Then MsgBox( 16, @ScriptFullPath & " - Error", _ "Process IO Reads not > 700. $ProcessName = '" & $ProcessName & "', $IOStats[1] = '" & $IOStats[1] & "'." ) Exit( 1 ) EndIf EndIf ; NOT ProcessWait EndIf ; NOT ShellExecute EndIf ; NOT ProcessExists ; Send GreenShot a PrintScreen Keyboard command to ; initiate a Capture Send( "{PRINTSCREEN}" ) ; Wait for the Greenshot Image Editor Window to Open ; after I take a shot If NOT WinWaitActive( $WindowTitle, "", 300 ) Then MsgBox( 16, @ScriptFullPath & " - Error", _ "Image Editor Window did not open. $WindowTitle = '" & $WindowTitle & "'." ) Exit( 1 ) EndIf ; Wait for the Greenshot Image Editor Window to Close ; then kill the process WinWaitClose( $WindowTitle ) ProcessClose( $ProcessName ) If NOT ProcessWaitClose( $ProcessName, 5 ) Then MsgBox( 16, @ScriptFullPath & " - Error", _ "Process failed to close. $ProcessName = '" & $ProcessName & "'." ) Exit( 1 ) EndIf ; All done Exit( 0 )
    1 point
  3. Here's an AutoIt only script that I converted from your VBScript, it works on my Windows 7 machine, may need Admin credentials to make it work though. Global $strComputer = "." If $CmdLine[0] > 0 Then Global $NIC_NEWNAME = $CmdLine[1] Global $NIC_OLDNAME = $CmdLine[2] EndIf ConsoleWrite("OLDNAME: " & $NIC_OLDNAME & @LF) ConsoleWrite("NEWNAME: " & $NIC_NEWNAME & @LF) Global $objWMIService = ObjGet("winmgmts:" & $strComputer & "rootCIMV2") Global $colItems = $objWMIService.ExecQuery("SELECT * from Win32_NetworkAdapter WHERE NetConnectionID LIKE 'Local Area Connection%'") For $objItem In $colItems ;~ ' create objects and get items Global $objShell = ObjCreate("Shell.Application") Global $objFolder = $objShell.Namespace(0x31) ;Control Panel Global $objFolderItem = $objFolder.Self Global $folder_Object = $objFolderItem.GetFolder For $clsConn In $folder_Object.Items If StringLower($clsConn.Name) = StringLower($NIC_OLDNAME) Then $clsConn.Name = $NIC_NEWNAME ConsoleWrite("Renamed to " & $NIC_NEWNAME & @LF) EndIf Next Next
    1 point
  4. JLogan3o13

    Class TButton

    I would suggest doing something like this: ShellExecuteWait(@ScriptDir & "fz306.exe", "/verysilent") RegWrite("HKCUSoftwareFilzipConfigSettings", "Language-Ini", "REG_SZ", "C:Program FilesFilziplanguagesGerman.ini")
    1 point
  5. power2anger, Next time please use a less controversial title for the GUI. I suggest you read the Forum Rules before you post again - particularly the bit which states: "Any discussion of using AutoIt to launch or interact with a game or game server violates our rules" M23
    1 point
  6. JScript, No, the first added icon with #AutoIt3Wrapper_Res_Icon_Add will be indexed as -5. Index 0 is the icon set by #AutoIt3Wrapper_Icon and -1 to -4 are filled by the default AutoIt tray icons. Look carefully at the example in SciTE help. M23
    1 point
  7. Thanks for your return, I'm very happy to have helped you! Put in your topic title the prefix or suffix [solved] Regards, João Carlos.
    1 point
  8. When you add a style, you must add the appropriate file variables, in this case is: #include <buttonconstants.au3> See: #include <guiconstantsex.au3> #include <windowsconstants.au3> #include <buttonconstants.au3> _Example() ; example Func _Example() Local $iMsg, $iButton1 GUICreate("My GUI", 120, 80, -1, -1, -1, $WS_EX_TOOLWINDOW) ; will create a dialog box that when displayed is centered $iButton1 = GUICtrlCreateButton("Start", 10, 40, 100, -1, $BS_FLAT) ; Disable Win Theme in button... DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($iButton1), "wstr", 0, "wstr", 0) GUISetState(@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $iMsg = GUIGetMsg() If $iMsg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() EndFunc ;==>_Example Regards, João Carlos.
    1 point
  9. Try this: $iButton1 = GUICtrlCreateButton("Start", 10, 40, 100, -1, $BS_FLAT)$BS_FLAT = Specifies that the button is two-dimensional; it does not use the default shading to create a 3-D image. Regards, João Carlos.
    1 point
  10. Quinch, SciTE4AutoIt3 Help <SciTE Help - Extra Utilities - AutoIt3Wrapper - Adding Extra Ico's to the program resources>. M23
    1 point
  11. @power2anger Use this exStyle: $WS_EX_TOOLWINDOW Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog box that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by typing ALT+SPACE. Disable Win Theme in button... DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $hButton, "wstr", 0, "wstr", 0) Example: #include <guiconstantsex.au3> #include <windowsconstants.au3> _Example() ; example Func _Example() Local $iMsg, $iButton1 GUICreate("My GUI", 120, 80, -1, -1, -1, $WS_EX_TOOLWINDOW) ; will create a dialog box that when displayed is centered $iButton1 = GUICtrlCreateButton("Start", 10, 40, 100) ; Disable Win Theme in button... DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($iButton1), "wstr", 0, "wstr", 0) GUISetState(@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $iMsg = GUIGetMsg() If $iMsg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() EndFunc ;==>_ExampleRegards, João Carlos.
    1 point
  12. Wrote quick autorun, can to someone it is required. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> If Not FileExists("autorun.inf") Then MsgBox(16,"Error!","File autorun.inf not found!") Exit EndIf $count = (UBound(IniReadSection("autorun.inf", "buttons"))-1)/2 If $count > 10 Then MsgBox(16,"Error!","Supports up to 10 buttons!") Exit EndIf If IsFloat($count) Then MsgBox(16,"Error!","Fractional number parameters of buttons!"&@CRLF&"Count = "&$count) Exit EndIf Dim $buttons[11] ; Maximum 10 buttons $space = 60 $Form1 = GUICreate(IniRead("autorun.inf", "config", "Title", "Autorun"), 307, ($space*$count)+20, -1, -1) For $i = 1 To $count $buttons[$i] = GUICtrlCreateButton(IniRead("autorun.inf", "buttons", "Button"&$i,""), 16, ($space*($i-1))+20, 275, 41) Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then Exit For $i = 1 To $count If $nMsg = $buttons[$i] Then $path = IniRead("autorun.inf", "buttons", "Path"&$i,"") If FileExists($path) Then Run($path) Else MsgBox(16,"Error!","Path '"&$path&"' not found!",60) EndIf ExitLoop EndIf Next WEnd The maximum is supported to 10 buttons, it will be already ugly more... Settings are stored in standard autorun.inf (additional sections): [autorun] Icon=AutoRun.exe Open=AutoRun.exe UseAutoPlay=1 [config] Title=Autorun Demo [buttons] Button1=Demo #1 Path1=demo1\setup.exe [...] Button10=Demo #10 Path10=demo10\setup.exe
    1 point
  13. About button have a look at and
    1 point
  14. Sorry for off topic (in a fashion) but I just have to express my laughter at this thread. Barros13: I want to learn advanced methods of ControlSend. Kidney: you might wanna look at ControlSend then. Barros13: likes this. PMSL.
    1 point
  15. Check your code, maybe it's something like a label's dimensions overlapping with the input field's dimensions.
    1 point
  16. A friend once told me he helped some woman whose car was stuck in the snow, and in response to his help she said: 'oh thank you jesus for sending me this young man!' and didn't thank him... 'Click' Jackass
    1 point
  17. stormbreaker

    Sorry :oS

    Want to read input box? Search for Controlgettext in help file and use it...
    1 point
  18. somdcomputerguy

    Sorry :oS

    In the Help file, search thru the Function Reference | Window Management section, and the sub-section there, Controls. What you're looking for is probably there.
    1 point
  19. JohnOne

    The devs of autoit...

    pics or it didn't happen.
    1 point
×
×
  • Create New...