473,503 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PostMessage troubles with SHIFT key

I use PostMessage to drive an application by sending it keyboard
events. Messages that are sent with no modifiers are processed well.
As an example, the '.' key message sent here:

My messages:

Recognized: "Release brakes"
Message: 0x100 wParam: 0xbe lParam: 0x340001
Message: 0x102 wParam: 0x2e lParam: 0x340001
Message: 0x101 wParam: 0xbe lParam: 0xc0340001

What Spy++ generates when the '.' key is pressed:

00130122 P WM_KEYDOWN wParam:000000BE lParam:00340001
00130122 P WM_CHAR wParam:0000002E lParam:00340001
00130122 P WM_KEYUP wParam:000000BE lParam:C0340001

(Both are the same).

But then, if I try doing the same thing for the SHIFT-1 key sequence,
I generate the following messages from my application:

Message: 0x100 wParam: 0x10 lParam: 0x2a0001
Message: 0x100 wParam: 0x31 lParam: 0x20001
Message: 0x102 wParam: 0x21 lParam: 0x20001
Message: 0x101 wParam: 0x31 lParam: 0xc0020001
Message: 0x101 wParam: 0x10 lParam: 0xc02a0001

And Spy++ generated the following:

00130122 P WM_KEYDOWN wParam:00000010 lParam:002A0001
00130122 P WM_KEYDOWN wParam:00000031 lParam:00020001
00130122 P WM_CHAR wParam:00000021 lParam:00020001
00130122 P WM_KEYUP wParam:00000031 lParam:C0020001
00130122 P WM_KEYUP wParam:00000010 lParam:C02A0001

(Both are the same again).

For an obscure reason, the application that I try to control through
those messages (Microsoft Flight Simulator 2004) does not react to the
SHIFT message, but does behave as expected for messages like the '.'
pressed. Are there other messages than keyboard messages that I should
care about for modifiers? What could be so special about the SHIFT
modifier that would make it not work? Any help is greatly appreciated.
Jul 22 '05 #1
1 5914
"incognito" <in*********@excite.com> wrote in message
news:7b**************************@posting.google.c om...
I use PostMessage
Which leads me to believe you're asking about the Windows API,
not topical for comp.lang.c++.
to drive an application by sending it keyboard
events. Messages that are sent with no modifiers are processed well.
As an example, the '.' key message sent here:

My messages:

Recognized: "Release brakes"
Message: 0x100 wParam: 0xbe lParam: 0x340001
Message: 0x102 wParam: 0x2e lParam: 0x340001
Message: 0x101 wParam: 0xbe lParam: 0xc0340001

What Spy++ generates when the '.' key is pressed:

00130122 P WM_KEYDOWN wParam:000000BE lParam:00340001
00130122 P WM_CHAR wParam:0000002E lParam:00340001
00130122 P WM_KEYUP wParam:000000BE lParam:C0340001


Yes, this is most certainly Windows stuff.
The place to ask about this is newsgroup:

comp.os.ms-windows.programmer.win32

You can get great Windows help there.

Purpose of comp.lang.c++:
http://www.slack.net/~shiva/welcome.txt
Please read that before posting here again. Thank you.

-Mike
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1424
by: R0bert Neville | last post by:
I created a simple template with common tags, which serves as a quick reference guide for my web development efforts. The web page renders great in Firefox, yet becomes a mess in IE. Please review...
2
1848
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...
15
8421
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...
12
7166
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...
2
2611
by: Lenster | last post by:
When using PostMessage to post myself a message, the msg and wparam parameters somehow get swapped over. They are in the correct order when calling PostMessage but by the time wndproc handles the...
3
5046
by: Max M. Power | last post by:
When I use the SendMessage API I can sucessfully send and receive a user defined message. When I use the PostMessage API I can NOT sucessfully send and receive the same user defined message. ...
3
9445
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...
10
2556
by: Sergei | last post by:
Can anyone explain why PostMessage to a Windows Form is considered unsafe and raises InvalidOperationException? I can get rid of that setting CheckForIllegalCrossThreadCalls to false and...
1
2942
by: Klaus Dasenbrock | last post by:
Hi, i send with PostMessage(HWND, WM_KEYDOWN, Keys.K, IntPtr.Zero) to the notepad the letter k now i wanna send with postmessage Shift+a =A, Shift++=* or Shift+1=! how can i do this with...
0
7093
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...
0
7287
Oralloy
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,...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7011
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...
1
5023
isladogs
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...
0
4689
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...
0
3180
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...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.