Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/23/2012 in all areas

  1. Use my Function _Word_DocRangeSet allows to set the insertion point to the end of the document.You have to insert a sleep after you have written the screenshot to Word because _IsPressed still returns True for x milliseconds. The help file states: "If the code called does not include a blocking function (such as MsgBox) and the user does not require multiple returns, the script should wait until _IsPressed() returns 0 before continuing.". The example in the help file describes how to do it right.
    1 point
  2. InunoTaishou, No, we are going to say in a very patient and calm voice, please read the Forum Rules - and especially the bit that says: "Do not discuss any of the following: Automating games or game servers. This rule is zero tolerance" If you have problems with that, then let me remind you that this our forum and so we ask that you respect our rules while you are here. Please remember that you paid nothing for AutoIt nor to join this forum - so we owe you nothing in return. M23
    1 point
  3. nullschritt, And what if no-one actually knows the answer? I remember my first few posts here remaining unanswered - I did not throw my toys out of the cot as it was obvious to me that those who could not help were not going to post saying so, and several score of "Sorry" posts does not help either. You need to remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. If their interests and yours do not coincide then you are out of luck - and no worse off than if you had never asked. So I suggest that you lose the hang-dog attitude and try to act in a more sensible manner as your current one is not helping you at all. M23 P.S. Encryption algorithms are very difficult to write in any language, but in my opinion AutoIt is not at all suited to this task given its (lack of) speed. Why not use the Crypt UDF which allow you to encrypt/decrypt easily without the complexity?
    1 point
  4. You can use this function from guiness. ; #FUNCTION# ========================================================================================================= ; Name...........: _GUICtrlSetTheme ; Description ...: Sets a 'themed' Control with the ability to change the color of the control ; Syntax.........: _GUICtrlSetTheme($iControl = -1, $bThemeColor = 0x24D245) ; Parameters ....: $iControl - [optional] A valid control ID. Default = -1 (last control ID) ; $hHandle - [optional] A valid Hex color value. Default = 0x24D245 ; Requirement(s).: v3.3.0.0 or higher ; Return values .: Success - Returns a value from the 'SetWindowTheme' DLL call. ; Failure - Returns 0 with @extended set as 1. ; Author ........: guinness. ; Example........; Yes ;===================================================================================================================== Func _GUICtrlSetTheme($iControl = -1, $bThemeColor = 0x24D245) If Not IsHWnd($iControl) Then $iControl = GUICtrlGetHandle($iControl) Local $aReturn = DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $iControl, "wstr", 0, "wstr", 0) If @error Then Return SetError(1, 1, 0) GUICtrlSetColor($iControl, $bThemeColor) Return $aReturn[0] EndFunc ;==>_GUICtrlSetThemeOr just use DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", <whatver variable points to the control>, "wstr", 0, "wstr", 0) after the control is created.
    1 point
  5. The '\' are missing in 'C:\Windows\System32\baspscfg.exe'
    1 point
  6. jmon

    Help with _IsPressed function

    I came up with an alternative, using the GuiSetAccelerators. In this example I am using the F1-F9 keys, because I am using a laptop, but you can replace F by NUMPAD. I like this method because you can call 2 different functions for each event. Opt ( "GuiOnEventMode" , 1 ) $Gui = GUICreate ( "Speed Test" , 500 , 200 ) $Edit = GUICtrlCreateEdit ( "" , 5 , 5 , 480 , 180 ) GUISetOnEvent ( $GUI_EVENT_CLOSE , "_Exit" ) GUISetState() ;Create some dummies to call the function $DummyGoodKey = GUICtrlCreateDummy() GUICtrlSetOnEvent ( $DummyGoodKey , "_GoodKey" ) $DummyBadKey = GUICtrlCreateDummy() GUICtrlSetOnEvent ( $DummyBadKey , "_BadKey" ) $RndKey = Random ( 1 , 9 , 1 ) ;Random keys F1-F9 _SetGoodKey ( $RndKey ) GUICtrlSetData ( $Edit , "Press the key : F" & $RndKey ) $Timer = TimerInit() While 1 Sleep (10) WEnd Func _GoodKey() GUICtrlSetData ( $Edit , "Good Key pressed!" & @CRLF & "Your Time: " & TimerDiff ( $Timer ) / 1000 & " s" & @CRLF ) EndFunc Func _BadKey() GUICtrlSetData ( $Edit , "Wrong key pressed!" & @CRLF ) EndFunc Func _SetGoodKey ( $iGoodKey ) Local $aAccelerators[10][2] For $i = 0 To 9 If $i = $iGoodKey Then $aAccelerators[$i][0] = "{F" & String ($i) & "}" ;You can replace "F" with "NUMPAD" $aAccelerators[$i][1] = $DummyGoodKey Else $aAccelerators[$i][0] = "{F" & String( $i) & "}" ;You can replace "F" with "NUMPAD" $aAccelerators[$i][1] = $DummyBadKey EndIf Next Return GUISetAccelerators ( $aAccelerators , $Gui ) EndFunc Func _Exit() Exit EndFunc
    1 point
×
×
  • Create New...