[Windows Development] messages intercept the use of GetWindowLong and SetWindowLong

Source: Internet
Author: User

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.
Gwl_wndproc (-4) 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.
12345 LONGSetWindowLong(HWNDhWnd,//handletowindowint nlndex,//offsetofvaluetosetLONGdwNewLong//newvalue);
NlndexSpecifies an offset value that will be set greater than or equal to 0.
Gwl_wndproc -4 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

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.