Thread: help popping up a box in windows

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    44

    help popping up a box in windows

    i need help to popup a message box when somebody clicks the ok cancel or the little x in the corner i dont know how to work with those buttons

  2. #2
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    int MessageBox( HWND hWnd,
    LPCTSTR lpText,
    LPCTSTR lpCaption,
    UINT uType
    );

    http://msdn.microsoft.com/library/de...messagebox.asp

    to make it popup when you hit a button: do this in your winproc:

    Code:
    switch(msg)
    {
    case WM_COMMAND:
    	switch(LOWORD(wParam))
    	{
    	case IDC_BUTTON:
    		MessageBox(hwnd,"hey!!!","you",MB_OK);
    		break;
    	}
    	break;
    }
    to make it popup when the user closes:
    Code:
    switch(msg)
    {
    case WM_CLOSE:
    case WM_DESTROY:
    	MessageBox(hwnd,"hey!!!","you",MB_OK);
    	break;
    }
    -edit-
    and this belongs more in the win32 forum....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Anyone using Windows 7?
    By Sharke in forum General Discussions
    Replies: 60
    Last Post: 07-12-2009, 08:05 AM
  2. Virtual Box
    By ssharish2005 in forum Tech Board
    Replies: 3
    Last Post: 02-12-2009, 05:08 AM
  3. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  4. Windows 98/2000 programming in Windows XP
    By Bill83 in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2005, 02:16 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM