Windows client development, the most annoying is the handle, with a handle, other people can send you messages.
So this time, you need to use the next GetWindowLong.
1 GetWindowLong is a Windows API function. The function obtains information about the specified window, and the function obtains a 32-bit integer value that specifies the offset address in the extra window memory.
LONG GetWindowLong (hwnd hwnd,int nlndex);
The type of information that needs to be obtained.
||Gets the address of the window procedure, or the handle of the address that represents the window procedure. You must use the CallWindowProc function to call the window procedure.
window procedure: is the place to process the message. This function can be used across processes. 2 SetWindowLong is a Windows API function. This function is used to change the properties of the specified window. The function also sets a specified 32-bit value to the specified offset of the window's extra storage space.
NlndexSpecifies an offset value that will be set greater than or equal to 0.
||Sets a new address for the window procedure.
if the window specified by the HWND parameter does not belong to the same process as the calling thread, it causes the SetWindowLong function to modify the window procedure to fail. If the process is injected, you should be aware of it. 3 so you can first GetWindowLong get old window processing function, and then through SetWindowLong after intercepting the message, then sent to the old processing function processing.
[Windows Development] messages intercept the use of GetWindowLong and SetWindowLong