win32 Application SDK窗口 WNDCLASS 自定义鼠标、图标、菜单
首先添加鼠标,图标,菜单资源,然后可以从资源ID加载
BOOL InitApplication( HINSTANCE hInstance )
{
WNDCLASS wc;
wc.cbClsExtra=0;
wc.cbWndExtra=0;
wc.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);;
//wc.hCursor=LoadCursor(NULL,IDC_ARROW);
wc.hCursor=LoadCursor(hInstance,MAKEINTRESOURCE(IDC_CURSOR_PEN));//looad cursor by resource id
//wc.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wc.hIcon=LoadIcon(hInstance,MAKEINTRESOURCE(IDI_APPLE));//load icon by resource id
wc.hInstance=hInstance;
wc.lpfnWndProc=(WNDPROC)WndProc;
wc.lpszClassName=g_szAppName;
//wc.lpszMenuName=NULL;
wc.lpszMenuName=MAKEINTRESOURCE(MENU_WIN32);//load menu by id;
wc.style=0;
return RegisterClass(&wc);
}
界面效果:
完整的代码参考:
http://blog.csdn.net/iamoyjj/archive/2011/06/06/6528100.aspx