@KBLayout

  • Moin Moin

    ich hab n kleines problem, @KBLayout wird beim start gesetzt, wenn ich nun tastaturenbelegung ändere bleibt @KBLayout gleich )=
    weiss vlt iwer wie ich des "neu laden" kann? oder sonnst irgendwie abfragen kann?

    mfg

    Einmal editiert, zuletzt von K1773R (28. März 2009 um 12:07)

  • hmm kannste mal dein script schicken? vllt gibts ja nochn andren weg außer @KBLayout...

  • hier damit du siest das des ned geht )=

    Spoiler anzeigen
    [autoit]

    #cs
    00000407 German(German)
    00000807 German(Switzerland)
    #ce

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

    HotKeySet("{END}","_exit")
    While 1
    Sleep(100)
    TrayTip("",@KBLayout,1)
    WEnd

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

    Func _exit()
    Exit 0
    EndFunc

    [/autoit]
  • Geht ja wohl =P

    Spoiler anzeigen
    [autoit]

    #include <Misc.au3>
    #include <WinApi.au3>
    #cs
    00000407 German(German)
    00000807 German(Switzerland)
    #ce

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

    HotKeySet("{END}","_exit")
    $KB1 = _GetKeyboardLayout()

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

    While 1
    sleep(500)
    $KB2 = _GetKeyboardLayout()
    If $KB1 <> $KB2 Then
    MsgBox(0,"",$KB2)
    $KB1 = $KB2
    EndIf
    WEnd

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

    Func _GetKeyboardLayout()
    $hWnd = _WinAPI_GetForegroundWindow()
    Local $ret = DllCall("user32.dll", "long", "GetWindowThreadProcessId", "hwnd", $hWnd, "ptr", 0)
    $ret = DllCall("user32.dll", "long", "GetKeyboardLayout", "long", $ret[0])
    Return Hex($ret[0], 4)
    EndFunc

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

    Func _exit()
    Exit 0
    EndFunc

    [/autoit]

    Einmal editiert, zuletzt von ChaosKeks (28. März 2009 um 12:09)

  • du musst ned die exit func löschen xD

    gucks mir ma an ^^

    EDIT 1:
    funzt super :D :D :D thx


    [autoit]

    #include <WinApi.au3>
    #cs
    00000407 German(German)
    00000807 German(Switzerland)
    00000409 English(United States)
    #ce

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

    HotKeySet("{END}","_exit")
    $KB1 = _GetKeyboardLayout()

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

    While 1
    sleep(500)
    $KB2 = _GetKeyboardLayout()
    If $KB1 <> $KB2 Then
    MsgBox(0,"",$KB2)
    $KB1 = $KB2
    EndIf
    WEnd

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

    Func _GetKeyboardLayout()
    $hWnd = _WinAPI_GetForegroundWindow()
    Local $ret = DllCall("user32.dll", "long", "GetWindowThreadProcessId", "hwnd", $hWnd, "ptr", 0)
    $ret = DllCall("user32.dll", "long", "GetKeyboardLayout", "long", $ret[0])
    Return Hex($ret[0], 8)
    EndFunc

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

    Func _exit()
    Exit 0
    EndFunc

    [/autoit]

    Einmal editiert, zuletzt von K1773R (28. März 2009 um 12:24)

  • Hmm bei Hex 8 kommen bei mir ganz andre Zahlen raus...
    Mach doch einfach:

    [autoit]

    Return "0000" & Hex($ret[0], 4)

    [/autoit]
  • ne is ned fürn bot ^^
    hab kb für jede tastatur ifs zu schreiben ^^
    ne ini pro tastatur also bis jetzt für deutsch, schweiz, und english
    is einfacher, schöner und spart ne menge zeit :D

    EDIT 1:

    misc.au3 musst doch ned includieren ^^
    *bei mir rausnehm*