Thread: using a window callback function like wndproc

  1. #1
    Registered User canine's Avatar
    Join Date
    Sep 2001
    Posts
    125

    Question using a window callback function like wndproc

    is there any way you could set up a wndproc for an outside window that was found from findwindow() or enumwindows()?
    In a perfect world every dog would have a home and every home would have a dog.
    Visit My Web Site, Canine Programming
    I use Win32 API

  2. #2
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Do you mean another program's window? I'm not sure you can do that. The wndproc for that window would already be written.

    >> In a perfect world every dog would have a home and every home would have a dog. <<
    Yes! I second that!
    1978 Silver Anniversary Corvette

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Look into SetWindowLong() which you can use sometimes to change a windows wndproc.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  4. #4
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    The window would have to be part of the same process, as the memory locations of the variables in one process would be meaningless in another. You can send messages between windows, or implement hooks that trap messages before they are sent to the relevent window, look up SetWindowsHookEx(), if you want to try the latter.
    zen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. dllimport function not allowed
    By steve1_rm in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2008, 03:33 AM
  3. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  4. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM