1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Schnitzel

Beiträge von Schnitzel

  • IM

    • Schnitzel
    • 17. November 2009 um 21:34

    also ich denke die wenigsten (wenn überhaupt jemand) werden das script durchgehen. vllt hilfts etwas wenn du genauer beschreibst was nicht richtig funktioniert. dann hätte man einen ansatz wo man eventuell suchen muss.

  • Regular Expression

    • Schnitzel
    • 17. November 2009 um 16:21

    Wär cool wenn du noch schreiben würdest wie du es im endeffekt gelöst hast.
    falls du es gelöst hast ^^

  • Chiffrierungstool

    • Schnitzel
    • 17. November 2009 um 16:09

    oder auch:
    wieso langsam wenns 3mal so schnell geht :D

  • Regular Expression

    • Schnitzel
    • 17. November 2009 um 15:25

    also wenn das was du brauchst immer die Anführungszeichen außenrum haben dann wirst mit _Stringbetween sehr viel schneller zum ziel kommen. oder stringsplit könnte auch von nützen sein.

    Ansonsten könnte ich dir mit dir nur noch den Link zum RegExpTutorial von Bugfix geben : http://www.bug-fix.info/PathCheck.htm

  • Bundeswettbewerb Informatik

    • Schnitzel
    • 17. November 2009 um 15:16

    achso du hast deine lösung abgeschickt. naja ist kein problem.

    ich kann ja des bisschen warten ;)

    aber mit der berechungszeit biste schonmal bissl schneller als ich ;)

  • Bundeswettbewerb Informatik

    • Schnitzel
    • 17. November 2009 um 14:13
    Zitat von Jautois

    http://johannes-log.spacequadrat.de/Taste.htm

    Das sind meine Tastenbelegungen ...

    also die lösung (hab nur die deutsche durch mein programm gejagt) hab ich auch

    intressanter fände ich den lösungsweg

    trotzdem danke :)

  • Koordinatenkreutz - Negativer Array

    • Schnitzel
    • 17. November 2009 um 13:28

    lustig wärs schon. die sache mit dem Precompiler wird ja wohl eh nichts.
    Stilgar hat ja zufällig den wettbewerb schon so gut wie gelöst bevor er angefangen hat.

  • ERROR: syntax error

    • Schnitzel
    • 17. November 2009 um 13:00

    Ok du konntest es mal wieder besser formulieren :D

    ich meinte es natürlich in verbindung mit ner "1-zeiler-If"

  • Bundeswettbewerb Informatik

    • Schnitzel
    • 17. November 2009 um 12:59

    Joa würde mich schonmal interessieren wie die anderen das gelöst hatten.

    meine lösung zu der aufgabe mit der Handytastatur is z.B. sehr "quick and dirty" :D

    aber könnte schon stimmen

  • Koordinatenkreutz - Negativer Array

    • Schnitzel
    • 17. November 2009 um 12:36

    joa wär wahrscheinlich echt das beste wenn man das konzept außenrum wüsste.
    es ist wohl nicht sinnvoll über details zu reden wenn man die groben gegebenheiten nicht kennt

  • Rechte auf Ordner vergeben ?

    • Schnitzel
    • 17. November 2009 um 11:09

    bei _RunDOS musst du den kompletten CMD befehl den er ausführen soll einfach reinschreiben:
    Beispiel:

    Spoiler anzeigen
    [autoit]

    _Rundos('cacls C:\Programme\Sikla /T /E /G "jeder:f" ')
    _Rundos('cacls C:\Programme\CadStation /T /E /G "jeder:f" ')
    _Rundos('cacls C:\Programme\PlotFlow /T /E /G "jeder:f" ')
    ; usw...

    [/autoit] [autoit][/autoit] [autoit]

    Func _RunDOS($sCommand)
    Local $nResult = RunWait(@ComSpec & " /C " & $sCommand, "", @SW_HIDE)
    Return SetError(@error, @extended, $nResult)
    EndFunc ;==>_RunDOS

    [/autoit]
  • Rechte auf Ordner vergeben ?

    • Schnitzel
    • 17. November 2009 um 10:34

    das /k das du da immer drinstehen hast ist der parameter der sagt: lass die dos-box offen :D

    d.h. du musst statt /k einfach nur /c schreiben und dann müssts gehn

    edit: SEuBo: _RunDOS geht natürlich genauso. weils das gleiche macht:

    [autoit]

    Func _RunDOS($sCommand)
    Local $nResult = RunWait(@ComSpec & " /C " & $sCommand, "", @SW_HIDE)
    Return SetError(@error, @extended, $nResult)
    EndFunc ;==>_RunDOS

    [/autoit]


    ;)

  • Koordinatenkreuz Position

    • Schnitzel
    • 17. November 2009 um 09:56

    wie auch immer, solangs jetzt funktioeniert passts ja ;)

    PS: könntest den Thread noch auf gelöst setzten. einfach den ersten Post bearbeiten und als Präfix gelöst auswählen, und natürlich übernehmen

  • Koordinatenkreuz Position

    • Schnitzel
    • 17. November 2009 um 09:43

    das -4. -4 steht wahrscheinlich unter >>>> Window <<<< oder?
    d.h. das fenster (die linke obere ecke) befindet sich an der position -4, -4
    (ist normalerweise so wenn es maximiert ist)
    wenn du die mauskoordinaten willst musst du runterscrollen zu >>>> Mouse <<<< oder die controlkoordinaten unter >>>> Control <<<<

  • ERROR: syntax error

    • Schnitzel
    • 17. November 2009 um 09:40

    Deine If anweisung ist falsch
    wenn du es in eine zeile schreibst kannst du keine else verwenden, soweit ich weiß. außerdem hast du 2 befehle hinter der if anweisung stehen (exit und msgbox)

    so müssts gehn

    Spoiler anzeigen
    [autoit]

    ;~ Schritt 1: Prüfen, ob der angemeldete User die Admin auf dem Rechner ist. Wenn ja, dann Sprung zum Schritt 2.
    ;~ Wenn nicht die MsgBox ausgeben: Sie müssen Administrator sein um dieses Programm fortzusetzen!. Dann der Abbruch der Installation.
    If Not IsAdmin() Then
    MsgBox(64, "Kein Recht!", "Sie müssen Administrator sein um dieses Programm fortzusetzen!")
    Exit
    Else

    [/autoit] [autoit][/autoit] [autoit]

    ;Sperren Tastatur und Maus
    BlockInput(1)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Angang der Installation
    MsgBox(0, "CAD-Installation", "Installation PlotFlow", 3)
    ShellExecuteWait("C:\install\PlotFlow.exe")
    MsgBox(0, "CAD-Installation", "Installation Sikla", 3)
    ShellExecuteWait("C:\install\Sikla.exe")
    ;~ Ende der Installation

    [/autoit] [autoit][/autoit] [autoit]

    ;~ CAD-Updater Verknüpfung im Autostart von All_Users eintragen
    FileCreateShortcut("T:\CAD\CAD-Updater.exe", @StartupCommonDir & "\CAD-Updater.lnk", "T:\CAD\CAD\", "", "CAD-Updater")

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Waren bis CAD-Updater Fenster geschlossen ist
    While Not WinExists("CAD-Updater")
    Sleep(10)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ;Entsperren Tastatur und Maus
    BlockInput(0)

    [/autoit] [autoit][/autoit] [autoit]

    MsgBox(0, "Status der CAD-Installation", "Folgende Programme wurden erfolgreich installiert:" & @CRLF & "-------------------------------------------------------------" & @CRLF & "PlotFlow" & @CRLF & "Sikla")
    EndIf

    [/autoit]
  • Koordinatenkreuz Position

    • Schnitzel
    • 17. November 2009 um 09:31

    natürlich geht das. die frage ist nur was du genau machst

    Zitat von Slider99

    Jetzt geht es nicht mehr.

    bitte bisschen genauer beschreiben. hast du vielleicht vergessen das fadenkreuz über den bildschirm zu ziehen oder was ist genau los?

  • Koordinatenkreutz - Negativer Array

    • Schnitzel
    • 17. November 2009 um 08:39
    Zitat von kloklo

    Ich möchte aber, dass das Programm auch Links oben suchen kann ob da der Ausgang ist =P

    joa und wo is das problem?

    dann schreibste halt in array[2][0] und array[2][1] die nächste position, und immer in array[3][0] und array[3][1]
    dann steht in array[Ubound(array) - 1][0] immer die aktuelle x und in array[Ubound(array) - 1][0] immer die aktuelle y koordinate
    des array könnte halt ziemlich groß werden wenn du alle positionen speichern willst...

  • Koordinatenkreutz - Negativer Array

    • Schnitzel
    • 16. November 2009 um 21:05

    ähm mach doch einfach ein array[1][2]
    und in array[1][0] = x-Koordinate
    array[1][1] = y-Koordinate

  • Tastatur sperren

    • Schnitzel
    • 14. November 2009 um 14:01

    hier die udf:

    Spoiler anzeigen
    [autoit]

    #include-once
    #include <WindowsConstants.au3>
    #include <WinAPI.au3>
    ;

    [/autoit] [autoit][/autoit] [autoit]

    #Region ======================== BlockInputEx UDF Info ========================
    ; Extended (advanced) function to block mouse & keyboard inputs.
    ;
    ; This UDF supports few features that built-in BlockInput() function does not.
    ; Here is a quick "features list":
    ;----------------------------------------------------------------------
    ;* Block seperately mouse or keyboard input.
    ;* Block specific keyboard/mouse keys/clicks.
    ; [+] Not only hex keys are supported, string keys (such as {ENTER}) is also valid.
    ;* Block all keyboard/mouse keys *except* specific keys/events.
    ;* Block keys by CLASS Name (see UDF documentation).
    ;* Block inputs only for specific window.
    ;----------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.2.12.1+
    ; Author: G.Sandler (a.k.a MrCreatoR). Initial idea and hooks example by rasim.
    ;
    ;==================
    ; History version:
    ;==================
    ;
    ; [v1.3 - 24.09.2009, 23:00]
    ; + Added _BlockInputEx Example (Pass Lock)
    ; * Fixed few examples.
    ; * Fixed spell mistakes in the UDF.
    ;
    ; [v1.2 - 16.01.2009, 21:00]
    ; + Added key strings support.
    ; Now users can set simple hotkey strings for Exclude/Include parameters + Group chars, i.e: "[Group]|{UP}|{DOWN}"
    ; (See UDF documentation)
    ; + Added mouse events blocking support to the $sExclude/$sInclude parameters.
    ; + Added example for mouse events blocking.
    ;
    ; [v1.1 - 16.01.2009]
    ; + Added CLASSes support (see UDF documentation), thanks to FireFox for the idea and the keys lists.
    ; + Added example for CLASS usage.
    ; * Changed behaviour of $iBlockMode parameter as following:
    ;
    ; 1 - Block All
    ; <= 0 - UnBlock all
    ; 2 - Block only mouse
    ; 3 - Block only keyboard.
    ;
    ; * Fixed hard-crash that related to incorrect BlockInput releasing process (only callbacks was released, not the window hooks).
    ;
    ; [v1.0 - 15.01.2009]
    ; First release.
    #EndRegion ======================== BlockInputEx UDF Info ========================
    ;

    [/autoit] [autoit][/autoit] [autoit]

    Global $ah_MouseKeyboard_WinHooks[7]

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _BlockInputEx
    ; Description ...: Disable/enable the mouse and/or keyboard. Supporting blocking (by include/exclude) of seperate keys.
    ; Syntax.........: _BlockInputEx( [iBlockMode [, sExclude [, sInclude [, hWindows]]]] )
    ; Parameters ....: $iBlockMode - Set the block mode.
    ; 1 - Block All
    ; <= 0 - UnBlock all
    ; 2 - Block only mouse
    ; 3 - Block only keyboard.
    ; $sExclude - Keys hex/string-list (| delimited) to *exclude* when blocking.
    ; [*] All keys will be blocked, except the keys in $sExclude list.
    ; [!] This list supports keys CLASSes,
    ; key strings as supported in HotKeySet() function,
    ; and seperate mouse events classes, see "Remarks" for more details.
    ;
    ;
    ;
    ; $sInclude - Keys hex/string-list (| delimited) to *include* when blocking.
    ; [*] Only these keys will be blocked, the $sExclude ignored in this case.
    ; [!] This list supports keys CLASSes,
    ; key strings as supported in HotKeySet() function,
    ; and seperate mouse events classes, see "Remarks" for more details.
    ;
    ; $hWindows - Window handles list (| delimited) to limit the blocking process (Only for keyboard blocking).
    ;
    ; Return values .: Success - 1.
    ; Failure - 0 and set @error to 1. This can happend only when passing wrong parameters.
    ;
    ; Author ........: G.Sandler (a.k.a MrCreatoR), Rasim -> Initial idea and hooks example.
    ; Thanks to FireFox for other block methods, it gave me a starting point for adding the "keys classes" support.
    ;
    ;
    ; Modified.......: 16.01.2009, 21:03
    ; Remarks .......: * This UDF includes OnAutoItExit function to release the callback/hooks resources.
    ;
    ; * $sExclude and $sInclude parameters supporting keys/mouse classes as hex or as string,
    ; [!] The hex keys list can be found in _IsPressed documentation section.
    ; Here is a full list of supported classess/events:
    ; ======= KeyBoard =======
    ; [:FUNC:]
    ; [:ALPHA:]
    ; [:NUMBER:]
    ; [:ARROWS:]
    ; [:SPECIAL:]
    ; [GROUP_abcd] -> Use raw chars/key strings inside squere brackets.
    ; {KEY} -> Standard keys support ({F1}, {ENTER} etc.).
    ;
    ; ========= Mouse =========
    ; {MMOVE} -> Mouse move event
    ; {MPDOWN} -> Mouse Primary Down event
    ; {MPUP} -> Mouse Primary Up event
    ; {MSDOWN} -> Mouse Secondary Down event
    ; {MSUP} -> Mouse Secondary Up event
    ; {MWDOWN} -> Mouse WHEEL Button Down event
    ; {MWUP} -> Mouse WHEEL Button Up event
    ; {MWSCROLL} -> Mouse WHEEL Scroll event
    ; {MSPDOWN} -> Mouse Special Button Down event
    ; {MSPUP} -> Mouse Special Button Up event
    ;
    ;
    ; * See also built-in BlockInput() documentation.
    ;
    ; Related .......: BlockInput()?
    ; Link ..........; http://www.autoitscript.com/forum/index.php?s=&showtopic=87735
    ; Example .......; Yes
    ; ===============================================================================================================================
    Func _BlockInputEx($iBlockMode = -1, $sExclude = "", $sInclude = "", $hWindows = "")
    If $iBlockMode < -1 Or $iBlockMode > 3 Then Return SetError(1, 0, 0) ;Only -1 to 3 modes are supported.

    If $iBlockMode <= 0 Then Return _BlockInput_UnhookWinHooks_Proc()

    Local $pStub_KeyProc = 0, $pStub_MouseProc = 0, $hHook_Keyboard = 0, $hHook_Mouse = 0
    Local $hHook_Module = _WinAPI_GetModuleHandle(0)

    For $i = 0 To 3
    If $ah_MouseKeyboard_WinHooks[$i] > 0 Then
    _BlockInput_UnhookWinHooks_Proc()
    ExitLoop
    EndIf
    Next

    If $iBlockMode = 1 Or $iBlockMode = 2 Then
    $pStub_MouseProc = DllCallbackRegister("_MouseHook_Proc", "int", "int;ptr;ptr")
    $hHook_Mouse = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($pStub_MouseProc), $hHook_Module, 0)
    EndIf

    If $iBlockMode = 1 Or $iBlockMode = 3 Then
    $pStub_KeyProc = DllCallbackRegister("_KeyBoardHook_Proc", "int", "int;ptr;ptr")
    $hHook_Keyboard = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($pStub_KeyProc), $hHook_Module, 0)
    EndIf

    $ah_MouseKeyboard_WinHooks[0] = $pStub_KeyProc
    $ah_MouseKeyboard_WinHooks[1] = $pStub_MouseProc
    $ah_MouseKeyboard_WinHooks[2] = $hHook_Keyboard
    $ah_MouseKeyboard_WinHooks[3] = $hHook_Mouse
    $ah_MouseKeyboard_WinHooks[4] = "|" & _Parse_vmCodesList_CLASSes(_Parse_vkCodesList_CLASSes($sInclude)) & "|"
    $ah_MouseKeyboard_WinHooks[5] = "|" & _Parse_vmCodesList_CLASSes(_Parse_vkCodesList_CLASSes($sExclude)) & "|"
    $ah_MouseKeyboard_WinHooks[6] = "|" & $hWindows & "|"

    Return 1
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;KeyBoard hook processing function
    Func _KeyBoardHook_Proc($nCode, $wParam, $lParam)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[4], $nCode, $wParam, $lParam)

    Local $KBDLLHOOKSTRUCT = DllStructCreate("dword vkCode;dword scanCode;dword flags;dword time;ptr dwExtraInfo", $lParam)
    Local $vkCode = "0x" & Hex(DllStructGetData($KBDLLHOOKSTRUCT, "vkCode"), 2)

    Local $sInclude = $ah_MouseKeyboard_WinHooks[4]
    Local $sExclude = $ah_MouseKeyboard_WinHooks[5]
    Local $hWnds = $ah_MouseKeyboard_WinHooks[6]

    If $sInclude <> "||" Then ;Include proc
    If StringInStr($sInclude, "|" & $vkCode & "|") And _
    ($hWnds = "||" Or StringInStr($hWnds, "|" & WinGetHandle("[ACTIVE]") & "|")) Then Return 1 ;Block processing!
    Else ;Exclude proc
    If Not StringInStr($sExclude, "|" & $vkCode & "|") And _
    ($hWnds = "||" Or StringInStr($hWnds, "|" & WinGetHandle("[ACTIVE]") & "|")) Then Return 1 ;Block processing!
    EndIf

    _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[2], $nCode, $wParam, $lParam) ;Continue processing
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;Mouse hook processing function
    Func _MouseHook_Proc($nCode, $wParam, $lParam)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[3], $nCode, $wParam, $lParam) ;Continue processing

    Local $iMouse_Event = BitAND($wParam, 0xFFFF)
    ;Add mouse exclude/include actions support...

    Local $sInclude = $ah_MouseKeyboard_WinHooks[4]
    Local $sExclude = $ah_MouseKeyboard_WinHooks[5]
    Local $hWnds = $ah_MouseKeyboard_WinHooks[6]

    If $sInclude <> "||" Then ;Include proc
    If StringInStr($sInclude, "|" & $iMouse_Event & "|") And _
    ($hWnds = "||" Or StringInStr($hWnds, "|" & WinGetHandle("[ACTIVE]") & "|")) Then Return 1 ;Block processing!
    Else ;Exclude proc
    If Not StringInStr($sExclude, "|" & $iMouse_Event & "|") And _
    ($hWnds = "||" Or StringInStr($hWnds, "|" & WinGetHandle("[ACTIVE]") & "|")) Then Return 1 ;Block processing!
    EndIf

    Return _WinAPI_CallNextHookEx($ah_MouseKeyboard_WinHooks[3], $nCode, $wParam, $lParam) ;Continue processing
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;Releases callbacks and Unhook Windows hooks
    Func _BlockInput_UnhookWinHooks_Proc()
    ;Release KeyBoard callback function
    If $ah_MouseKeyboard_WinHooks[0] > 0 Then
    DllCallbackFree($ah_MouseKeyboard_WinHooks[0])
    $ah_MouseKeyboard_WinHooks[0] = 0
    EndIf

    ;Release Mouse callback function
    If $ah_MouseKeyboard_WinHooks[1] > 0 Then
    DllCallbackFree($ah_MouseKeyboard_WinHooks[1])
    $ah_MouseKeyboard_WinHooks[1] = 0
    EndIf

    ;Release KeyBoard Window hook
    If IsPtr($ah_MouseKeyboard_WinHooks[2]) Then
    _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[2])
    $ah_MouseKeyboard_WinHooks[2] = 0
    EndIf

    ;Release Mouse Window hook
    If IsPtr($ah_MouseKeyboard_WinHooks[3]) Then
    _WinAPI_UnhookWindowsHookEx($ah_MouseKeyboard_WinHooks[3])
    $ah_MouseKeyboard_WinHooks[3] = 0
    EndIf

    Return 1
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Parse_vkCodesList_CLASSes($sList)
    $sList = StringRegExpReplace($sList, "(?i)\{(Ctrl|Shift|Alt)\}", "{L$1}|{R$1}") ;Fix for Ctrl/Shift/Alt keys (add L/R to them)

    Local $a_vkCode_List = StringSplit($sList, "|")
    Local $sRet_Keys = ""

    For $i = 1 To $a_vkCode_List[0]
    Switch $a_vkCode_List[$i]
    Case "[:FUNC:]"
    $a_vkCode_List[$i] = "0x70|0x71|0x72|0x73|0x74|0x75|0x76|0x77|0x78|0x79|0x7A|0x7B|0x7C|" & _
    "0x7D|0x7E|0x7F|0x80H|0x81H|0x82H|0x83H|0x84H|0x85H|0x86H|0x87H"
    Case "[:ALPHA:]"
    $a_vkCode_List[$i] = "0x41|0x42|0x43|0x44|0x45|0x46|0x47|0x48|0x49|0x4A|0x4B|0x4C|0x4D|" & _
    "0x4E|0x4F|0x50|0x51|0x52|0x53|0x54|0x55|0x56|0x57|0x58|0x59|0x5A"
    Case "[:NUMBER:]"
    $a_vkCode_List[$i] = "0x30|0x31|0x32|0x33|0x34|0x35|0x36|0x37|0x38|0x39|0x60|0x61|0x62|" & _
    "0x63|0x64|0x65|0x66|0x67|0x68|0x69"
    Case "[:ARROWS:]"
    $a_vkCode_List[$i] = "0x25|0x26|0x27|0x28"
    Case "[:SPECIAL:]"
    $a_vkCode_List[$i] = "0x08|0x09|0x0C|0x0D|0x10|0x11|0x12|0x13|0x14|0x1B|0x20|0x21|0x22|" & _
    "0x23|0x24|0x29|0x2A|0x2B|0x2C|0x2D|0x2E|0x5B|0x5C|0x6A|0x6B|0x6C|" & _
    "0x6D|0x6E|0x6F|0x90|0x91|0xA0|0xA1|0xA2|0xA3|0xA4|0xA5|0xBA|0xBB|" & _
    "0xBC|0xBD|0xBE|0xBF|0xC0|0xDB|0xDC|0xDD"
    Case Else
    $a_vkCode_List[$i] = _KeyStr_To_vkCode($a_vkCode_List[$i])
    EndSwitch

    $sRet_Keys &= $a_vkCode_List[$i] & "|"
    Next

    Return StringRegExpReplace($sRet_Keys, "\|+$", "")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Parse_vmCodesList_CLASSes($sList)
    Local Const $MOUSE_MOVE_EVENT = 512
    Local Const $MOUSE_PRIMARYDOWN_EVENT = 513
    Local Const $MOUSE_PRIMARYUP_EVENT = 514
    Local Const $MOUSE_SECONDARYDOWN_EVENT = 516
    Local Const $MOUSE_SECONDARYUP_EVENT = 517
    Local Const $MOUSE_WHEELDOWN_EVENT = 519
    Local Const $MOUSE_WHEELUP_EVENT = 520
    Local Const $MOUSE_WHEELSCROLL_EVENT = 522
    Local Const $MOUSE_SPECIALBUTTONDOWN_EVENT = 523
    Local Const $MOUSE_SPECIALBUTTONUP_EVENT = 524

    Local $a_vmCode_List = StringSplit($sList, "|")
    Local $sRet_Keys = ""

    For $i = 1 To $a_vmCode_List[0]
    Switch $a_vmCode_List[$i]
    Case "{MMOVE}"
    $a_vmCode_List[$i] = $MOUSE_MOVE_EVENT
    Case "{MPDOWN}"
    $a_vmCode_List[$i] = $MOUSE_PRIMARYDOWN_EVENT
    Case "{MPUP}"
    $a_vmCode_List[$i] = $MOUSE_PRIMARYUP_EVENT
    Case "{MSDOWN}"
    $a_vmCode_List[$i] = $MOUSE_SECONDARYDOWN_EVENT
    Case "{MSUP}"
    $a_vmCode_List[$i] = $MOUSE_SECONDARYUP_EVENT
    Case "{MWDOWN}"
    $a_vmCode_List[$i] = $MOUSE_WHEELDOWN_EVENT
    Case "{MWUP}"
    $a_vmCode_List[$i] = $MOUSE_WHEELUP_EVENT
    Case "{MWSCROLL}"
    $a_vmCode_List[$i] = $MOUSE_WHEELSCROLL_EVENT
    Case "{MSPDOWN}"
    $a_vmCode_List[$i] = $MOUSE_SPECIALBUTTONDOWN_EVENT
    Case "{MSPUP}"
    $a_vmCode_List[$i] = $MOUSE_SPECIALBUTTONUP_EVENT
    EndSwitch

    $sRet_Keys &= $a_vmCode_List[$i] & "|"
    Next

    Return StringRegExpReplace($sRet_Keys, "\|+$", "")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _KeyStr_To_vkCode($sKeyStr)
    Local $sRet_Keys = "", $aDelim_Keys[1]
    Local $aKeys = StringSplit("{LMouse}|{RMouse}|{}|(MMouse}|{}|{}|{}|{BACKSPACE}|{TAB}|{}|{}|{}|{ENTER}|{}|{}|{SHIFT}|{CTRL}|{ALT}|{PAUSE}|{CAPSLOCK}|{}|{}|{}|{}|{}|{}|{ESC}|{}|{}|{}|{]|{SPACE}|{PGUP}|{PGDN}|{END}|{HOME}|{LEFT}|{UP}|{RIGHT}|{DOWN}|{SELECT}|{PRINTSCREEN}|{}|{PRINTSCREEN}|{INSERT}|{DEL}|{}|0|1|2|3|4|5|6|7|8|9|{}|{}|{}|{}|{}|{}|{}|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|{LWIN}|{RWIN}|{APPSKEY}|{}|{SLEEP}|{numpad0}|{numpad1}|{numpad2}|{numpad3}|{numpad4}|{numpad5}|{numpad6}|{numpad7}|{numpad8}|{numpad9}|{NUMPADMULT}|{NUMPADADD}|{}|{NUMPADSUB}|{NUMPADDOT}|{NUMPADDIV}|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{F13}|{F14}|{F15}|{F16}|{F17}|{F18}|{F19}|{F20}|{F21}|{F22}|{F23}|{F24}|{}|{}|{}|{}|{}|{}|{}|{}|{NUMLOCK}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{LSHIFT}|{RSHIFT}|{LCTRL}|{RCTRL}|{LALT}|{RALT}|{BROWSER_BACK}|{BROWSER_FORWARD}|{BROWSER_REFRESH}|{BROWSER_STOP}|{BROWSER_SEARCH}|{BROWSER_FAVORITES}|{BROWSER_HOME}|{VOLUME_MUTE}|{VOLUME_DOWN}|{VOLUME_UP}|{MEDIA_NEXT}|{MEDIA_PREV}|{MEDIA_STOP}|{MEDIA_PLAY_PAUSE}|{LAUNCH_MAIL}|{LAUNCH_MEDIA}|{LAUNCH_APP1}|{LAUNCH_APP2}|{}|{}|;|{+}|,|{-}|.|/|`|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|[|\|]|'", "|")

    If StringRegExp($sKeyStr, "\A\[|\]\z") Then
    $sKeyStr = StringRegExpReplace($sKeyStr, "\A\[|\]\z", "")
    $sKeyStr = StringRegExpReplace($sKeyStr, "(.)", "\1|")
    $sKeyStr = StringRegExpReplace($sKeyStr, "\|+$", "")

    $aDelim_Keys = StringSplit($sKeyStr, "")
    EndIf

    For $i = 1 To $aKeys[0]
    If $aDelim_Keys[0] > 1 Then
    For $j = 1 To $aDelim_Keys[0]
    If $aKeys[$i] = $aDelim_Keys[$j] Then $sRet_Keys &= "0x" & Hex($i, 2) & "|"
    Next
    Else
    If $aKeys[$i] = $sKeyStr Then Return "0x" & Hex($i, 2)
    EndIf
    Next

    If $sRet_Keys = "" Then Return $sKeyStr
    Return StringRegExpReplace($sRet_Keys, "\|+$", "")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;Called when script exits to release resources.
    Func OnAutoItExit()
    _BlockInputEx(0)
    EndFunc

    [/autoit]

    und hier ein beispiel:

    Spoiler anzeigen
    [autoit]

    #include <BlockInputEx.au3>

    [/autoit] [autoit][/autoit] [autoit]

    ;================== Block keyboard only Example ==================

    [/autoit] [autoit][/autoit] [autoit]

    HotKeySet("{ESC}", "_Quit") ;This will fail due to full keyboard blocking.

    [/autoit] [autoit][/autoit] [autoit]

    ;Here we block only *Keyboard* input (without mouse).
    _BlockInputEx(3)

    [/autoit] [autoit][/autoit] [autoit]

    ;This is only for testing, so if anything go wrong, the script will exit after 10 seconds.
    AdlibEnable("_Quit", 10000)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Sleep(100)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Quit()
    Exit
    EndFunc

    [/autoit]

    ;)

  • In ListView Scrollen

    • Schnitzel
    • 13. November 2009 um 15:56

    1 tag andre schaun lassen: kein ergebnis
    2 minuten selber schaun: fertig

    :rofl:

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™