Click here to Skip to main content
15,894,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Load *.ico onto Toolbar Pin
thuchv8714-Apr-10 19:44
thuchv8714-Apr-10 19:44 
Questionhow to create log file in Visual C++ ??? Pin
cb0206129-Apr-08 17:13
cb0206129-Apr-08 17:13 
AnswerRe: how to create log file in Visual C++ ??? PinPopular
_AnsHUMAN_ 29-Apr-08 19:22
_AnsHUMAN_ 29-Apr-08 19:22 
AnswerRe: how to create log file in Visual C++ ??? Pin
Hamid_RT29-Apr-08 21:35
Hamid_RT29-Apr-08 21:35 
AnswerRe: how to create log file in Visual C++ ??? Pin
David Crow30-Apr-08 3:51
David Crow30-Apr-08 3:51 
QuestionCtrl Alt F4 Pin
Christopher Duncan29-Apr-08 15:56
Christopher Duncan29-Apr-08 15:56 
AnswerRe: Ctrl Alt F4 [modified] Pin
Saurabh.Garg29-Apr-08 16:24
Saurabh.Garg29-Apr-08 16:24 
GeneralRe: Ctrl Alt F4 Pin
Christopher Duncan29-Apr-08 17:05
Christopher Duncan29-Apr-08 17:05 
Hi, Saurabh.

I looked over his code, seems to be a nice piece of work. Reviewing it put me onto keybd_event(), which is an approach I hadn't been aware of (probably because it's been superceded by the somewhat more convoluted SendInput()).

keybd_event() is pretty straightforward to use, and when I plugged in the key down and then key up calls for control, alt and F4, it worked like a charm.

For those who may be interested, here's the snippet that got it done:

<br />
// key down for ctrl, alt and F4<br />
keybd_event(VK_CONTROL,0x9d,0 , 0);<br />
keybd_event(VK_MENU,0xb8,0 , 0);<br />
keybd_event(VK_F4,0,0 , 0);<br />
<br />
// key up for ctrl, alt and F4<br />
keybd_event(VK_CONTROL,0x9d,KEYEVENTF_KEYUP,0);<br />
keybd_event(VK_MENU,0xb8,KEYEVENTF_KEYUP,0);<br />
keybd_event(VK_F4,0, KEYEVENTF_KEYUP,0);<br />


Thanks very much for taking the time to help me - I do appreciate it! Smile | :)


Christopher Duncan
Author of
The Career Programmer and Unite the Tribes
Coming soon: Got a career question? Ask the Attack Chihuahua!
www.PracticalUSA.com

GeneralRe: Ctrl Alt F4 Pin
Saurabh.Garg29-Apr-08 17:27
Saurabh.Garg29-Apr-08 17:27 
GeneralRe: Ctrl Alt F4 Pin
vijay_aroli29-Apr-08 17:47
vijay_aroli29-Apr-08 17:47 
GeneralRe: Ctrl Alt F4 Pin
Christopher Duncan29-Apr-08 19:57
Christopher Duncan29-Apr-08 19:57 
JokeRe: Ctrl Alt F4 Pin
vijay_aroli29-Apr-08 20:48
vijay_aroli29-Apr-08 20:48 
JokeRe: Ctrl Alt F4 Pin
Nelek29-Apr-08 23:12
protectorNelek29-Apr-08 23:12 
QuestionGet only focus( text should not be selected ) on MDI child while opening dynamically Pin
Member 453851029-Apr-08 12:13
Member 453851029-Apr-08 12:13 
AnswerRe: Get only focus( text should not be selected ) on MDI child while opening dynamically Pin
Member 453851029-Apr-08 15:31
Member 453851029-Apr-08 15:31 
AnswerRe: Get only focus( text should not be selected ) on MDI child while opening dynamically Pin
Yusuf29-Apr-08 15:31
Yusuf29-Apr-08 15:31 
GeneralRe: Get only focus( text should not be selected ) on MDI child while opening dynamically Pin
Member 453851029-Apr-08 15:40
Member 453851029-Apr-08 15:40 
QuestionHow to implement a dynamic panel of controls in MFC Pin
C0mendador29-Apr-08 11:24
C0mendador29-Apr-08 11:24 
AnswerRe: How to implement a dynamic panel of controls in MFC Pin
Christopher Duncan29-Apr-08 16:02
Christopher Duncan29-Apr-08 16:02 
AnswerRe: How to implement a dynamic panel of controls in MFC Pin
Rajkumar R29-Apr-08 21:20
Rajkumar R29-Apr-08 21:20 
Questionhelp with win32 Pin
worldwarIIfanatic29-Apr-08 10:44
worldwarIIfanatic29-Apr-08 10:44 
AnswerRe: help with win32 Pin
Saurabh.Garg29-Apr-08 16:12
Saurabh.Garg29-Apr-08 16:12 
AnswerRe: help with win32 Pin
CPallini29-Apr-08 21:24
mveCPallini29-Apr-08 21:24 
AnswerRe: help with win32 Pin
Hamid_RT29-Apr-08 21:52
Hamid_RT29-Apr-08 21:52 
QuestionRe: help with win32 [modified] Pin
worldwarIIfanatic30-Apr-08 13:37
worldwarIIfanatic30-Apr-08 13:37 

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.