#include "stdafx.h" #include "DefaultDialog.h" #include DefaultDialog::DefaultDialog(UINT res_id, CWnd* pParent) : CDialog(res_id,pParent) { } void DefaultDialog::SaveToReg() { CRect rct; GetWindowRect(&rct); CString wintitle; GetWindowText(wintitle); gos_SaveDataToRegistry((char *)(LPCSTR)(wintitle+"Rect"),&rct,sizeof(rct)); int tdat(IsWindowVisible()); gos_SaveDataToRegistry((char *)(LPCSTR)(wintitle+"Visible"),&tdat,sizeof(tdat)); } void DefaultDialog::LoadFromReg() { CString wintitle; GetWindowText(wintitle); CRect rct; unsigned long size(sizeof(rct)); gos_LoadDataFromRegistry((char *)(LPCSTR)(wintitle+"Rect"),&rct,&size); if (size) { if (PreserveWidthHeightInfo() == true) { SetWindowPos(NULL,rct.left,rct.top,rct.Width(),rct.Height(),SWP_NOZORDER); } else { CRect cur_rect; GetWindowRect(&cur_rect); SetWindowPos(NULL,rct.left,rct.top,cur_rect.Width(),cur_rect.Height(),SWP_NOZORDER); } } int tdat; size=sizeof(tdat); gos_LoadDataFromRegistry((char *)(LPCSTR)(wintitle+"Visible"),&tdat,&size); if(size && tdat==0) ShowWindow(SW_HIDE); else ShowWindow(SW_SHOW); }