Search for WndProc Address

How to find the address of WndProc (windows of another process ). Even if I insert a DLL and try to find it using GetClassInfoEx () or GetWindowLong () or GetWindowLongPtr (), I always get values ​​like 0xffff08ed, which is definitely not an executable address. This corresponds to the MSDN: "... the address of the window procedure, or a handle representing the address of the window procedure."

Unfortunately, this is not enough for me, I need the actual address. Spy ++ does this work most of the time (but even sometimes it fails). So it should be possible. Thanx.


[EDIT:] Kudos to Chris Becke for providing a super fast and proper solution to my little problem!

+3
source share
2 answers

You may be at a standstill because you are asking for the wrong version of windowproc.

The Procs window, like the applications, comes in two flavors: ansi and unicode. Windows cannot return the raw pointer to the ansi window to the unicode application, or vice versa, because they will try to call it with the wrong string type.

, GetWindowLongPtr. , "" , windows api: GetWindowLongPtrA GetWindowLongPtrW. , GetWindowLongPtrA windows, , ( CallWindowProc) ansi unicode. .

, - , ansi . windowproc callWindowProc.

- , .

+4

( , !):

, GetWindowLongPtr. , "" , windows api: GetWindowLongPtrA GetWindowLongPtrW. , GetWindowLongPtrA windows, , ( CallWindowProc) ansi unicode. .

, ANSI-, IsWindowUnicode. , , GetWindowLongPtr ( ),

+1

Source: https://habr.com/ru/post/1725703/


All Articles