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 1838
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: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: 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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |