Click here to Skip to main content
15,911,039 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: hiding a console app Pin
Rage31-May-07 5:22
professionalRage31-May-07 5:22 
GeneralRe: hiding a console app Pin
toxcct31-May-07 5:24
toxcct31-May-07 5:24 
GeneralRe: hiding a console app Pin
Matthew Faithfull31-May-07 5:04
Matthew Faithfull31-May-07 5:04 
GeneralRe: hiding a console app Pin
Rage31-May-07 5:22
professionalRage31-May-07 5:22 
GeneralRe: hiding a console app Pin
Matthew Faithfull31-May-07 5:49
Matthew Faithfull31-May-07 5:49 
GeneralRe: hiding a console app Pin
tom groezer31-May-07 5:24
tom groezer31-May-07 5:24 
QuestionDisplaying help popup under the control in VC++ Pin
Merryla Martina31-May-07 3:49
Merryla Martina31-May-07 3:49 
QuestionTranslateAccelerator doubt Pin
tom groezer31-May-07 3:36
tom groezer31-May-07 3:36 
Below is the stub of code that is found on MSDN.

MSG msg;<br />
BOOL bRet;<br />
<br />
while ( (bRet = GetMessage(&msg, (HWND) NULL, 0, 0)) != 0)<br />
{<br />
    if (bRet == -1) <br />
    {<br />
        // handle the error and possibly exit<br />
    }<br />
    else<br />
    { <br />
        // Check for accelerator keystrokes. <br />
     <br />
        if (!TranslateAccelerator( <br />
                hwndMain,      // handle to receiving window <br />
                haccel,        // handle to active accelerator table <br />
                &msg))         // message data <br />
        {<br />
            TranslateMessage(&msg); <br />
            DispatchMessage(&msg); <br />
        } <br />
    } <br />
}


Please refer to the above code. The TranslateAccelerator function compares the keystokes it receives to the accelator table and if there is a match then it posts the message(WM_COMMAND and WM_SYSCOMMAND) to the the window procedure to get processes. It returns only after successful processing of the message. MSDN says that if TranslateAccelerator fails then it returns 0. In that case the above if condition is satisfies. I see a error above. Does anybody has any view on the same?

The link to the same is:-
http://msdn2.microsoft.com/en-us/library/ms646337.aspx[^]

Calling the Translate Accelerator Function
AnswerRe: TranslateAccelerator doubt Pin
toxcct31-May-07 3:40
toxcct31-May-07 3:40 
AnswerRe: TranslateAccelerator doubt Pin
Rajkumar R1-Jun-07 2:54
Rajkumar R1-Jun-07 2:54 
JokeRe: CString::Format Pin
toxcct31-May-07 3:20
toxcct31-May-07 3:20 
GeneralRe: CString::Format Pin
Rajesh R Subramanian31-May-07 3:44
professionalRajesh R Subramanian31-May-07 3:44 
GeneralRe: CString::Format Pin
Mark Salsbery31-May-07 7:15
Mark Salsbery31-May-07 7:15 
QuestionSyntax Pin
tom groezer31-May-07 3:06
tom groezer31-May-07 3:06 
AnswerRe: Syntax Pin
Rajesh R Subramanian31-May-07 3:14
professionalRajesh R Subramanian31-May-07 3:14 
GeneralRe: Syntax Pin
toxcct31-May-07 3:27
toxcct31-May-07 3:27 
AnswerRe: Syntax Pin
Roger Stoltz31-May-07 3:20
Roger Stoltz31-May-07 3:20 
GeneralRe: Syntax Pin
Rajesh R Subramanian31-May-07 3:23
professionalRajesh R Subramanian31-May-07 3:23 
GeneralRe: Syntax Pin
Roger Stoltz31-May-07 3:27
Roger Stoltz31-May-07 3:27 
GeneralRe: Syntax Pin
jhwurmbach31-May-07 4:29
jhwurmbach31-May-07 4:29 
GeneralRe: Syntax Pin
Roger Stoltz31-May-07 4:39
Roger Stoltz31-May-07 4:39 
GeneralRe: Syntax Pin
jhwurmbach31-May-07 4:45
jhwurmbach31-May-07 4:45 
QuestionRe: Syntax Pin
David Crow31-May-07 5:08
David Crow31-May-07 5:08 
AnswerRe: Syntax Pin
jhwurmbach31-May-07 5:13
jhwurmbach31-May-07 5:13 
GeneralRe: Syntax Pin
Roger Stoltz31-May-07 6:08
Roger Stoltz31-May-07 6:08 

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.