Thread: capturing window view change

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    26

    capturing window view change

    is there any way to know when a window is repainted? I assume i should capture wm_paint messages or maybe somehow EndPaint() function (i think this would be better). So, does anyone know any methods for this?

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    What window?
    If it's yours, yeah, just add the capture code right before you end your WM_PAINT case.
    If you're talking about a different process, then you're going to have to hook the process' address space, then change the DLL import table to hook EndPaint, then have the code send the notification back to your process. If you're relativity new to C++, then this is going to be a very difficult task.

  3. #3
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    That's a pretty extreme solution, the usual way is to inject into the process and subclass the window.

  4. #4
    Registered User
    Join Date
    Jan 2009
    Posts
    26
    thanks, setting a global hook works for me fine, because i want to detect evey paint message of all running windows

  5. #5
    Registered User
    Join Date
    Apr 2006
    Posts
    137
    If you are in the same program, then yes you check the WM_PAINT being sent to the program. However, in a separate program, you'll have to do some DLL injection or Hooking probably.
    ★ Inferno provides Programming Tutorials in a variety of languages. Join our Programming Forums. ★

  6. #6
    Registered User
    Join Date
    Jan 2009
    Posts
    26
    wm_paint works fine for all windows except menus and pop up menus, what messages are sent when a menu is redrawn? win api documentation says it is WM_DRAWITEM but i've done some research and i didnt find that this message would be sent to any window that uses menus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. creating a child window
    By rakan in forum Windows Programming
    Replies: 2
    Last Post: 01-23-2007, 03:22 PM
  2. input/output
    By dogbert234 in forum Windows Programming
    Replies: 11
    Last Post: 01-26-2005, 06:57 AM
  3. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. Winamp Vis if anyone can help
    By Unregistered in forum Windows Programming
    Replies: 6
    Last Post: 01-27-2002, 12:43 AM