Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioni/o stream problem Pin
david bagaturia5-Oct-07 0:56
david bagaturia5-Oct-07 0:56 
QuestionRe: i/o stream problem Pin
David Crow5-Oct-07 3:36
David Crow5-Oct-07 3:36 
QuestionPressing several buttons at once Pin
vSteve5-Oct-07 0:04
vSteve5-Oct-07 0:04 
AnswerRe: Pressing several buttons at once Pin
Nishad S5-Oct-07 1:02
Nishad S5-Oct-07 1:02 
GeneralRe: Pressing several buttons at once Pin
vSteve5-Oct-07 1:12
vSteve5-Oct-07 1:12 
GeneralRe: Pressing several buttons at once Pin
Nishad S5-Oct-07 1:32
Nishad S5-Oct-07 1:32 
GeneralRe: Pressing several buttons at once Pin
Nathan Holt at EMOM5-Oct-07 5:58
Nathan Holt at EMOM5-Oct-07 5:58 
GeneralRe: Pressing several buttons at once Pin
vSteve6-Oct-07 22:23
vSteve6-Oct-07 22:23 
NS17:

Thank you, your code snippet has helped me alot. The key bit I was missing was: generation of my own button down command i.e.:

pMsg->wParam = VK_SPACE;
pMsg->hwnd = m_btn1.m_hWnd;

However, can't seem to get two buttons down at the same time.


Nathan:

Thanks for your suggestion. I now have two pushlike buttons on the dialogue and it behaves just how I want it with respect to the keyboard. But with respect to the mouse can I get the control to be true whilest the mouse is over it and the LH mouse button is down, and it returns to false when the mouse LH button is released.



I'm convinced some combination of your two solutions will get me there but after several hours work, I have got no further.


Having this dicussion has clarified my thoughts: what I need is:

A control either button or push like check box, that the rest of my app can reconise as being true or not, the control must be true only whilest the key assigned to it is pressed or the mouse button is being held down over it. If two buttons are pressed via the keyboard then both control states should be true for the duration of the press.


As some back ground: I am trying to write a simulation of a piece of hardware which has several keys. The state of which are sent regularly out over the serial port, have coded all that bit. The hardware buttons are momentary push buttons i.e. there state is high only whilst they are pressed down. So in real life the user could press more than one.

I can get the behaviour I want from the keyboard thanks to Nathan's idea, that only leaves how the control should behave in response to the mouse. Here I'd like the control to be on only when the mouse is over the control and on getting a WM_LBUTTONDOWN and the control to go off when getting the next WM_LBUTTONUP.

Any further ideas?

Kalvin
GeneralRe: Pressing several buttons at once Pin
Nathan Holt at EMOM8-Oct-07 10:30
Nathan Holt at EMOM8-Oct-07 10:30 
GeneralRe: Pressing several buttons at once Pin
vSteve8-Oct-07 23:34
vSteve8-Oct-07 23:34 
QuestionHow to avoid 3rd party frame's vestiges on my app [modified] Pin
Nelek5-Oct-07 0:01
protectorNelek5-Oct-07 0:01 
QuestionClass Variable Initialization Pin
nitin34-Oct-07 23:32
nitin34-Oct-07 23:32 
AnswerRe: Class Variable Initialization Pin
Nelek4-Oct-07 23:43
protectorNelek4-Oct-07 23:43 
GeneralRe: Class Variable Initialization Pin
nitin34-Oct-07 23:58
nitin34-Oct-07 23:58 
GeneralRe: Class Variable Initialization Pin
ThatsAlok5-Oct-07 0:46
ThatsAlok5-Oct-07 0:46 
GeneralRe: Class Variable Initialization Pin
jhwurmbach5-Oct-07 0:53
jhwurmbach5-Oct-07 0:53 
GeneralRe: Class Variable Initialization Pin
Mark Salsbery5-Oct-07 6:03
Mark Salsbery5-Oct-07 6:03 
QuestionRe: Class Variable Initialization Pin
David Crow5-Oct-07 3:39
David Crow5-Oct-07 3:39 
QuestionHow to Create Process in new Desktop Pin
GauranG Shah4-Oct-07 23:17
GauranG Shah4-Oct-07 23:17 
AnswerRe: How to Create Process in new Desktop Pin
nitin34-Oct-07 23:35
nitin34-Oct-07 23:35 
GeneralRe: How to Create Process in new Desktop Pin
GauranG Shah5-Oct-07 0:03
GauranG Shah5-Oct-07 0:03 
QuestionRe: How to Create Process in new Desktop Pin
GauranG Shah5-Oct-07 0:35
GauranG Shah5-Oct-07 0:35 
QuestionLinking Errors Pin
kiranin4-Oct-07 22:49
kiranin4-Oct-07 22:49 
AnswerRe: Linking Errors Pin
Hamid_RT4-Oct-07 23:12
Hamid_RT4-Oct-07 23:12 
AnswerRe: Linking Errors Pin
ShilpiP5-Oct-07 0:11
ShilpiP5-Oct-07 0:11 

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.