help popping up a box in windows

This is a discussion on help popping up a box in windows within the C++ Programming forums, part of the General Programming Boards category; i need help to popup a message box when somebody clicks the ok cancel or the little x in the ...

  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
    University of Waterloo
    Posts
    1,904
    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, 09: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, 03:16 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21