Click here to Skip to main content
15,914,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionChallenge: How do you determine the physical dimensions of your pixels/monitor? Pin
Tommy H D Svensson7-Nov-01 1:09
Tommy H D Svensson7-Nov-01 1:09 
AnswerRe: Challenge: How do you determine the physical dimensions of your pixels/monitor? Pin
Tomasz Sowinski7-Nov-01 1:19
Tomasz Sowinski7-Nov-01 1:19 
GeneralRe: Challenge: How do you determine the physical dimensions of your pixels/monitor? Pin
Tommy H D Svensson8-Nov-01 22:50
Tommy H D Svensson8-Nov-01 22:50 
GeneralRe: Challenge: How do you determine the physical dimensions of your pixels/monitor? Pin
Tomasz Sowinski8-Nov-01 23:03
Tomasz Sowinski8-Nov-01 23:03 
AnswerRe: Challenge: How do you determine the physical dimensions of your pixels/monitor? Pin
#realJSOP7-Nov-01 1:19
professional#realJSOP7-Nov-01 1:19 
AnswerRe: Challenge: How do you determine the physical dimensions of your pixels/monitor? Pin
#realJSOP7-Nov-01 1:29
professional#realJSOP7-Nov-01 1:29 
GeneralRe: Challenge: How do you determine the physical dimensions of your pixels/monitor? #TS Pin
Tommy H D Svensson12-Nov-01 23:11
Tommy H D Svensson12-Nov-01 23:11 
GeneralSending keystrokes to another window Pin
7-Nov-01 0:54
suss7-Nov-01 0:54 
Hi!

I've been trying to send keystrokes from say Window1 to Window2. It's easy when Window2 is the active one. However, I want to send it keystrokes even when it's not the active window. The code I've written for Window1 looks like below:

PostMessage(hWnd, WM_KEYDOWN, VK_CONTROL, MAKELPARAM(0x1, MAKEWORD(MapVirtualKey(VK_CONTROL, 0), 0x00)));
PostMessage(hWnd, WM_KEYDOWN, 'B', MAKELPARAM(0x1, MAKEWORD(MapVirtualKey('B', 0), 0x00)));
PostMessage(hWnd, WM_CHAR, 'B', MAKELPARAM(0x1, MAKEWORD(MapVirtualKey('B', 0), 0x00)));
PostMessage(hWnd, WM_KEYUP, 'B', MAKELPARAM(0x1, MAKEWORD(MapVirtualKey('B', 0), 0xC0)));
PostMessage(hWnd, WM_KEYUP, VK_CONTROL, MAKELPARAM(0x1, MAKEWORD(MapVirtualKey(VK_CONTROL, 0), 0xC0)));

The problem seems to be this - Window2 has 'Ctrl-B' defined as an accelerator. So, when one actually presses 'Ctrl-B' in Window2, the TranslateAccelerator function in Window2 translates the keystrokes to WM_COMMAND message. However, when the same keystroke sequence is sent programmatically, it doesn't get translated to WM_COMMAND.

Can someone help me out with this please.

Vijay Chauhan
GeneralRe: Sending keystrokes to another window Pin
Mukkie7-Nov-01 8:15
Mukkie7-Nov-01 8:15 
GeneralRe: Sending keystrokes to another window Pin
19-Nov-01 20:21
suss19-Nov-01 20:21 
GeneralWebBrowser.GetBusy() method Pin
Cbanwell7-Nov-01 0:00
Cbanwell7-Nov-01 0:00 
GeneralRe: WebBrowser.GetBusy() method Pin
Alvaro Mendez7-Nov-01 10:53
Alvaro Mendez7-Nov-01 10:53 
GeneralSOCKS5 Client Pin
James Spibey6-Nov-01 23:50
James Spibey6-Nov-01 23:50 
GeneralDelete a file on startup Pin
Peter Liddle6-Nov-01 23:05
Peter Liddle6-Nov-01 23:05 
GeneralRe: Delete a file on startup Pin
Michael Dunn6-Nov-01 23:13
sitebuilderMichael Dunn6-Nov-01 23:13 
Generalpositionning a MessageBox Pin
ZAZA6-Nov-01 22:15
ZAZA6-Nov-01 22:15 
GeneralRe: positionning a MessageBox Pin
Tomasz Sowinski7-Nov-01 0:51
Tomasz Sowinski7-Nov-01 0:51 
GeneralRe: positionning a MessageBox Pin
Nish Nishant7-Nov-01 0:54
sitebuilderNish Nishant7-Nov-01 0:54 
GeneralRe: positionning a MessageBox Pin
Nish Nishant7-Nov-01 0:52
sitebuilderNish Nishant7-Nov-01 0:52 
QuestionHot to get a flat frame? Pin
alton6-Nov-01 21:59
alton6-Nov-01 21:59 
GeneralSecurity challange Pin
6-Nov-01 21:39
suss6-Nov-01 21:39 
GeneralMSDN question Pin
The_Server6-Nov-01 21:03
The_Server6-Nov-01 21:03 
GeneralRe: MSDN question Pin
Steen Krogsgaard6-Nov-01 22:04
Steen Krogsgaard6-Nov-01 22:04 
GeneralRe: MSDN question Pin
Jon Hulatt6-Nov-01 22:05
Jon Hulatt6-Nov-01 22:05 
GeneralRe: MSDN question Pin
Michael P Butler6-Nov-01 22:06
Michael P Butler6-Nov-01 22:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.