🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.comp.programming
2 messages
2 total messages Started by Kelly Smith Wed, 04 Dec 2002 17:02
KELLY (me) NEEDS help with a VB6 CODE!!!! Please help me out!
#19
Author: Kelly Smith
Date: Wed, 04 Dec 2002 17:02
50 lines
3941 bytes
Hello,

Desperately need help programming a Visual Keyboard. I am a newbie VB-6
programmer. I am struggeling with something. Unfortunately I didn't find any
code for what I want, my Virtual Keyboard to do.

I made a lovely interface. Keyboard exists with command buttons. Allmost the
same as Microsoft Visual Keyboard, but mine isn't working :-).
I cannot call ALT, SHIFT, ESC, MENU, TAB, BACKSPACE, F1, F2... buttons and
also have problems finding code for sending Keys to previous window (or the
box where I click with the mouse, into a place where I want to write with my
VKeyboard). I use OnTopMost for my Form (Keyboard).
I found something that first opens a notepad and than sends the key. It has
to send keys to any application that uses texboxes, like I-explorer,
notepad, E-mail, etc...

Example:

    Private Declare Function OemKeyScan Lib "user32" (ByVal wOemChar As
Integer) As Long
    Private Declare Function CharToOem Lib "user32" Alias "CharToOemA"
(ByVal lpszSrc As String, ByVal lpszDst As String) As Long
    Private Declare Function MapVirtualKey Lib "user32" Alias
"MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long
    Private Declare Function SetKeyboardState Lib "user32" (lppbKeyState As
Byte) As Long
    Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As
Long) As Integer
    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

    Private Const KEYEVENTF_EXTENDEDKEY = &H1
    Private Const KEYEVENTF_KEYUP = &H2
...
...
Const VK_Q = 81
...
...
Private Sub Command29_Click(Index As Integer)
    Shell "C:\WINNT\Notepad.exe", vbNormalFocus
    keybd_event VK_Q, 0, 0, 0   'Q Key
    keybd_event VK_Q, 0, KEYEVENTF_KEYUP, 0
End Sub

Please can someone help me, or guide me on this? I am trying programming it
for months now (I am a beginner)! Please send me an e-mail, because I could
mis your msg (my e-mail is power@cable.a2000.nl)


Thanks A LOT! xxx
Re: KELLY (me) NEEDS help with a VB6 CODE!!!! Please help me out!
#18
Author: Francois
Date: Fri, 03 Jan 2003 18:42
54 lines
3954 bytes
have U tried SendMessage api?


"Kelly Smith" <power@cable.a2000.nl> wrote in message news:<YyqH9.19224$vj1.4592999@amsnews02.chello.com>...
> Hello,
> 
> Desperately need help programming a Visual Keyboard. I am a newbie VB-6
> programmer. I am struggeling with something. Unfortunately I didn't find any
> code for what I want, my Virtual Keyboard to do.
> 
> I made a lovely interface. Keyboard exists with command buttons. Allmost the
> same as Microsoft Visual Keyboard, but mine isn't working :-).
> I cannot call ALT, SHIFT, ESC, MENU, TAB, BACKSPACE, F1, F2... buttons and
> also have problems finding code for sending Keys to previous window (or the
> box where I click with the mouse, into a place where I want to write with my
> VKeyboard). I use OnTopMost for my Form (Keyboard).
> I found something that first opens a notepad and than sends the key. It has
> to send keys to any application that uses texboxes, like I-explorer,
> notepad, E-mail, etc...
> 
> Example:
> 
>     Private Declare Function OemKeyScan Lib "user32" (ByVal wOemChar As
> Integer) As Long
>     Private Declare Function CharToOem Lib "user32" Alias "CharToOemA"
> (ByVal lpszSrc As String, ByVal lpszDst As String) As Long
>     Private Declare Function MapVirtualKey Lib "user32" Alias
> "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long
>     Private Declare Function SetKeyboardState Lib "user32" (lppbKeyState As
> Byte) As Long
>     Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As
> Long) As Integer
>     Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal
> bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
> 
>     Private Const KEYEVENTF_EXTENDEDKEY = &H1
>     Private Const KEYEVENTF_KEYUP = &H2
> ...
> ...
> Const VK_Q = 81
> ...
> ...
> Private Sub Command29_Click(Index As Integer)
>     Shell "C:\WINNT\Notepad.exe", vbNormalFocus
>     keybd_event VK_Q, 0, 0, 0   'Q Key
>     keybd_event VK_Q, 0, KEYEVENTF_KEYUP, 0
> End Sub
> 
> Please can someone help me, or guide me on this? I am trying programming it
> for months now (I am a beginner)! Please send me an e-mail, because I could
> mis your msg (my e-mail is power@cable.a2000.nl)
> 
> 
> Thanks A LOT! xxx
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads