Thread: Making a new window from a menu option

  1. #1
    LD_Dreamer
    Guest

    Making a new window from a menu option

    I'm wondering how I can make a new window appearing after clicking on an option from a menu. Perhaps it could access a whole new window class. In theory something like:

    if(menu_ID==clicked){activate(window_ID);}

    Since I don't know much Win32, please give me the actual code for this purpose.

  2. #2
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    go to www.winprog.org. you'll benefit more than asking how to do things like [what you asked] before knowing anything else.

  3. #3
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    but anyhow, you need to handle it under WM_COMMAND. and to create a window:

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

    Code:
    case WM_COMMAND:
    			switch(LOWORD(wParam))
    			{
    				case ID_FILE_EXIT:
    					PostMessage(hwnd, WM_CLOSE, 0, 0);
    				break;
    				case ID_STUFF_WINDOW:
    					//Code here for window with the link i provided
    				break;
    			}
    //this is an example, you'll need to change it to implement it as 
    //you probably know
    Last edited by Leeman_s; 12-28-2002 at 09:13 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Window menu Probem
    By elwad in forum Windows Programming
    Replies: 5
    Last Post: 05-11-2009, 03:14 AM
  2. C or C++
    By AcerN30 in forum Game Programming
    Replies: 41
    Last Post: 05-30-2008, 06:57 PM
  3. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  4. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  5. Window menu question
    By axr0284 in forum Windows Programming
    Replies: 0
    Last Post: 03-08-2005, 09:01 AM