capturing window view change

This is a discussion on capturing window view change within the Windows Programming forums, part of the Platform Specific Boards category; is there any way to know when a window is repainted? I assume i should capture wm_paint messages or maybe ...

  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
    1,668
    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.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  3. #3
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    611
    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, 02:22 PM
  2. input/output
    By dogbert234 in forum Windows Programming
    Replies: 11
    Last Post: 01-26-2005, 05: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-26-2002, 11:43 PM

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