| |
|
|
- Page 1 - |
|
Stephan Sonneborn |
Hello together,
i want by Profan the Tastaturlayout on english adjust. usually make I the so:
but the results in of/ one Access violation in USER32.DLL.
who can tell council?
(WIN10, 64bit) |
|
|
| Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 03/21/22 ▲ |
|
|
|
|
« this Posting watts as Solution marked. » |
|
Georg Teles | good evening,
ahem, The function LoadKeyboardLayout expects a address to LayoutID (Addr(TLayout#)) ... The function UnloadKeyboardLayout expects wiederrum the lever, which from the function LoadKeyboardLayout generiert watts.
in the example have quick something gebastelt (News Layout becomes read, english & thereafter czech Tastaturlayout go added and subsequently removes & the ursprüngliche Layout tuned):
DECLARE actually$, TLayout$, TLayout#, hLayoutID_en&, hLayoutID_cs&
DIM TLayout#, 9'~KL_NAMELENGTH'9
DEF LoadKeyboardLayout(2)! "USER32", "LoadKeyboardLayoutA"
DEF GetKeyboardLayoutName(1)! "USER32","GetKeyboardLayoutNameA"
DEF UnloadKeyboardLayout(1)! "USER32","UnloadKeyboardLayout"
cls
' actually keyboard
GetKeyboardLayoutName(Addr(TLayout#))
print "aktuelle keyboard: "+String $(TLayout#,0)
print
' actually Save
aktuelle$ = String $(TLayout#,0)
WAITINPUT
' english Tastaturlayout add
TLayout$ = "00000409"
String TLayout#,0 = TLayout$
' english Layout ID secure !
hLayoutID_en& = LoadKeyboardLayout(Addr(TLayout#), 1)'~KLF_ACTIVATE)
print "LayoutID_en: ";(hLayoutID_en&);" (>0 = success, LayoutID)"
GetKeyboardLayoutName(Addr(TLayout#))
print "englische keyboard: "+String $(TLayout#,0)
print
WAITINPUT
' czech Tastaturlayout add
TLayout$ = "00000405"
String TLayout#,0 = TLayout$
' czech Layout ID secure !
hLayoutID_cs& = LoadKeyboardLayout(Addr(TLayout#), 1)'~KLF_ACTIVATE)
print "LayoutID_cs: ";hLayoutID_cs&;" (>0 = success, LayoutID)"
GetKeyboardLayoutName(Addr(TLayout#))
print "tschechische keyboard: "+String $(TLayout#,0)
print
WAITINPUT
' english & czech Layout Remove
print UnloadKeyboardLayout(hLayoutID_en&);" (1 = success/EN-Layout removes)"
print UnloadKeyboardLayout(hLayoutID_cs&);" (1 = success/CS-Layout removes)"
print
' on ursprüngliches Layout zurücksetzen
String TLayout#,0 = actually$
' vorheriges Layout new loading !
print LoadKeyboardLayout(Addr(TLayout#), 1);" (1 = success)"'~KLF_ACTIVATE)
GetKeyboardLayoutName(Addr(TLayout#))
print "aktuelle keyboard restored: "+String $(TLayout#,0)
'----------------------------------------------------
DISPOSE TLayout#
WAITINPUT
Edit: with LoadKeyboardLayout(Addr(TLayout#), 1) can the String directly using go: LoadKeyboardLayout(Addr(TLayout$), 1) against which The function GetKeyboardLayoutName(Addr(TLayout#)) a area needed.
Regards Georg |
|
|
| |
|
|
|
|
Sven Bader | Hello Stephan,
are you you sure, that this in windows 10 at all yet so simply goes? The systems riegeln such depths Eingriffe Yes always moreover ex.
with my two Schüssen in that blue be I unfortunately failed, 1. Fontname# großzügiger dimensionieren, 2. The first "0Delete, the Error comes nevertheless too by me.
I have the following on Stackoverflow found, here becomes too a zero less uses and it'll comments, that the Keyboardlayout so solely provided but not yet activate and is even into Kommentaren the suspicion, that it under windows 10 not any more goes. [...] (Stackoverflow)
Regards Sven |
|
|
| |
|
|
|
Stephan Sonneborn | Hello Sven, many Thanks for your Tests. I Have meanwhile herausbekommen, that The Übergabe one Stings, z.B. "00000407" for DE or "00000409" for EN the Tastaturlayout umstellt. I should now only yet know, How the actually Taststurlayout is. means the, before I it umstelle. then can I it on the End of program again turn back... |
|
|
| Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 03/24/22 ▲ |
|
|
|
|
Georg Teles | good evening,
ahem, The function LoadKeyboardLayout expects a address to LayoutID (Addr(TLayout#)) ... The function UnloadKeyboardLayout expects wiederrum the lever, which from the function LoadKeyboardLayout generiert watts.
in the example have quick something gebastelt (News Layout becomes read, english & thereafter czech Tastaturlayout go added and subsequently removes & the ursprüngliche Layout tuned):
DECLARE actually$, TLayout$, TLayout#, hLayoutID_en&, hLayoutID_cs&
DIM TLayout#, 9'~KL_NAMELENGTH'9
DEF LoadKeyboardLayout(2)! "USER32", "LoadKeyboardLayoutA"
DEF GetKeyboardLayoutName(1)! "USER32","GetKeyboardLayoutNameA"
DEF UnloadKeyboardLayout(1)! "USER32","UnloadKeyboardLayout"
cls
' actually keyboard
GetKeyboardLayoutName(Addr(TLayout#))
print "aktuelle keyboard: "+String $(TLayout#,0)
print
' actually Save
aktuelle$ = String $(TLayout#,0)
WAITINPUT
' english Tastaturlayout add
TLayout$ = "00000409"
String TLayout#,0 = TLayout$
' english Layout ID secure !
hLayoutID_en& = LoadKeyboardLayout(Addr(TLayout#), 1)'~KLF_ACTIVATE)
print "LayoutID_en: ";(hLayoutID_en&);" (>0 = success, LayoutID)"
GetKeyboardLayoutName(Addr(TLayout#))
print "englische keyboard: "+String $(TLayout#,0)
print
WAITINPUT
' czech Tastaturlayout add
TLayout$ = "00000405"
String TLayout#,0 = TLayout$
' czech Layout ID secure !
hLayoutID_cs& = LoadKeyboardLayout(Addr(TLayout#), 1)'~KLF_ACTIVATE)
print "LayoutID_cs: ";hLayoutID_cs&;" (>0 = success, LayoutID)"
GetKeyboardLayoutName(Addr(TLayout#))
print "tschechische keyboard: "+String $(TLayout#,0)
print
WAITINPUT
' english & czech Layout Remove
print UnloadKeyboardLayout(hLayoutID_en&);" (1 = success/EN-Layout removes)"
print UnloadKeyboardLayout(hLayoutID_cs&);" (1 = success/CS-Layout removes)"
print
' on ursprüngliches Layout zurücksetzen
String TLayout#,0 = actually$
' vorheriges Layout new loading !
print LoadKeyboardLayout(Addr(TLayout#), 1);" (1 = success)"'~KLF_ACTIVATE)
GetKeyboardLayoutName(Addr(TLayout#))
print "aktuelle keyboard restored: "+String $(TLayout#,0)
'----------------------------------------------------
DISPOSE TLayout#
WAITINPUT
Edit: with LoadKeyboardLayout(Addr(TLayout#), 1) can the String directly using go: LoadKeyboardLayout(Addr(TLayout$), 1) against which The function GetKeyboardLayoutName(Addr(TLayout#)) a area needed.
Regards Georg |
|
|
| |
|
|
|
Georg Teles | Nabend over again,
The to that Schluss auskommentierte row before must still mere:
' vorheriges Layout loaded: there this already existing has, must not absolutely
' new loaded go, follow up row can here default go!)
'print LoadKeyboardLayout(Addr(TLayout#), 1);" (1 = success)"'~KLF_ACTIVATE)
if one several Keyboard Layouts initially has and the example executing, becomes the first Layout to that Schluss from the list select ... means rather deliberate the previous Layout, what before tuned was, loading. (have The row in the previous mail again comments)
Edit: there falls me one, having time a PCU written, The in the Grunde The list the Languages contain (Sprachwerte in Dezimalangaben, these must still in Hexadezimale transformed go see for german 1031 = Hex 0407) [...]
having these list for uses [...] |
|
|
| |
|
|