15,976
社区成员
发帖
与我相关
我的任务
分享

void CMainFrame::OnClose()
{
// TODO: Add your message handler code here and/or call default
WINDOWPLACEMENT WndStatus;
WndStatus.length=sizeof(WINDOWPLACEMENT);
GetWindowPlacement(&WndStatus);
theApp.WriteProfileInt("WNDSTATUS","FLAG",WndStatus.flags);
theApp.WriteProfileInt("WNDSTATUS","SHOWCMD",WndStatus.showCmd);
theApp.WriteProfileInt("WNDSTATUS","LEFT",WndStatus.rcNormalPosition.left);
theApp.WriteProfileInt("WNDSTATUS","TOP",WndStatus.rcNormalPosition.top);
theApp.WriteProfileInt("WNDSTATUS","RIGHT",WndStatus.rcNormalPosition.right);
theApp.WriteProfileInt("WNDSTATUS","BOTTOM",WndStatus.rcNormalPosition.bottom);
SaveBarState(theApp.m_pszProfileName);//"HMI_man"
// left tree
int cxCur;
int cxMin;//=0
m_wndSplitter.GetColumnInfo(0,cxCur,cxMin);
theApp.WriteProfileInt("WNDSTATUS","TREEWIDTH",cxCur);
// if snap dialog still open
if(m_pSnapDlg)
{// still open
m_pSnapDlg->CloseFromMain();// delete m_pDIB
m_pSnapDlg->DestroyWindow();
if(m_pSnapDlg) delete m_pSnapDlg;
m_pSnapDlg=NULL;
}
// save connection type
SaveConnectionType();
// write com type setting
CString szStation_INF = "Station Information";
CString szEntry_NOW = "Station Selected";
CString tmp;
// write station now
tmp.Format("%d",m_StationNow);
theApp.WriteProfileString(szStation_INF,szEntry_NOW,tmp);
//
CFrameWnd::OnClose();
}
/