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...
比如像GWLP_USERDATA、GWLP_WNDPROC。
nIndex是访问窗口对象数据的索引值。比如像GWLP_USERDATA、GWLP_WNDPROC。
#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}...
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 设置窗口过程的新地址。 当...
GWLP_ID -12 设置子窗口的新标识符。 该窗口不能是顶级窗口。 GWL_STYLE -16 设置新窗口样式。 GWLP_USERDATA -21 设置与窗口关联的用户数据。 此数据供创建窗口的应用程序使用。 其值最初为零。 GWLP_WNDPROC -4 设置窗口过程的新地址。 当hWnd参数标识对话框时,以下值也可用。
GWLP_ID -12 Sets a new identifier of the child window. The window cannot be a top-level window. GWL_STYLE -16 Sets a newwindow 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...
GWLP_ID -12 Sets a new identifier of the child window. The window cannot be a top-level window. GWL_STYLE -16 Sets a newwindow 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...
GWLP_ID -12 设置子窗口的新标识符。 该窗口不能是顶级窗口。 GWL_STYLE -16 设置新窗口样式。 GWLP_USERDATA -21 设置与窗口关联的用户数据。 此数据供创建窗口的应用程序使用。 其值最初为零。 GWLP_WNDPROC -4 设置窗口过程的新地址。 当hWnd参数标识对话框时,以下值也可用。