Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Vista: CXTPTaskDialog::PreTranslateMessage problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Vista: CXTPTaskDialog::PreTranslateMessage problem

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Vista: CXTPTaskDialog::PreTranslateMessage problem
    Posted: 08 October 2008 at 11:31am
CMyTaskDialog dlg;
dlg.DoModal(FALSE);
 
In XP, the code below works. In Vista, it does not. What could be wrong?!
 
BOOL CMyTaskDialog::PreTranslateMessage(MSG* pMsg)
{
 if (pMsg->message == WM_KEYDOWN)
 {
  if (GetKeyState(VK_CONTROL) & 0x8000)
  {
   // Ctrl+C and Ctrl+Insert should copy the message text to the Clipboard.
   if (pMsg->wParam == 'C' || pMsg->wParam == VK_INSERT)
   {
    CopyToClipboard();
   }
  }
 }

 return CXTPTaskDialog::PreTranslateMessage(pMsg);
}

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 09 October 2008 at 1:26am
If you set Breakpoint inside first 'If' its executed ? if outside ?
replace
 
if (GetKeyState(VK_CONTROL) & 0x8000)
to
if (GetKeyState(VK_CONTROL) < 0)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2008 at 3:29am
Thanks for your reply. The problem was on our side (I had no access to a Vista machine so I could not debug this immediately).
 
Anyway, you should not rely on the return value from GlobalUnlock() in Vista =)
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2008 at 6:28am
:) ok
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.