Click here to Skip to main content
15,890,947 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Replying to the OP Pin
Rajesh R Subramanian19-Sep-11 21:20
professionalRajesh R Subramanian19-Sep-11 21:20 
AnswerRe: Can a VC++ application be converted to the web? Pin
Erudite_Eric19-Sep-11 0:22
Erudite_Eric19-Sep-11 0:22 
GeneralRe: Can a VC++ application be converted to the web? Pin
Stefan_Lang19-Sep-11 0:31
Stefan_Lang19-Sep-11 0:31 
AnswerRe: Can a VC++ application be converted to the web? Pin
Orjan Westin20-Sep-11 2:28
professionalOrjan Westin20-Sep-11 2:28 
QuestionHow do I get recurring events from holding a button down? Pin
doug2518-Sep-11 7:51
doug2518-Sep-11 7:51 
AnswerRe: How do I get recurring events from holding a button down? Pin
enhzflep18-Sep-11 8:06
enhzflep18-Sep-11 8:06 
GeneralRe: How do I get recurring events from holding a button down? Pin
doug2518-Sep-11 8:49
doug2518-Sep-11 8:49 
GeneralRe: How do I get recurring events from holding a button down? Pin
enhzflep18-Sep-11 10:38
enhzflep18-Sep-11 10:38 
Since the keyboard auto-repeat, some of the 'low'-level stuff is already done.

If however, you want a button control to have auto-repeat, you'll have to set a timer yourself. I'd imagine that you would set(create) the timer when the particular button was pressed. Each time the timer is triggered, you'd check to see if the button's state indicated that it was pressed. If so, simply send yourself another WM_COMMAND message.

HOWEVER, this task is somewhat complicated by the fact that the WM_COMMAND is not sent by a button until either the mouse-button or the keyboard key that was used to press it is released, meaning that your first event is not fired until after the button is no longer pressed, hence no ability to auto-repeat.

I suspect that you'll need to create this button as a custom-control, handling both the drawing (reasonably easy using the DrawThemeBackground(sp?) function) and the keyboard/mouse handling.

Mouse handling should be pretty straight forward, using SetCapture and ReleaseCapture. You'll have to also work out which keyboard keys you want to be able to press the button too, setting the button's state to BS_PRESSED.


This sounds like about the kind of functionality that the spin-button control offers, albeit with a single button rather than a pair of them. To that end, to find a solution quickly, I'd probably start looking for code for a custom spin-button control, editing as needed to fulfil your needs.
GeneralRe: How do I get recurring events from holding a button down? Pin
doug2519-Sep-11 4:03
doug2519-Sep-11 4:03 
GeneralRe: How do I get recurring events from holding a button down? Pin
enhzflep19-Sep-11 4:12
enhzflep19-Sep-11 4:12 
GeneralRe: How do I get recurring events from holding a button down? Pin
Code-o-mat18-Sep-11 22:12
Code-o-mat18-Sep-11 22:12 
QuestionReading problem Pin
manju 317-Sep-11 18:40
manju 317-Sep-11 18:40 
AnswerRe: Reading problem Pin
Erudite_Eric17-Sep-11 20:59
Erudite_Eric17-Sep-11 20:59 
AnswerRe: Reading problem Pin
«_Superman_»18-Sep-11 4:14
professional«_Superman_»18-Sep-11 4:14 
AnswerRe: Reading problem Pin
CPallini18-Sep-11 22:01
mveCPallini18-Sep-11 22:01 
QuestionRe: Reading problem Pin
David Crow19-Sep-11 3:24
David Crow19-Sep-11 3:24 
QuestionHow to handle Column Click in a multi column list box Pin
Amrit Agr17-Sep-11 1:41
Amrit Agr17-Sep-11 1:41 
QuestionRe: How to handle Column Click in a multi column list box Pin
Richard MacCutchan17-Sep-11 3:03
mveRichard MacCutchan17-Sep-11 3:03 
AnswerRe: How to handle Column Click in a multi column list box Pin
Amrit Agr18-Sep-11 19:25
Amrit Agr18-Sep-11 19:25 
GeneralRe: How to handle Column Click in a multi column list box Pin
Richard MacCutchan18-Sep-11 23:04
mveRichard MacCutchan18-Sep-11 23:04 
GeneralRe: How to handle Column Click in a multi column list box Pin
David Crow19-Sep-11 3:26
David Crow19-Sep-11 3:26 
GeneralRe: How to handle Column Click in a multi column list box Pin
Richard MacCutchan19-Sep-11 4:00
mveRichard MacCutchan19-Sep-11 4:00 
GeneralRe: How to handle Column Click in a multi column list box Pin
David Crow19-Sep-11 4:40
David Crow19-Sep-11 4:40 
JokeRe: How to handle Column Click in a multi column list box Pin
Richard MacCutchan19-Sep-11 5:04
mveRichard MacCutchan19-Sep-11 5:04 
AnswerRe: How to handle Column Click in a multi column list box - caution long post Pin
enhzflep19-Sep-11 15:41
enhzflep19-Sep-11 15:41 

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.