MDICLIENT Problem

This is a discussion on MDICLIENT Problem within the Windows Programming forums, part of the Platform Specific Boards category; Hello all, im having this problem for 2 days now and i have stop working on these program becoz of ...

  1. #1
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204

    Question MDICLIENT Problem

    Hello all, im having this problem for 2 days now and i have stop working on these program becoz of this small problem that i cant seem to find what it is...

    whenever i maximize a child window it doesnt show the min-max-close button and the child icon from the MDI frame i dont know why

    chk this picture pls..

    http://img145.exs.cx/img145/6238/image4tu.jpg


    Source Attached
    cant upload files here


    heres the source Download
    Last edited by loko; 01-16-2005 at 04:34 AM.

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    The problem you are describing typically occurs when zero is returned from a WM_COMMAND handler instead of the return value from DefFrameProc .
    Code:
    case WM_COMMAND:
      /*your stuff*/
      return DefFrameProc(hwnd,handle_of_mdiclient,WM_COMMAND, wParam,lParam);
    For future reference, please direct your windows specific questions to the Windows Programming Board. Also, if you haven't already done so, please take some time to familiarise yourself with cprogramming's faq and the forum guidelines, a copy of which can be found as the first announcement at the top of each board.

    Welcome to cprog.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    Quote Originally Posted by Ken Fitlike
    The problem you are describing typically occurs when zero is returned from a WM_COMMAND handler instead of the return value from DefFrameProc .
    Code:
    case WM_COMMAND:
      /*your stuff*/
      return DefFrameProc(hwnd,handle_of_mdiclient,WM_COMMAND, wParam,lParam);
    For future reference, please direct your windows specific questions to the Windows Programming Board. Also, if you haven't already done so, please take some time to familiarise yourself with cprogramming's faq and the forum guidelines, a copy of which can be found as the first announcement at the top of each board.

    Welcome to cprog.
    hey thnks

    i already posted this topic to winprog forum sorry my bad its my first time here

  4. #4
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    hey ken can you help me

    heres the WM_COMMAND part...

    im calling doCommand function whenever there is WM_COMMAND message..


    PHP Code:
        void doCOMMANDHWND hwndUINT msgWPARAM wParamLPARAM lParam )
        {
            
            switch( 
    LOWORDwParam ) )
            {
                case 
    m_exit:
                    
    DestroyWindowhwnd );
                    break;

                case 
    m_about:
                    
    msgbox(hwnd,"To Do About","About");
                    break;

                case 
    m_open:
                    
    msgbox(hwnd,"To Do Open","Open");
                    break;

                case 
    m_save:
                    
    msgbox(hwnd,"To Do Save","Save");
                    break;    
                    
                
                case 
    m_find:
                    
    msgbox(hwnd,"To Do Find","Find");
                    break;

                case 
    m_print:
                    
    SendMessageGetDlgItemhwnd,mdi_id ) , WM_MDIMAXIMIZE1);

                    
    //msgbox(hwnd,"To Do Print","Print");
                    
    break;
                    
                case 
    m_new:
                    
    CreateNewMDIChildGetDlgItemhwnd,mdi_id ) );

                    break;
                    
                case 
    m_saveas:
                    
    msgbox(hwnd,"To Do Save As","Save As");
                    break;
                    
                case 
    m_undo:
                    
    msgbox(hwnd,"To Do Undo","Undo");
                    break;

                case 
    m_redo:
                    
    msgbox(hwnd,"To Do Redo","Redo");
                    break;    
                    
                case 
    m_help:
                    
    msgbox(hwnd,"To Do Help","Help");
                    break;    

                case 
    m_findreplace:
                    
    msgbox(hwnd,"To Do Find/Replace","Find/Replace");
                    break;

                case 
    m_status:
                    
    msgbox(hwnd,"To Do Status Bar","Status Bar");
                    break;

                case 
    m_toolbar:
                    
    msgbox(hwnd,"To Do Tool Bar","Tool Bar");
                    break;    
                                    
                case 
    m_gotoline:
                    
    msgbox(hwnd,"To Do Goto Line","Goto Line");
                    break;    
                    
                case 
    m_workspace:
                    
    msgbox(hwnd,"To DoWorkspace","Workspace");
                    break;    

                case 
    m_settings:
                    
    msgbox(hwnd,"To Program Settings","Workspace");
                    break;
                    
                case 
    m_execute:
                    
    msgbox(hwnd,"To Do Execute","Execute");
                    break;    

                case 
    m_font:
                    
    msgbox(hwnd,"To Do Font","Font");
                    break;    

                case 
    m_cascade:
                    
    SendMessageGetDlgItem(hwnd,mdi_id), WM_MDICASCADE0);
                    break;

                case 
    m_tilev:
                    
    SendMessageGetDlgItem(hwnd,mdi_id), WM_MDITILE1);

                    break;

                case 
    m_tileh:
                    
    SendMessageGetDlgItem(hwnd,mdi_id), WM_MDITILE0);

                    break;

                case 
    m_close:

                    
    HWND childHwnd;
                    
    childHwnd = ( HWND )SendMessageGetDlgItemhwnd,mdi_id ), WM_MDIGETACTIVE,0,);

                    if( 
    childHwnd )
                    {
                        
    SendMessagechildHwndWM_CLOSE0);                        
                    }


                    break;

                default:

                    if( 
    LOWORDwParam ) >= mdi_firstchild)
                    {
                        
    DefFrameProchwndGetDlgItemhwnd,mdi_id ), msgwParamlParam );
                    }
                    else 
                    {
        
                        
    childHwnd = ( HWND )SendMessageGetDlgItemhwnd,mdi_id ), WM_MDIGETACTIVE,0,);

                        if( 
    childHwnd )
                        {
                            
    SendMessagechildHwndWM_COMMANDwParamlParam );                        
                        }
                    }

                    break;
            }
        } 


    heres the MDICHILD proc WM_COMMAND


    PHP Code:
    void doMDICOMMANDHWND hwndUINT msgWPARAM wParamLPARAM lParam )
        {
            
            
    richedit.hwnd=GetDlgItem(hwnde_mdichild);


            switch( 
    LOWORDwParam ) )
            {
                case 
    e_mdichild:
                
    updateStatus(richedit);
                break;

                case 
    m_paste:
                
    SendDlgItemMessagehwnd,e_mdichild,WM_PASTE,0,);
                break;

                case 
    m_copy:
                
    SendDlgItemMessagehwnd,e_mdichild,WM_COPY,0,);
                break;

                case 
    m_cut:
                
    SendDlgItemMessagehwnd,e_mdichild,WM_CUT,0,);
                break;

                case 
    m_selectall:
                
    richedit.setFocus();
                
    SendMessagerichedit.hwnd,EM_SETSEL,richedit.len(),);
                break;
            }
        } 

  5. #5
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>im calling doCommand function whenever there is WM_COMMAND message<<

    Well, provided that's for the frame window then:
    Code:
    case WM_COMMAND:
      doCommand(...);
      return DefFrameProc(hwnd,handle_of_mdiclient,WM_COMMAND, wParam,lParam);
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  6. #6
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    Quote Originally Posted by Ken Fitlike
    >>im calling doCommand function whenever there is WM_COMMAND message<<

    Well, provided that's for the frame window then:
    Code:
    case WM_COMMAND:
      doCommand(...);
      return DefFrameProc(hwnd,handle_of_mdiclient,WM_COMMAND, wParam,lParam);

    yeah thats for the frame window but still didnt work

    bro can you look at the code? i hve the link above for it.. maybe to get a closer view of it... i havent program mdi before and im really hving trouble with it and cnt find the answer in msdn or anywhere...

  7. #7
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    In the file 'CodersW.cpp', in your 'MDIChildWndProc', replace the 'return 0' with
    Code:
    return DefMDIChildProc( hwnd, msg, wParam, lParam );
    to get default system message processing.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  8. #8
    Information Crocodile
    Join Date
    Dec 2004
    Posts
    204
    Quote Originally Posted by Ken Fitlike
    In the file 'CodersW.cpp', in your 'MDIChildWndProc', replace the 'return 0' with
    Code:
    return DefMDIChildProc( hwnd, msg, wParam, lParam );
    to get default system message processing.

    OMG it works

    this prob has coz me lots of time, thnks very much dude

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM

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