Click here to Skip to main content
15,914,066 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: no more console apps!! Pin
Cerb.6-Mar-03 9:55
sussCerb.6-Mar-03 9:55 
GeneralRe: no more console apps!! Pin
Nemanja Trifunovic6-Mar-03 9:38
Nemanja Trifunovic6-Mar-03 9:38 
GeneralRe: no more console apps!! Pin
Christian Graus6-Mar-03 9:45
protectorChristian Graus6-Mar-03 9:45 
GeneralRe: no more console apps!! Pin
Alvaro Mendez6-Mar-03 9:54
Alvaro Mendez6-Mar-03 9:54 
GeneralRe: no more console apps!! Pin
Blake Miller7-Mar-03 9:33
Blake Miller7-Mar-03 9:33 
GeneralRe: no more console apps!! Pin
Kuniva6-Mar-03 9:59
Kuniva6-Mar-03 9:59 
GeneralRe: no more console apps!! Pin
Anonymous6-Mar-03 10:22
Anonymous6-Mar-03 10:22 
GeneralRe: no more console apps!! Pin
Kuniva6-Mar-03 10:27
Kuniva6-Mar-03 10:27 
change this:
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)                  /* handle the messages */
    {
           case WM_DESTROY:
           PostQuitMessage(0);        /* send a WM_QUIT to the message queue */
           break;
           default:                   /* for messages that we don't deal with */
           return DefWindowProc(hwnd, message, wParam, lParam);
    }
    return 0;
}


to this:
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)                  /* handle the messages */
    {
           case WM_CREATE:
           MessageBox (NULL, "Hello world!" , "test", 0 + MB_ICONASTERISK);
           break;
           case WM_DESTROY:
           PostQuitMessage(0);        /* send a WM_QUIT to the message queue */
           break;
           default:                   /* for messages that we don't deal with */
           return DefWindowProc(hwnd, message, wParam, lParam);
    }
    return 0;
}

So you see, just use the MessageBox() function to display a message...
the case WM_CREATE stuff is there because thats how u see what kind of message was posted to the message queu, WM_CREATE is posted when your window is created, so your message would display on startup...

Kuniva
--------------------------------------------
GeneralRe: no more console apps!! Pin
Anonymous6-Mar-03 10:52
Anonymous6-Mar-03 10:52 
GeneralRe: no more console apps!! Pin
Kuniva6-Mar-03 10:58
Kuniva6-Mar-03 10:58 
GeneralRe: no more console apps!! Pin
Alvaro Mendez6-Mar-03 10:45
Alvaro Mendez6-Mar-03 10:45 
GeneralRe: no more console apps!! Pin
Anonymous6-Mar-03 10:57
Anonymous6-Mar-03 10:57 
GeneralRe: no more console apps!! Pin
Anonymous6-Mar-03 12:49
Anonymous6-Mar-03 12:49 
Questionsomething circular with #include? Pin
ns6-Mar-03 9:11
ns6-Mar-03 9:11 
AnswerRe: something circular with #include? Pin
Christian Graus6-Mar-03 9:47
protectorChristian Graus6-Mar-03 9:47 
AnswerRe: something circular with #include? Pin
Mike O'Neill6-Mar-03 16:09
Mike O'Neill6-Mar-03 16:09 
AnswerRe: something circular with #include? Pin
wimel6-Mar-03 23:45
wimel6-Mar-03 23:45 
GeneralCreateProcess( ) :o) Pin
MemLeak6-Mar-03 9:07
MemLeak6-Mar-03 9:07 
GeneralRe: CreateProcess( ) :o) Pin
MemLeak6-Mar-03 10:04
MemLeak6-Mar-03 10:04 
GeneralRe: CreateProcess( ) :o) Pin
Danny Blanchard6-Mar-03 10:09
Danny Blanchard6-Mar-03 10:09 
GeneralRe: CreateProcess( ) :o) Pin
Danny Blanchard6-Mar-03 10:10
Danny Blanchard6-Mar-03 10:10 
GeneralRe: CreateProcess( ) :o) Pin
Blake Miller7-Mar-03 9:44
Blake Miller7-Mar-03 9:44 
GeneralCustom controls in an exported DLL Pin
DREVET Olivier6-Mar-03 8:54
DREVET Olivier6-Mar-03 8:54 
GeneralRe: Custom controls in an exported DLL Pin
Bartosz Bien6-Mar-03 12:33
Bartosz Bien6-Mar-03 12:33 
GeneralRe: Custom controls in an exported DLL Pin
DREVET Olivier6-Mar-03 13:06
DREVET Olivier6-Mar-03 13:06 

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.