Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: At exit Pin
Christian Graus13-Jul-05 18:38
protectorChristian Graus13-Jul-05 18:38 
GeneralRe: At exit Pin
Toby Opferman13-Jul-05 19:37
Toby Opferman13-Jul-05 19:37 
GeneralRe: At exit Pin
Alexander M.,14-Jul-05 2:05
Alexander M.,14-Jul-05 2:05 
GeneralDocking Resizable Dialog box Pin
mlsa13-Jul-05 15:55
mlsa13-Jul-05 15:55 
GeneralRe: Docking Resizable Dialog box Pin
Stlan13-Jul-05 21:39
Stlan13-Jul-05 21:39 
GeneralRe: Docking Resizable Dialog box Pin
mlsa14-Jul-05 9:25
mlsa14-Jul-05 9:25 
GeneralRe: Docking Resizable Dialog box Pin
Stlan14-Jul-05 19:31
Stlan14-Jul-05 19:31 
GeneralDetect Ctrl key pressed Pin
Ravi Bhavnani13-Jul-05 14:00
professionalRavi Bhavnani13-Jul-05 14:00 
I'm trying to detect when the user presses Ctrl/End. My PreTranslateMsg() override always computes the Ctrl key as not being pressed. Obviously, I'm doing something wrong. A gentle nudge in the right direction would be appreciated. Smile | :)

BOOL CMyCtrl::PreTranslateMessage (MSG* pMsg) 
{
  // Check if the Ctrl key is pressed
  BYTE pressedKeys [256];
  ZeroMemory (pressedKeys, sizeof (pressedKeys));
  VERIFY (::GetKeyboardState (pressedKeys));
  bool bCtrl = (pressedKeys [VK_CONTROL] & 255) == 255;
 
  // Override handling of specific keystrokes
  if (pMsg->message == WM_KEYDOWN) {
      switch (pMsg->wParam) {
        case VK_DELETE:
          m_pModel->notifyDeleteKey();
          break;
 
        case VK_RETURN:
          m_pModel->notifyEnterKey();
          break;
 
        case VK_HOME:
        case VK_END:
        case VK_LEFT:
        case VK_RIGHT:
        case VK_UP:
        case VK_DOWN:
          m_pModel->notifyNavKey (pMsg->wParam, bCtrl);
          break;
      }
  }
 
  return CWnd::PreTranslateMessage(pMsg);
}
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib@ravib.com

GeneralRe: Detect Ctrl key pressed Pin
Christian Graus13-Jul-05 14:11
protectorChristian Graus13-Jul-05 14:11 
GeneralRe: Detect Ctrl key pressed Pin
Blake Miller14-Jul-05 4:39
Blake Miller14-Jul-05 4:39 
GeneralRe: Detect Ctrl key pressed Pin
Jack Puppy13-Jul-05 14:33
Jack Puppy13-Jul-05 14:33 
GeneralRe: Detect Ctrl key pressed Pin
Aamir Butt13-Jul-05 20:15
Aamir Butt13-Jul-05 20:15 
GeneralThanks, all! Pin
Ravi Bhavnani14-Jul-05 6:20
professionalRavi Bhavnani14-Jul-05 6:20 
GeneralWorker thread question Pin
Tom Wright13-Jul-05 12:26
Tom Wright13-Jul-05 12:26 
GeneralRe: Worker thread question Pin
Blake Miller13-Jul-05 13:00
Blake Miller13-Jul-05 13:00 
GeneralRe: Worker thread question Pin
Tom Wright14-Jul-05 5:24
Tom Wright14-Jul-05 5:24 
GeneralRe: Worker thread question Pin
Blake Miller14-Jul-05 6:18
Blake Miller14-Jul-05 6:18 
GeneralReading a .prn file Pin
bugDanny13-Jul-05 11:05
bugDanny13-Jul-05 11:05 
GeneralRe: Reading a .prn file Pin
normanS13-Jul-05 20:46
normanS13-Jul-05 20:46 
GeneralRe: Reading a .prn file Pin
bugDanny14-Jul-05 9:06
bugDanny14-Jul-05 9:06 
GeneralRe: Reading a .prn file Pin
normanS14-Jul-05 20:10
normanS14-Jul-05 20:10 
Generalcolor pallete Pin
MSaty13-Jul-05 10:15
MSaty13-Jul-05 10:15 
GeneralRe: color pallete Pin
Christian Graus13-Jul-05 12:35
protectorChristian Graus13-Jul-05 12:35 
GeneralRe: color pallete Pin
MSaty14-Jul-05 23:08
MSaty14-Jul-05 23:08 
GeneralRe: color pallete Pin
Christian Graus17-Jul-05 12:57
protectorChristian Graus17-Jul-05 12:57 

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.