English
Entrance

Tatstatur Layout take on

 
- Page 1 -



Stephan
Sonneborn


Hello together,

i want by Profan the Tastaturlayout on english adjust.
usually make I the so:
DECLARE _Fontname$
DECLARE Fontname#
DIM Fontname#, ~KL_NAMELENGTH'9
DEF LoadKeyboardLayout(2) !"USER32", "LoadKeyboardLayoutA"
DEF GetKeyboardLayoutName(1) !"USER32","GetKeyboardLayoutNameA"
GetKeyboardLayoutName(Fontname#)
_Fontname$ = "000000409"
LoadKeyboardLayout(_Fontname$, ~KLF_ACTIVATE)

but the results in of/ one Access violation in USER32.DLL.

who can tell council?

(WIN10, 64bit)

52 kB
Hochgeladen:03/21/22
Downloadcounter68
Download
 
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
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

03/27/22  
 




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
 
03/22/22  
 




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
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

03/27/22  
 




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  [...] 
 
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

03/27/22  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.108 Views

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie