|
-
Feb 6th, 2000, 09:45 AM
#1
Thread Starter
New Member
I want to change the layout of my keyboard in a visual basic application. I want to change from French(Canada) to English(Canada).
This is my code :
Private Sub Command2_Click()
LoadKeyboardLayout "0000409", KLF_SUBSTITUTE_OK
End Sub
But it don't work and I don't know why.. Does somebody could help me !?
Thanks you,
Jonathan Fleury
-
Feb 6th, 2000, 10:17 PM
#2
Addicted Member
Hi.
Provided that you've declared LoadKeyboardLayout function in a module.
Private Sub Command2_Click()
LoadKeyboardLayout "00000409", KLF_ACTIVATE
End Sub
Good Luck.
-
Feb 7th, 2000, 01:32 AM
#3
Thread Starter
New Member
It didn't work and I declared my api in a module...
I'm using Visual Basic 5 under Windows 98
Thanks !
-
Feb 7th, 2000, 06:57 AM
#4
Addicted Member
If you may.
How did you declare it? Post your Code.
-
Feb 7th, 2000, 08:28 PM
#5
Thread Starter
New Member
In a module :
Declare Function LoadKeyboardLayout Lib "user32.dll" Alias "LoadKeyboardLayoutA" (ByVal pwszKLID As Long, Flag As Boolean) As Long
-
Feb 7th, 2000, 08:45 PM
#6
Addicted Member
Hi.
In your module paste the following:
Code:
Public Const HKL_PREV = 0
Public Const HKL_NEXT = 1
Public Const KLF_ACTIVATE = &H1
Public Const KLF_SUBSTITUTE_OK = &H2
Public Const KLF_UNLOADPREVIOUS = &H4
Public Const KLF_REORDER = &H8
''' Size of KeyboardLayoutName (number of characters), including nul terminator
Public Const KL_NAMELENGTH = 9
Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal pwszKLID As String, ByVal flags As Long) As Long
Good Luck.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|