Avatar of jack niekerk
jack niekerk
Flag for Netherlands asked on

error vb6 postmessage usage

listing in vb6 with errorTrying to get some calls running in VB6 to use Postmessage  Function
This is a call to the functions in a program wich now i can now only use bij shelling to commandline ,
like   Shell "J:\VIRT_KEYBORD\MOVETOPKB  ", vbHide
Utillity from  https://hot-virtual-keyboard.com/

According their on-site manal  should be possible to do like this

Const WM_CSKEYBOARD = &H400 + 192
Const WM_CSKEYBOARDMOVE = &H400 + 193
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, _
         ByVal lParam As Integer) As Integer

    'Move Hot Virtual Keyboard in Visual Basic; Move it first then show itresponse helpdesk    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) ' Handles Button3.Click
        Dim hWnd As Integer
        hWnd = FindWindow("TFirstForm", "hvkFirstForm")
        PostMessage(hWnd, WM_CSKEYBOARDMOVE, 200, 200)
        PostMessage(hWnd, WM_CSKEYBOARD, 1, 0)
    End Sub

But calls to postmessga gives in Editor red syntax status
Support desk from supplier could not help me out on this

please see the attachd file from program listing and response helpdesk wich does not sove my problem

Thanks for help
Programming* vb6Visual Basic Classic

Avatar of undefined
Last Comment
jack niekerk

8/22/2022 - Mon
Ryan Chong

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
jack niekerk

this did it  
 try put "Call" in front of the PostMessage?

regards Jack
jack niekerk

i forgot a part of the error see new posted reqeust pleaase
jack niekerk

to set it all to registry
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
jack niekerk

hello ,  i run in a other problem
all above runs perfect on windows 7 (tested on that one)

now running on the destenation station  Windows-10 pro

all these routines  give no error  but also no effect

Case 1
        'Open/show Hot Virtual Keyboard
        hWndvirt = FindWindowb("TFirstForm", "hvkFirstForm")
        Call PostMessage(hWndvirt, WM_CSKEYBOARD, 1, 0)
  Case 2
        'Move Hot Virtual Keyboard ; Move it first then show it
        hWndvirt = FindWindowb("TFirstForm", "hvkFirstForm")
        Call PostMessageb(hWndvirt, WM_CSKEYBOARDMOVE, 200, 650)
        Call PostMessageb(hWndvirt, WM_CSKEYBOARD, 1, 0)
Looks like VB^on a Windows-10 situation
thus sofar al work for nothing

any idea???
regards jack
Ryan Chong

hWndvirt = FindWindowb("TFirstForm", "hvkFirstForm")

sorry as I can't replicate and test it at my local. perhaps you should open a new question so other experts could assist?
jack niekerk

Thanks , best regards
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.