Thread: MDI Problem

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    215

    MDI Problem

    Ok, Im having trouble creating my MDI form. Everywhere I search on the net, it has something to do with a mennu item, but what i wanna do is the user click a button, and another window comes up. So anyways on this site, it had this in the WM_CREATE of the MainWndProc()

    Code:
    CLIENTCREATESTRUCT ccs;
    
        ccs.hWindowMenu  = GetSubMenu(GetMenu(hwnd), 2);
        ccs.idFirstChild = ID_MDI_FIRSTCHILD;
    
        g_hMDIClient = CreateWindowEx(WS_EX_CLIENTEDGE, "mdiclient", NULL,
            WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL | WS_VISIBLE,
            CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
            hwnd, (HMENU)IDC_MAIN_MDI, GetModuleHandle(NULL), (LPVOID)&ccs);
    I'm wondering what to do about ccs.hWindowMenu, and also where we create the window, (HMENU)IDC_MAIN_MDI. Right now Ive tried to add everything I could to my form, but when I click the button nothing happens, and also, when the window loads, its like part of it didnt load, i mean i can see through it or something, I dont know if you know what i mean. and if i move everything around the controls leave imprints of itself on parts of the form. Anyways, i hope someone can help.

    Thanks

  2. #2
    Registered User
    Join Date
    May 2004
    Posts
    215
    I just figured out that when making my main form, when i type in WS_CLIPCHILDREN, it makes my form for some reason look weird, but when i took it out, it looks fine. This is what my code was like before

    Code:
    hwnd = CreateWindowEx(
    		0,
    		g_szClassName,
    		"STP",
    		WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
    		CW_USEDEFAULT, CW_USEDEFAULT, 480, 320,
    		NULL, NULL, hInstance, NULL);
    I took out the WS_CLIPCHILDREN, and now it looks fine, but still nothing comes up when I click the button. But im thinking that WS_CLIPCHILDREN is important since Im doing an MDI. Anyways, I hope someone can help me.

    Thanks

  3. #3
    Registered User
    Join Date
    May 2004
    Posts
    215
    OK nevermind, i got it to work :-)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM