#include <io.h>
class CMyWindowDemo
{
public:
HWINDOW m_hWindow;
CMyWindowDemo()
{
Init();
}
void Init()
{
char *pString=LoadFile("D:\\UITest\\resource.res");
if(pString)
{
free(pString);
}
pString=LoadFile("D:UITest\\Layout.xml");
if(pString)
{
free(pString);
}
{
XWnd_AddEle(m_hWindow,(HELE)hXCGUI);
{
m_hWindow=(HWINDOW)hXCGUI;
}else
{
}
}
char* LoadFile(const char* pFileName)
{
char *pString=NULL;
FILE *pFile=NULL;
errno_t err=fopen_s(&pFile,pFileName,"r");
if(0!=err) return NULL;
int size=_filelength(_fileno(pFile));
if(size>0)
{
pString=(char*)malloc(size+1);
int len=fread(pString,1,size,pFile);
pString[len]=0;
}
fclose(pFile);
return pString;
}
int OnBtnClickClose(BOOL *pbHandled)
{
*pbHandled=TRUE;
return 0;
}
};
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
CMyWindowDemo MyWindow;
return 0;
}
void WINAPI XExitXCGUI()
炫彩_退出 退出界面库释放资源. 不可在dllmain()中卸载, 否则会死锁
Definition: App.cpp:572
void WINAPI XRunXCGUI()
炫彩_运行 运行消息循环,当炫彩窗口数量为0时退出.
Definition: App.cpp:564
BOOL WINAPI XC_IsHWINDOW(HXCGUI hWindow)
炫彩_是否窗口 判断是否为窗口句柄.
Definition: Api.cpp:286
BOOL WINAPI XC_IsHELE(HXCGUI hEle)
炫彩_是否元素 判断是否为元素句柄.
Definition: Api.cpp:276
BOOL WINAPI XInitXCGUI(BOOL bD2D)
炫彩_初始化 初始化界面库.
Definition: App.cpp:557
BOOL WINAPI XC_LoadResourceFromString(const char *pStringXML, const wchar_t *pFileName)
炫彩_加载资源文件从字符串 加载资源文件从内存字符串.
Definition: Api.cpp:1452
HXCGUI WINAPI XC_LoadLayoutFromString(const char *pStringXML, HXCGUI hParent, HWND hAttachWnd)
炫彩_加载布局文件从字符串 加载布局文件从内存字符串.
Definition: Api.cpp:1168
void * HXCGUI
资源句柄
Definition: XCGUI.h:92
void WINAPI XWnd_AdjustLayout(HWINDOW hWindow)
窗口_调整布局 调整窗口布局, 当窗口显示状态才有效.
Definition: WindowUI.cpp:6718
void WINAPI XWnd_CloseWindow(HWINDOW hWindow)
窗口_关闭 关闭窗口.
Definition: WindowUI.cpp:6709
BOOL WINAPI XWnd_ShowWindow(HWINDOW hWindow, int nCmdShow)
@窗口_显示扩展 显示隐藏及控制窗口最大化还原等
Definition: WindowUI.cpp:6387