LoadKeyboardLayout() 函数在 VB 2010 中不起作用
我想使用我的 VB 应用程序更改已安装的另一个键盘布局的默认键盘布局。我在 google 上搜索了这一点并找到 Function LoadKeyboardLayout() 函数来执行此操作。但是 vb 2010 中是否支持此功能。当我编写下面的代码时,有没有语法错误。但是当我运行程序时,出现一个名为“检测到 PInvokeStackImbalance...”的错误 我该如何在 vb 2010 中解决这个问题? 这是我的代码:
Private Const KLF_ACTIVATE As Long = &H1
Private Const KLF_NOTELLSHELL As Long = &H80
Private Const KLF_REORDER As Long = &H8
Private Const KLF_REPLACELANG As Long = &H10
Private Const KLF_RESET As Long = &H40000000
Private Const KLF_SETFORPROCESS As Long = &H100
Private Const KLF_SHIFTLOCK As Long = &H10000
Private Const KLF_SUBSTITUTE_OK As Long = &H2
Private Const KLF_UNLOADPREVIOUS As Long = &H4
Private Declare Function LoadKeyboardLayout _
Lib "user32.dll" _
Alias "LoadKeyboardLayoutA" ( _
ByVal pwszKLID As String, _
ByVal flags As Long) As Long
'Inside a button click event
LoadKeyboardLayout("00000409", KLF_ACTIVATE)
任何人都可以帮助我......
I want to change my default keyboard Layout for a installed another Keyboard Layout using my VB application.I googled about this and find Function LoadKeyboardLayout() Function to do that.But Is this support in vb 2010.When I wrote below code and there is no syntax error.But when I run the program there is an error called "PInvokeStackImbalance was detected... "
How can I solve this in vb 2010.
Here is my code:
Private Const KLF_ACTIVATE As Long = &H1
Private Const KLF_NOTELLSHELL As Long = &H80
Private Const KLF_REORDER As Long = &H8
Private Const KLF_REPLACELANG As Long = &H10
Private Const KLF_RESET As Long = &H40000000
Private Const KLF_SETFORPROCESS As Long = &H100
Private Const KLF_SHIFTLOCK As Long = &H10000
Private Const KLF_SUBSTITUTE_OK As Long = &H2
Private Const KLF_UNLOADPREVIOUS As Long = &H4
Private Declare Function LoadKeyboardLayout _
Lib "user32.dll" _
Alias "LoadKeyboardLayoutA" ( _
ByVal pwszKLID As String, _
ByVal flags As Long) As Long
'Inside a button click event
LoadKeyboardLayout("00000409", KLF_ACTIVATE)
Can anyone help me...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您所要做的就是将长整型转换为整数......
I think all you have to do is switch the longs to integers...