Hi all.
Probably a quick one, I'm using PostMessage to send keys to an applicatoin
but how do I convert the key string to a long values so that I can pass this
to the wParam. The definition is below
Private Declare Auto Function PostMessage Lib "user32" ( _
ByVal hWnd As IntPtr, _
ByVal Msg As Integer, _
ByVal wParam As Long, _
ByVal lParam As Long) As Boolean
This works -> PostMessage(myWindow, WM_KEYDOWN, Keys.X, 0)
However I need to somehow convert the stirng into the equiv keycodes so I
can do something like
PostMessage(myWindow, WM_KEYDOWN, "x", 0)
Thanks
Paul 2 1847
Hi,
PostMessage(myWindow, WM_KEYDOWN, asc("x"), 0)
Ken
----------------------------
"Paul" <pa******************@vectra-it.co.uk> wrote in message
news:eR**************@TK2MSFTNGP10.phx.gbl... Hi all.
Probably a quick one, I'm using PostMessage to send keys to an applicatoin but how do I convert the key string to a long values so that I can pass
this to the wParam. The definition is below
Private Declare Auto Function PostMessage Lib "user32" ( _ ByVal hWnd As IntPtr, _ ByVal Msg As Integer, _ ByVal wParam As Long, _ ByVal lParam As Long) As Boolean
This works -> PostMessage(myWindow, WM_KEYDOWN, Keys.X, 0)
However I need to somehow convert the stirng into the equiv keycodes so I can do something like
PostMessage(myWindow, WM_KEYDOWN, "x", 0) Thanks Paul
Nice one, works well.
Thanks
Paul
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uv**************@TK2MSFTNGP11.phx.gbl... Hi,
PostMessage(myWindow, WM_KEYDOWN, asc("x"), 0)
Ken ---------------------------- "Paul" <pa******************@vectra-it.co.uk> wrote in message news:eR**************@TK2MSFTNGP10.phx.gbl... Hi all.
Probably a quick one, I'm using PostMessage to send keys to an
applicatoin but how do I convert the key string to a long values so that I can pass this to the wParam. The definition is below
Private Declare Auto Function PostMessage Lib "user32" ( _ ByVal hWnd As IntPtr, _ ByVal Msg As Integer, _ ByVal wParam As Long, _ ByVal lParam As Long) As Boolean
This works -> PostMessage(myWindow, WM_KEYDOWN, Keys.X, 0)
However I need to somehow convert the stirng into the equiv keycodes so
I can do something like
PostMessage(myWindow, WM_KEYDOWN, "x", 0) Thanks Paul
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: newsgroups.bellsouth.net |
last post by:
I was checking out SAPI, ms's speech recognition api, and thought it would
be cool to write a quick app for bf1942 that would recognise voice commands
and pass them to the game's commun. So if you...
|
by: RBohannon |
last post by:
I need to create a report in MS Word populated with data from A2K. I
have been asked to create the report in Word so that parts of it can be
edited as necessary later. The data in the report are...
|
by: Bryan |
last post by:
I am writing a C# Windows App that updates out Excel reports' modules. The
app is complete, but has a problem. The only way MS allows you to unprotect
the VBA code in Excel is to do it by hand or...
|
by: James |
last post by:
In my code I have a problem in abtaining a windows handle. I do not
know the namespace to obtain the windows hanle. here is the code.
using System;
using System.Collections;
using...
|
by: Wilfried Mestdagh |
last post by:
Hi,
Using P/Invoke I use PostMessage to send a message from one thread to
another. I'm pretty sure this has already worked in dotnet. but I've
upgraded version 2 few day ago.
Now I have an...
| |
by: Paul |
last post by:
Hi all.
Probably a quick one, I'm using PostMessage to send keys to an applicatoin
but how do I convert the key string to a long values so that I can pass this
to the wParam. The definition is...
|
by: knikkix |
last post by:
Hi,
I created a form in VB.Net with only one button. This is the code in
button click event
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles...
|
by: one2001boy |
last post by:
PostMessage() function returns ERROR_NOT_ENOUGH_QUOTA after running in a
loop for 700 times, but the disk space and memory are still big enough.
any suggestion to resolve this problem?
thanks.
|
by: NVergunst |
last post by:
Hello everyone.
I have what I believe to be a simple question, yet I can not find anything that is helpful to me.
Basically I have an application, that I want to use to control external...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |