Thread: how to overload the windows procedure?

  1. #1
    Registered User
    Join Date
    Mar 2004

    how to overload the windows procedure?

    i want to overload the windows procedure to control ,how does application deal with the message sent. now,the development tool i used is Borland C++ Builder 6.0.You also give me the samples in another development tool.


  2. #2
    To overload the procedure just do this --

    WNDPROC OldWndProc = SetWindowLong( hwnd, GWL_PROC, (LONG)NewWndProc );
    Obviously hwnd is the window handle and OldWndProc is the old window procedure, instead of using DefWindowProc in your NewWndProc use CallWindowProc, it is the same but the first param is the OldWndProc and then it's just hwnd,msg,wParam,lParam as normal.

  3. #3
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Have a look at the WindowProc property and WndProc method in TForm.
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM