Sets the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero. 通过这个可以向指定的窗口中绑定用户自定义数据,通过GetWindowLongPtr(hwnd, GWLP_USERDATA)取出自定义数据。
LONG_PTR userData = GetWindowLongPtr(hwnd, GWLP_USERDATA); switch (uMsg) { case WM_CREATE: { //创建时设置窗口额外信息 userData = 123; //你可以设置任何你需要的值 SetWindowLongPtr(hwnd, GWLP_USERDATA, userData); } break; case WM_DESTROY: { //窗口销毁时获取并使用窗口额外信息 MessageBox(NULL...
ENMySQL 和 MongoDB 是两个可用于存储和管理数据的数据库管理系统。MySQL 是一个关系数据库系统,以结...
Sets a new window style. GWLP_USERDATA -21 Sets the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero. GWLP_WNDPROC -4 Sets a new address for the window procedure. The...
GWLP_HINSTANCE -6 设置新的应用程序实例句柄。 GWLP_ID -12 设置子窗口的新标识符。 该窗口不能是顶级窗口。 GWL_STYLE -16 设置新 窗口样式。 GWLP_USERDATA -21 设置与窗口关联的用户数据。 此数据供创建窗口的应用程序使用。 其值最初为零。 GWLP_WNDPROC -4 设置窗口过程的新地址。 当...
#define SetWindowLongPtrW SetWindowLongW #ifdef UNICODE #define SetWindowLongPtr SetWindowLongPtrW #else #define SetWindowLongPtr SetWindowLongPtrA #endif // !UNICODE hWnd是窗口句柄。 nIndex是访问窗口对象数据的索引值。比如像GWLP_USERDATA、GWLP_WNDPROC。
GWLP_USERDATA -21 设置与窗口关联的用户数据。 此数据供创建窗口的应用程序使用。 其值最初为零。 GWLP_WNDPROC -4 设置窗口过程的新地址。 当hWnd参数标识对话框时,以下值也可用。 值含义 DWLP_DLGPROC DWLP_MSGRESULT + sizeof (LRESULT) 设置指向对话框过程的新指针。
#define SetWindowLongPtrW SetWindowLongW #ifdef UNICODE #define SetWindowLongPtrSetWindowLongPtrW #else #define SetWindowLongPtrSetWindowLongPtrA #endif // !UNICODE hWnd是窗口句柄。 nIndex是访问窗口对象数据的索引值。比如像GWLP_USERDATA、GWLP_WNDPROC。
GWLP_USERDATA -21 設定與視窗相關聯的使用者資料。 此資料適用于建立視窗的應用程式。 其值一開始為零。 GWLP_WNDPROC -4 設定視窗程式的新位址。 當hWnd參數識別對話方塊時,也可以使用下列值。 值意義 DWLP_DLGPROC DWLP_MSGRESULT + sizeof (LRESULT) ...
#005intnCmdShow) #006{ #007UNREFERENCED_PARAMETER(hPrevInstance); #008UNREFERENCED_PARAMETER(lpCmdLine); #009 #010CCaiWincaiWin; #011 #012caiWin.MyRegisterClass(hInstance); #013if(!caiWin.InitInstance(hInstance,nCmdShow)) #014{ #015return0; #016} #017 #018returncaiWin.RunMessage(); #019}...