Click here to Skip to main content
16,006,605 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString and WriteFile Pin
Joan M3-Apr-03 22:14
professionalJoan M3-Apr-03 22:14 
GeneralRe: CString and WriteFile Pin
andyg.1015-Apr-03 22:15
andyg.1015-Apr-03 22:15 
Questionhow to get main explorer's url Pin
mweiss3-Apr-03 11:02
mweiss3-Apr-03 11:02 
AnswerRe: how to get main explorer's url Pin
mweiss3-Apr-03 11:39
mweiss3-Apr-03 11:39 
GeneralCatching Keys Pressed from anywhere... Pin
Nitron3-Apr-03 10:31
Nitron3-Apr-03 10:31 
GeneralRe: Catching Keys Pressed from anywhere... Pin
Alvaro Mendez3-Apr-03 10:56
Alvaro Mendez3-Apr-03 10:56 
GeneralRe: Catching Keys Pressed from anywhere... Pin
Nitron3-Apr-03 10:58
Nitron3-Apr-03 10:58 
GeneralRe: Catching Keys Pressed from anywhere... Pin
peterchen3-Apr-03 11:26
peterchen3-Apr-03 11:26 
A "global catcher" can be implemented only either in the Main message loop (MFC provides CWinApp::PreTranslateMessage for that), or, if you don#t have access to such a mechanism, by a windows hook.

(Hooks should be used only if absolutely necessary, though)

The Typical message loop looks like this:
while (GetMessage(&msg,...))
{
   TranslateMessage(&msg);  // Generate WM_CHAR from WM_KEYDOWN messages etc.
   DispatchMessage(); // dispatch msg to the window that should handle
}


the MFC message loop looks (more or less) like this:
while (GetMessage())
{
  // first call PreTranslateMessage virtual function, which you could override
  if (!PreTranslateMessage(msg))   {
    TranslataeMessage(&msg);
    DispatchMessage(&msg);
  }
}

You can implement a similar method if you're not using MFC.



Italian is a beautiful language. amare means to love, and amara bitter.

sighist | Agile Programming | doxygen

GeneralRe: Catching Keys Pressed from anywhere... Pin
valikac3-Apr-03 13:28
valikac3-Apr-03 13:28 
GeneralRe: Catching Keys Pressed from anywhere... Pin
Nitron3-Apr-03 14:05
Nitron3-Apr-03 14:05 
GeneralPing Class Pin
Tom Wright3-Apr-03 10:00
Tom Wright3-Apr-03 10:00 
GeneralDebug information crashes my app :( Pin
Anonymous3-Apr-03 8:41
Anonymous3-Apr-03 8:41 
GeneralRe: Debug information crashes my app :( Pin
Maximilien3-Apr-03 8:48
Maximilien3-Apr-03 8:48 
GeneralRe: Debug information crashes my app :( Pin
AlexO3-Apr-03 8:52
AlexO3-Apr-03 8:52 
GeneralRe: Debug information crashes my app :( Pin
rbc3-Apr-03 10:18
rbc3-Apr-03 10:18 
GeneralRe: Debug information crashes my app :( Pin
Tim Smith3-Apr-03 10:23
Tim Smith3-Apr-03 10:23 
QuestionPolygon class? Pin
Anonymous3-Apr-03 8:03
Anonymous3-Apr-03 8:03 
AnswerRe: Polygon class? Pin
Maximilien3-Apr-03 8:43
Maximilien3-Apr-03 8:43 
QuestionCan I add a menu item to Internet Explorer Pin
rdautel3-Apr-03 7:44
rdautel3-Apr-03 7:44 
AnswerRe: Can I add a menu item to Internet Explorer Pin
Chris Richardson3-Apr-03 11:39
Chris Richardson3-Apr-03 11:39 
GeneralDrawText - BUG? - When using Italic font, returns incorrect width using DT_CALCRECT Pin
noirs23-Apr-03 7:30
noirs23-Apr-03 7:30 
GeneralRe: DrawText - BUG? - When using Italic font, returns incorrect width using DT_CALCRECT Pin
Davide Pizzolato3-Apr-03 8:01
Davide Pizzolato3-Apr-03 8:01 
GeneralRe: DrawText - BUG? - When using Italic font, returns incorrect width using DT_CALCRECT Pin
noirs23-Apr-03 8:35
noirs23-Apr-03 8:35 
Generaldeclaring 2D arrays Pin
Anonymous3-Apr-03 7:13
Anonymous3-Apr-03 7:13 
GeneralRe: declaring 2D arrays Pin
Maximilien3-Apr-03 7:16
Maximilien3-Apr-03 7:16 

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.