NO

Author Topic: How to use accelator key with a dialogbox based win32 program in C?  (Read 4147 times)

codamateur

  • Guest


ACCEL hotk={FCONTROL,VK_T,199}; (i have also tested with 't' ,'T')

switch(Message)
   {
      case WM_INITDIALOG:
                (...)
                haccel=CreateAcceleratorTable(&hotk,1);
                if(haccel==0) MessageBox(0,"error","error",MB_OK | MB_ICONERROR);
                (...)
                case WM_COMMAND:
             switch(LOWORD(wParam))
             {
                  case 199:
                  MessageBox(0,"ok","ok",MB_OK | MB_ICONERROR);
                  return 0;
                  (...)

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
        DialogBox(hInst,MAKEINTRESOURCE(DIALOG_1),0,DlgProc);
        return 0;
}

the messagebox doesnt appear when both key control +t are pressed
and CreateAcceleratorTable seems successfull

any idea?



JohnF

  • Guest
Re: How to use accelator key with a dialogbox based win32 program in C?
« Reply #1 on: August 29, 2007, 03:51:29 PM »
It's not straight forward, here is an article about the issues.

http://www.codeguru.com/cpp/w-d/dislog/tutorials/article.php/c4965/

You may find more by using Google.

John
« Last Edit: August 29, 2007, 03:57:00 PM by JohnF »