void Create() { m_hWindow = (HWINDOW)XC_LoadLayout(L"广告窗口\\Layout.xml"); m_hStaticText = XC_GetObjectByID(2000); XWnd_AdjustLayout(m_hWindow); RECT rcWorkAre; SystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID) &rcWorkAre, 0); RECT rtClient; XWnd_GetClientRect(m_hWindow,&rtClient); SetAdText(L"我是大色秘密\r\n我是中色秘密\r\n我是小色秘密"); MoveWindow( XWnd_GetHWND(m_hWindow), rcWorkAre.right-rtClient.right, rcWorkAre.bottom-rtClient.bottom, rtClient.right, rtClient.bottom,TRUE); XWnd_RegEventCPP(m_hWindow,WM_TIMER,&CPopWindow::OnWndTimer); XWnd_RegEventCPP(m_hWindow,WM_DESTROY ,&CPopWindow::OnWndDestroy); XWnd_SetTimer(m_hWindow,110,30*1000); XWnd_ShowWindow(m_hWindow,SW_SHOW); }
BOOL CALLBACK DateTimeWnd_OnDrawWindow(HWINDOW hWindow,HDRAW hDraw) { RECT rect; XWnd_GetClientRect(hWindow,&rect); HBRUSH hBrush=XDraw_CreateSolidBrush_(hDraw,RGB(128,128,128)); XDraw_FrameRect_(hDraw,&rect,hBrush); //DeleteObject(hBrush); return TRUE; }
void Cell_OnSize_FloatWnd(layoutCell_ *pCell,HWINDOW hWindow) //浮动窗口调整 { XWnd_GetClientRect(hWindow,&pCell->rect); if(cell_type_group==pCell->type) { Cell_OnSize_FloatWnd_Group(pCell); }else if(cell_type_pane==pCell->type) { Cell_OnSize_FloatWnd_Pane(pCell); } }
void Cell_OnSize(layoutCell_ *pCell,HWINDOW hWindow,BOOL bFixedSize) //调整坐标 { if(NULL==pCell) return ; int type=XC_GetObjectType(hWindow); if(XC_FRAMEWND==type) { if(NULL==pCell->pParentCell) { if(FALSE==Cell_IsChildInLayout(pCell)) return ; XWnd_GetClientRect(hWindow,&pCell->rect); frameWnd_ *pFrame=(frameWnd_*)hWindow; if(pFrame->hPierLeft) pCell->rect.left=((ele_*)pFrame->hPierLeft)->rect.right; if(pFrame->hPierTop) pCell->rect.top=((ele_*)pFrame->hPierTop)->rect.bottom; if(pFrame->hPierRight) pCell->rect.right=((ele_*)pFrame->hPierRight)->rect.left; if(pFrame->hPierBottom) pCell->rect.bottom=((ele_*)pFrame->hPierBottom)->rect.top; Cell_OnSize2(pCell, hWindow,TRUE,bFixedSize); } }else if(XC_FLOATWND==type) { // XWnd_GetClientRect(hWindow,&pCell->rect); // Cell_OnSize2(pCell, hWindow,TRUE); } }