|
-
Sep 28th, 2006, 02:15 AM
#1
Thread Starter
Addicted Member
Positioning of OnScreen KeyBoard
Hi ;
I tried to Postion the On_Screen Keyboard (Window Accessories) using VB without Success.
Can someone show me the way???
Thanks
-
Sep 28th, 2006, 02:27 AM
#2
Re: Positioning of OnScreen KeyBoard
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
-
Sep 28th, 2006, 02:51 AM
#3
Thread Starter
Addicted Member
Re: Positioning of OnScreen KeyBoard
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
-
Sep 28th, 2006, 03:00 AM
#4
Re: Positioning of OnScreen KeyBoard
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?
-
Sep 28th, 2006, 03:05 AM
#5
Thread Starter
Addicted Member
Re: Positioning of OnScreen KeyBoard
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
-
Sep 28th, 2006, 03:22 AM
#6
Re: Positioning of OnScreen KeyBoard
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.
-
Sep 28th, 2006, 03:26 AM
#7
Thread Starter
Addicted Member
Re: Positioning of OnScreen KeyBoard
Registry?Do you know the path?
-
Sep 28th, 2006, 03:52 AM
#8
Re: Positioning of OnScreen KeyBoard
I've searched my registry but i can't seem to find it. Sorry
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
|