Click to See Complete Forum and Search --> : Keyboard Accelerators on Modal Dialog?
flyingcowofdoom
October 27th, 2004, 02:27 PM
Hi all. I have a modal dialog box, and I would like to be able to use keyboard shortcuts (i.e. Ctrl-P) within my dialog. I can't figure out how to do this. Does anyone know of a way?
Thanks in advance.
--Chris
kirants
October 27th, 2004, 02:46 PM
See this (http://www.codeguru.com/forum/showthread.php?t=300883&highlight=Accelerator+dialog) thread. Especially the last 2 posts.
flyingcowofdoom
October 27th, 2004, 02:54 PM
Thanks. The posts you referred me to have code that uses MFC. I do not use MFC, so I don't think this is what I am looking for. If I am wrong, please correct me.
TIA
--Chris
kirants
October 27th, 2004, 03:03 PM
If you aren't using MFC, it is still the same procedure..
In your WM_INITDIALOG handler, Load the accelerator..
In your message pump add code to do the TranslateAccelerator
Search for "Using Keyboard Accelerators" article on MSDN . It has the steps..
flyingcowofdoom
October 28th, 2004, 01:18 AM
Ah, forgive me, I forgot to mention...my dialog doesn't have a message loop. My program is a DLL that is called by another program that I cannot edit.
--Chris
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.