) Getwindowlongptr Interpretation

Source: Internet
Author: User
Getwindowlongptr

This function obtains information in the specified window. You can also get the value by specifying the window memory offset.

You can use this function instead of the getwindowlong function to obtain an indicator or handle (Note: The indicator and handle are 32-bit or 64-bit windows-specific concepts ). Write a 32-bit or 64-bit Windows VersionCodeTo use this function.

Syntax:

Long_ptr getwindowlongptr (
HwndHwnd,
IntNindex
);

Parameters:

Hwnd
The handle of the window (or the class of the window) to obtain information.
Nindex
Specify a value for the information you want to obtain. It can be one of the following.
Gwl_exstyle
Obtain the extended window style. For more information, refer Createmediawex .
Gwl_style
Obtain window styles (Window styles)
Gwlp_wndproc
Get windowProgramIndicator, or a handle that describes the indicator. If you use this parameter, you must useCallwindowprocCallback function.
Gwlp_hinstance
Obtains the handle of an application instance.
Gwlp_hwndparent
If there is only one parent window, obtain the handle of the parent window.
Gwlp_id
Obtain the window identifier.
Gwlp_userdata
Obtain the data associated with the window, which is the data left to the user when the application creates a window. The initial value is 0.
Dwlp_dlgproc
Gets the indicator of a dialog box or the handle that describes the indicator. If you use this parameter, you must useCallwindowprocCallback function.

Dwlp_msgresult
Obtains the value of the processed information in a dialog box.
Dwlp_user
As an indicator or handle to obtain additional information about a private application.

return value:

if the function is successfully executed, the read value is returned.
If the execution fails, zero is returned. To obtain more extension information, call getlasterror .
If setwindowlong or setwindowlongptr is not called in advance, call the getwindowlongptr function in the extended window or class memory, and zero is returned.

For more information, see msdn.
database used: user32.dll

example:
[dllimport ("USER32", entrypoint = "getwindowlongptr")]
Public static extern intptr getwindowlongptr (
inptrt hwnd,
int nindex
);

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.