15,979
社区成员
发帖
与我相关
我的任务
分享
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
XInitXCGUI();
int style=XC_SY_DEFAULT&~XC_SY_DRAW_CAPTION_ICON;
style&=~XC_SY_DRAW_CAPTION_TITLE;
//创建窗口
HWINDOW hWindow=XWnd_CreateWindow(0,0,WINDOW_WIDTH,WINDOW_HEIGHT,L"炫彩界面库-窗口",NULL,style);
XWnd_EnableDragWindow(hWindow,true);
XWnd_SetBorderSize(hWindow,3,3,3,3);
XWnd_SetRoundSize(hWindow,9);
XWnd_SetCaptionHeight(hWindow,22);
XWnd_SetMinWidth(hWindow,250);
XWnd_SetMinHeight(hWindow,300);
XWnd_EnableBorderStrokeInner(hWindow,false);
XWnd_EnableBorderStrokeOuter(hWindow,false);
LoadImageRes(); //加载图片资源
//窗口背景图片
XWnd_SetImageNC(hWindow,image_res.image_bk);
//关闭按钮
HELE hClose=XWnd_GetButtonClose(hWindow);
HandleButton_Close(hClose);
//最大化按钮
HELE hMax=XWnd_GetButtonMax(hWindow);
HandleButton_Max(hMax);
//最小化按钮
HELE hMin=XWnd_GetButtonMin(hWindow);
HandleButton_Min(hMin);
//天气
CreateWeatherButton(hWindow);
//头像
HELE hFace=XBtn_Create(10,0,48,48,NULL,hWindow);
XBtn_EnableCursorHand(hFace,true);
HandleButton_Face(hFace);
//状态
HELE hUserState=XBtn_Create(60,0,32,22,NULL,hWindow);
HandleButton_UserState(hUserState);
//签名
hUserSign=XBtn_Create(60,25,WINDOW_WIDTH-60-62,20,L"签名:www.xcgui.com",hWindow);
HandleButton_UserSign(hUserSign);
//搜索框
hSearchEdit=XEdit_Create(1,73,WINDOW_WIDTH-8,26,hWindow);
HandleEdit_Search(hSearchEdit);
//创建工具按钮
HandleCreateToolButton(hWindow);
//主菜单按钮
HandleCreateMainMenuButton(hWindow);
//创建左边工具面板
HandleCreateLeftPane(hWindow);
//tab页
HandleCreateMainTab(hWindow);
XWnd_Adjust(hWindow);
XWnd_RegisterNCMessage(hWindow,XWM_NCENDPAINT,OnWndNCEndDrawWindow);
XWnd_RegisterMessage(hWindow,WM_SIZE,OnWndSize);
XWnd_RegisterMessage(hWindow,WM_DESTROY,OnWndDestroy);
XWnd_ShowWindow(hWindow,SW_SHOW);
XRunXCGUI();
return 0;
}