正在学习图形用户界面编程,为了更好的了解windows消息,就用API了。先从最简单的学起!![微笑](http://static.blog.csdn.net/xheditor/xheditor_emot/default/smile.gif)
#include <windows.h>
LRESULT CALLBACK MainWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
MSG messages;
WNDCLASSEX wcx;
HWND hwnd;
wcx.cbSize=sizeof(wcx);
wcx.style=CS_HREDRAW|CS_VREDRAW; //窗口样式
wcx.lpfnWndProc=MainWndProc; //消息处理函数
wcx.cbClsExtra=0; //指定紧跟在窗口类结构后的附加字节数
wcx.cbWndExtra=0; //指定紧跟在窗口实例的附加字节数
wcx.hInstance=hInstance; //本模块的实例句柄
wcx.hIcon = LoadIcon (NULL, IDI_APPLICATION); //图标的句柄
wcx.hCursor = LoadCursor (NULL, IDC_ARROW); //光标的句柄
wcx.hbrBackground = (HBRUSH) COLOR_MENU; //背景画刷的句柄
wcx.lpszMenuName = NULL; //指向菜单的指针
wcx.lpszClassName="test"; //要注册窗口类的类名
wcx.hIconSm = LoadIcon