如何让我的程序在桌面启动前执行
试试这段代码,网上找的:
GetWindowPlacement(&m_OldWndpl); //保存原窗口位置
CRect WindowRect,ClientRect;
GetWindowRect(&WindowRect); //获取普通窗口位置
//获取各个控制条之外的客户区位置
RepositionBars(0,0xffff,AFX_IDW_PANE_FIRST,reposQuery,&ClientRect);
ClientToScreen(&ClientRect);
//获取屏幕分辩率
int nFullWidth=GetSystemMetrics(SM_CXSCREEN);
int nFullHeight=GetSystemMetrics(SM_CYSCREEN);
//计算全屏显示的窗口位置
m_FullScreenRect.left=WindowRect.left-ClientRect.left;
m_FullScreenRect.top=WindowRect.top-ClientRect.top;
m_FullScreenRect.right=(WindowRect.right-ClientRect.right)+nFullWidth;
m_FullScreenRect.bottom=(WindowRect.bottom-ClientRect.bottom)+nFullHeight;
m_bFullScreen=TRUE; //全屏标志
//进入全屏显示
WINDOWPLACEMENT wndpl;
wndpl.length=sizeof(WINDOWPLACEMENT);
wndpl.flags=0;
wndpl.showCmd=SW_SHOWNORMAL;
wndpl.rcNormalPosition=m_FullScreenRect;
SetWindowPlacement(&wndpl);