Hi ;
I tried to Postion the On_Screen Keyboard (Window Accessories) using VB without Success.
Can someone show me the way???
Thanks :wave:
Printable View
Hi ;
I tried to Postion the On_Screen Keyboard (Window Accessories) using VB without Success.
Can someone show me the way???
Thanks :wave:
VB Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function MoveWindow Lib "user32" (ByVal Hwnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Type POINTAPI X As Long Y As Long End Type Private Declare Function GetWindowRect Lib "user32" (ByVal Hwnd As Long, lpRect As RECT) As Long Private Sub Form_Load() Dim RC As RECT, OSKHwnd As Long OSKHwnd = FindWindow(vbNullString, "On-Screen Keyboard") GetWindowRect OSKHwnd, RC MoveWindow OSKHwnd, 0, 0, RC.Right - RC.Left, RC.Bottom - RC.Top, 1 End Sub
Thanks For Your Help. I can Position now. But If I place a shell("OSK,VBnormalFocus) right before OSKhwnd=findwindow, and some how I drag the Keyboard to some where and reopen it, the Keyboard seems to be at the changed position and then back to the preset value. It is particularly obvious if I place a button to dynamically change the keyboard Positon. you have any idea why? Thanks again
Sorry i'm not sure i understand what you mean. Do you want the Keyboard to always be in one place only while your program is running?
Sorry for the confusion:
If the Keyboard had been Displayed, If I drag the keyboard to another Position say Location A, It seems that the Keyboard will memorized Location A. When I closed the Keyboard, And Re open it (say with Button), It will start from Location A then Goto the Preset Location from the program.
Thanks
I tried to open the OSK hidden then change its position, then finally show it again, but it seems that the OSK doesn't allow me to run it hidden and so will always show itself. So i don't think there is a way to show it in the preset position that way.
The only other way that i can think of is to edit the registry and change its startup position, so when it loads, it will start in the preset position.
Registry?Do you know the path?
I've searched my registry but i can't seem to find it. Sorry