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
);