1.回调函数声明 LRESULT CALLBACK WinSunProc... int WINAPI WinMain 创建一个窗口对象 WNDCLASS -> 对其中的数据元素赋值 -> 进行注册 RegisterClass(&...) -> 创建一个窗口句柄HWND -> HWND=creatwindow() -> ShowWindow() -> UpdateWindow() -> 创建消息 MSG -> 用while循环get消息 -> 返回 msg.wParam 3.回调函数 switch...case 语句,对接受到的不同消息进行不同的处理 未写完的 CreateWindow(,wnd,,0,0,600,400,NULL,,,,); ShowWindow(wnd,); UpdateWindow(wnd); MSG msg; BOOL bmsg;
2.主函数
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ){
WNDCLASS wnd;
wnd.cbClsExtra = ;
wnd.cbWndExtra = ;
wnd.hbrBackground = ;
wnd.hCursor = ;
wnd.hIcon = ;
wnd.hInstance = ;
wnd.lpfnWndProc = ;
wnd.lpszClassName = ;
wnd.lpszMenuName = ;
wnd.style = ;
while((bmsg=(GetMessage(&msg,wnd,0,0))!=0){
if(bmsg==-1){
return -1;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
LRESULT CALLBACK WNDSUNPROC{
switch(msg){
case WM_CHAR:
break;
case WM_LBUTTONDBLCLK:
break;
case :
break;
default:
return ;
}
};
WINAPP
最新推荐文章于 2024-11-13 15:44:28 发布