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)取出自定义数据。
SetWindowLongPtr(hwnd, GWLP_USERDATA, userData); } break; case WM_DESTROY: { //窗口销毁时获取并使用窗口额外信息 MessageBox(NULL, L"Window is being destroyed!", L"Info", MB_OK); PostQuitMessage(0); } break; default: //默认处理窗口消息 return DefWindowProc(hwnd, uMsg, wParam, lParam); }...
ENMySQL 和 MongoDB 是两个可用于存储和管理数据的数据库管理系统。MySQL 是一个关系数据库系统,以结...
nIndex是访问窗口对象数据的索引值。比如像GWLP_USERDATA、GWLP_WNDPROC。
#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} 这段代码跟前面...
#define SetWindowLongPtrW SetWindowLongW #ifdef UNICODE #define SetWindowLongPtrSetWindowLongPtrW #else #define SetWindowLongPtrSetWindowLongPtrA #endif // !UNICODE hWnd是窗口句柄。 nIndex是访问窗口对象数据的索引值。比如像GWLP_USERDATA、GWLP_WNDPROC。
GWLP_HINSTANCE -6 设置新的应用程序实例句柄。 GWLP_ID -12 设置子窗口的新标识符。 该窗口不能是顶级窗口。 GWL_STYLE -16 设置新 窗口样式。 GWLP_USERDATA -21 设置与窗口关联的用户数据。 此数据供创建窗口的应用程序使用。 其值最初为零。 GWLP_WNDPROC -4 设置窗口过程的新地址。 当...
GWLP_USERDATA -21 设置与窗口关联的用户数据。 此数据供创建窗口的应用程序使用。 其值最初为零。 GWLP_WNDPROC -4 设置窗口过程的新地址。 当hWnd参数标识对话框时,以下值也可用。 值含义 DWLP_DLGPROC DWLP_MSGRESULT + sizeof (LRESULT) 设置指向对话框过程的新指针。
#define SetWindowLongPtrW SetWindowLongW #ifdef UNICODE #define SetWindowLongPtr SetWindowLongPtrW #else #define SetWindowLongPtr SetWindowLongPtrA #endif // !UNICODE hWnd是窗口句柄。 nIndex是访问窗口对象数据的索引值。比如像GWLP_USERDATA、GWLP_WNDPROC。 dwNewLong是设置的新值。
GWLP_ID -12 Sets a new identifier of the child window. The window cannot be a top-level window. GWL_STYLE -16 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. ...