Thread: MDI msg proc

  1. #1
    Unregistered
    Guest

    MDI msg proc

    I have a Multiple Document Interface app with an edit control within one of the documents and I want it to have it's own msg procedure. How would I do this with a MDI? I'm new to the Win API so if anyone can help, that would be good.

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    63
    i think it is the same as an SDI, similar procedures.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    63
    If you dont know how to use an MSG box then here is the solution:
    AfxMessageBox("string goes here");

    make sure StdAfx.h is include in the .cpp file.
    tudehopet uses Borland Compiler 5.5
    and Visual C++ 6.

  4. #4
    Unregistered
    Guest
    i think it is the same as an SDI, similar procedures.
    It is'nt. I've tried.
    If you dont know how to use an MSG box then here is the solution:
    AfxMessageBox("string goes here");

    make sure StdAfx.h is include in the .cpp file.
    Why did you tell me that?

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    70
    WNDPROC OldEditProc;


    LRESULT CALLBACK NewEditProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
    switch (message) {
    ...
    }
    return CallWindowProc (OldEditProc, hWnd, message, wParam, lParam);
    }



    hWndEdit = GetDlgItem (/* MDI child window handle */, /* Edit window ID */);

    OldEditProc = (WNDPROC) SetWindowLong (hWndEdit, GWL_WNDPROC, (LONG) NewEditProc);




  6. #6
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Or register a seperate WNDCLASS for each child of the frame and set a different winproc in the struct.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. the handle is invalid
    By m37h0d in forum C++ Programming
    Replies: 17
    Last Post: 07-09-2008, 11:29 PM
  2. Editor design: Traditional MDI versus Tabbed MDI
    By psychopath in forum Game Programming
    Replies: 7
    Last Post: 01-22-2007, 07:48 AM
  3. Inserting text into MDI program
    By Rutabega in forum Windows Programming
    Replies: 0
    Last Post: 12-23-2005, 11:25 AM
  4. MDI Problem
    By Rare177 in forum Windows Programming
    Replies: 3
    Last Post: 04-12-2005, 01:29 PM
  5. mdi workspace
    By Elyubarov in forum Windows Programming
    Replies: 10
    Last Post: 04-03-2005, 03:40 PM