Click here to Skip to main content
15,887,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Sockets and Port number Pin
Bill SerGio, The Infomercial King6-Mar-11 0:50
Bill SerGio, The Infomercial King6-Mar-11 0:50 
AnswerRe: Sockets and Port number Pin
Andrew Brock6-Mar-11 0:54
Andrew Brock6-Mar-11 0:54 
GeneralRe: Sockets and Port number Pin
sawerr6-Mar-11 1:36
sawerr6-Mar-11 1:36 
GeneralRe: Sockets and Port number Pin
Andrew Brock6-Mar-11 2:01
Andrew Brock6-Mar-11 2:01 
AnswerRe: Sockets and Port number Pin
Bill SerGio, The Infomercial King6-Mar-11 2:14
Bill SerGio, The Infomercial King6-Mar-11 2:14 
Questionhelp with tcl/tk in C Pin
basel-bh5-Mar-11 20:53
basel-bh5-Mar-11 20:53 
Questioncase statement in DLGPROC [SOLVED] Pin
goldenrose95-Mar-11 16:36
goldenrose95-Mar-11 16:36 
AnswerRe: case statement in DLGPROC Pin
Andrew Brock5-Mar-11 17:55
Andrew Brock5-Mar-11 17:55 
None of them are correct.

The message determines what you must do.

At the bottom of the DlgProc function there would be a call to DefWndProc() or the original window procedure.

Read the MSDN pages for what the return should be.
WM_INITDIALOG[^]: "The dialog box procedure should return TRUE to direct the system to set the keyboard focus to the control specified by wParam. Otherwise, it should return FALSE to prevent the system from setting the default keyboard focus." Generally you would break and let the default procedure take care of this, but you can return either TRUE or FALSE.
WM_COMMAND[^]: "If an application processes this message, it should return zero." implies that you should break the switch and call the original procedure if you don't handle it.
WM_CLOSE[^]: "If an application processes this message, it should return zero."

LRESULT CALLBACK DlgProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
    switch (Msg) {
        case WM_INITDIALOG:
            break; //You can do whatever here

        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_MYBUTTON:
                    return 0; //something happened to MYBUTTON
            }
            break; //We havn't handled it, use default handler

        case WM_CLOSE:
            //cleanup
            return 0;
    }
    return pOriginalProcedure(hwnd, Msg, wParam, lParam); //This is set as GetWindowLong(GWL_MSGPROC) before changing the procedure.
}

QuestionWM_COMMAND [SOLVED] Pin
goldenrose95-Mar-11 5:08
goldenrose95-Mar-11 5:08 
AnswerRe: WM_COMMAND Pin
Michael Dunn5-Mar-11 6:58
sitebuilderMichael Dunn5-Mar-11 6:58 
AnswerRe: WM_COMMAND Pin
CPallini5-Mar-11 7:37
mveCPallini5-Mar-11 7:37 
QuestionMoving GDI+ objects question Pin
csrss5-Mar-11 2:13
csrss5-Mar-11 2:13 
AnswerRe: Moving GDI+ objects question Pin
Niklas L5-Mar-11 2:42
Niklas L5-Mar-11 2:42 
GeneralRe: Moving GDI+ objects question Pin
csrss5-Mar-11 3:36
csrss5-Mar-11 3:36 
GeneralRe: Moving GDI+ objects question Pin
Niklas L5-Mar-11 5:39
Niklas L5-Mar-11 5:39 
GeneralRe: Moving GDI+ objects question Pin
csrss5-Mar-11 6:16
csrss5-Mar-11 6:16 
AnswerRe: Moving GDI+ objects question Pin
Andrew Brock5-Mar-11 2:42
Andrew Brock5-Mar-11 2:42 
GeneralRe: Moving GDI+ objects question Pin
csrss5-Mar-11 3:04
csrss5-Mar-11 3:04 
GeneralRe: Moving GDI+ objects question Pin
Andrew Brock5-Mar-11 3:09
Andrew Brock5-Mar-11 3:09 
GeneralRe: Moving GDI+ objects question Pin
csrss5-Mar-11 3:16
csrss5-Mar-11 3:16 
Question[solved] class size doesn't seem to be determined correctly [modified] Pin
Albert Holguin4-Mar-11 18:13
professionalAlbert Holguin4-Mar-11 18:13 
AnswerRe: class size doesn't seem to be determined correctly Pin
Niklas L4-Mar-11 23:14
Niklas L4-Mar-11 23:14 
GeneralRe: class size doesn't seem to be determined correctly Pin
Albert Holguin5-Mar-11 6:45
professionalAlbert Holguin5-Mar-11 6:45 
AnswerRe: class size doesn't seem to be determined correctly Pin
Ozer Karaagac4-Mar-11 23:22
professionalOzer Karaagac4-Mar-11 23:22 
GeneralRe: class size doesn't seem to be determined correctly Pin
Albert Holguin5-Mar-11 6:48
professionalAlbert Holguin5-Mar-11 6:48 

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.