CMakeSetupDialog.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. // pcbuilderdialogDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "CMakeSetup.h"
  5. #include "PathDialog.h"
  6. #include "CMakeSetupDialog.h"
  7. #include "../cmCacheManager.h"
  8. #include "../cmake.h"
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CAboutDlg dialog used for App About
  16. class CAboutDlg : public CDialog
  17. {
  18. public:
  19. CAboutDlg();
  20. // Dialog Data
  21. //{{AFX_DATA(CAboutDlg)
  22. enum { IDD = IDD_ABOUTBOX };
  23. //}}AFX_DATA
  24. // ClassWizard generated virtual function overrides
  25. //{{AFX_VIRTUAL(CAboutDlg)
  26. protected:
  27. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  28. //}}AFX_VIRTUAL
  29. // Implementation
  30. protected:
  31. //{{AFX_MSG(CAboutDlg)
  32. //}}AFX_MSG
  33. DECLARE_MESSAGE_MAP()
  34. };
  35. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  36. {
  37. //{{AFX_DATA_INIT(CAboutDlg)
  38. //}}AFX_DATA_INIT
  39. }
  40. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  41. {
  42. CDialog::DoDataExchange(pDX);
  43. //{{AFX_DATA_MAP(CAboutDlg)
  44. //}}AFX_DATA_MAP
  45. }
  46. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  47. //{{AFX_MSG_MAP(CAboutDlg)
  48. // No message handlers
  49. //}}AFX_MSG_MAP
  50. END_MESSAGE_MAP();
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CMakeSetupDialog dialog
  53. CMakeSetupDialog::CMakeSetupDialog(CWnd* pParent /*=NULL*/)
  54. : CDialog(CMakeSetupDialog::IDD, pParent)
  55. {
  56. m_RegistryKey = "Software\\Kitware\\CMakeSetup\\Settings\\StartPath";
  57. //{{AFX_DATA_INIT(CMakeSetupDialog)
  58. m_WhereBuild = _T("");
  59. m_WhereSource = _T("");
  60. //}}AFX_DATA_INIT
  61. // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
  62. m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  63. m_BuildPathChanged = false;
  64. // Find the path to the cmake.exe executable
  65. char fname[1024];
  66. ::GetModuleFileName(NULL,fname,1023);
  67. // extract just the path part
  68. m_PathToExecutable = cmSystemTools::GetProgramPath(fname).c_str();
  69. // add the cmake.exe to the path
  70. m_PathToExecutable += "/cmake.exe";
  71. }
  72. void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
  73. {
  74. CDialog::DoDataExchange(pDX);
  75. //{{AFX_DATA_MAP(CMakeSetupDialog)
  76. DDX_Control(pDX, IDOK, m_CancelButton);
  77. DDX_Control(pDX, IDC_MouseHelpCaption, m_MouseHelp);
  78. DDX_Control(pDX, IDC_CMAKE_VERSION, m_VersionDisplay);
  79. DDX_Control(pDX, IDC_BuildProjects, m_BuildProjects);
  80. DDX_Control(pDX, IDC_FRAME, m_ListFrame);
  81. DDX_Control(pDX, IDC_WhereSource, m_WhereSourceControl);
  82. DDX_Control(pDX, IDC_WhereBuild, m_WhereBuildControl);
  83. DDX_Control(pDX, IDC_LIST2, m_CacheEntriesList);
  84. DDX_CBString(pDX, IDC_WhereBuild, m_WhereBuild);
  85. DDX_CBString(pDX, IDC_WhereSource, m_WhereSource);
  86. //}}AFX_DATA_MAP
  87. }
  88. BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog)
  89. //{{AFX_MSG_MAP(CMakeSetupDialog)
  90. ON_WM_SYSCOMMAND()
  91. ON_WM_PAINT()
  92. ON_WM_QUERYDRAGICON()
  93. ON_BN_CLICKED(IDC_BuildProjects, OnBuildProjects)
  94. ON_CBN_EDITCHANGE(IDC_WhereBuild, OnChangeWhereBuild)
  95. ON_CBN_EDITCHANGE(IDC_WhereSource, OnChangeWhereSource)
  96. ON_CBN_SELCHANGE(IDC_WhereBuild, OnSelendokWhereBuild)
  97. ON_BN_CLICKED(IDC_BUTTON2, OnBrowseWhereSource)
  98. ON_BN_CLICKED(IDC_BUTTON3, OnBrowseWhereBuild)
  99. ON_CBN_SELENDOK(IDC_WhereSource, OnSelendokWhereSource)
  100. ON_WM_SIZE()
  101. ON_WM_GETMINMAXINFO()
  102. //}}AFX_MSG_MAP
  103. END_MESSAGE_MAP()
  104. /////////////////////////////////////////////////////////////////////////////
  105. // CMakeSetupDialog message handlers
  106. BOOL CMakeSetupDialog::OnInitDialog()
  107. {
  108. CDialog::OnInitDialog();
  109. // Add "About..." menu item to system menu.
  110. // IDM_ABOUTBOX must be in the system command range.
  111. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
  112. ASSERT(IDM_ABOUTBOX < 0xF000);
  113. CMenu* pSysMenu = GetSystemMenu(FALSE);
  114. if (pSysMenu != NULL)
  115. {
  116. CString strAboutMenu;
  117. strAboutMenu.LoadString(IDS_ABOUTBOX);
  118. if (!strAboutMenu.IsEmpty())
  119. {
  120. pSysMenu->AppendMenu(MF_SEPARATOR);
  121. pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
  122. }
  123. }
  124. // Set the icon for this dialog. The framework does this automatically
  125. // when the application's main window is not a dialog
  126. SetIcon(m_hIcon, TRUE); // Set big icon
  127. SetIcon(m_hIcon, FALSE); // Set small icon
  128. // Load source and build dirs from registry
  129. this->LoadFromRegistry();
  130. // try to load the cmake cache from disk
  131. this->LoadCacheFromDiskToGUI();
  132. m_WhereBuildControl.LimitText(2048);
  133. m_WhereSourceControl.LimitText(2048);
  134. // Set the version number
  135. char tmp[1024];
  136. sprintf(tmp,"Version %d.%d", cmMakefile::GetMajorVersion(),
  137. cmMakefile::GetMinorVersion());
  138. SetDlgItemText(IDC_CMAKE_VERSION, tmp);
  139. this->UpdateData(FALSE);
  140. return TRUE; // return TRUE unless you set the focus to a control
  141. }
  142. // About dialog invoke
  143. void CMakeSetupDialog::OnSysCommand(UINT nID, LPARAM lParam)
  144. {
  145. if ((nID & 0xFFF0) == IDM_ABOUTBOX)
  146. {
  147. CAboutDlg dlgAbout;
  148. dlgAbout.DoModal();
  149. }
  150. else
  151. {
  152. CDialog::OnSysCommand(nID, lParam);
  153. }
  154. }
  155. // If you add a minimize button to your dialog, you will need the code below
  156. // to draw the icon. For MFC applications using the document/view model,
  157. // this is automatically done for you by the framework.
  158. void CMakeSetupDialog::OnPaint()
  159. {
  160. if (IsIconic())
  161. {
  162. CPaintDC dc(this); // device context for painting
  163. SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
  164. // Center icon in client rectangle
  165. int cxIcon = GetSystemMetrics(SM_CXICON);
  166. int cyIcon = GetSystemMetrics(SM_CYICON);
  167. CRect rect;
  168. GetClientRect(&rect);
  169. int x = (rect.Width() - cxIcon + 1) / 2;
  170. int y = (rect.Height() - cyIcon + 1) / 2;
  171. // Draw the icon
  172. dc.DrawIcon(x, y, m_hIcon);
  173. }
  174. else
  175. {
  176. CDialog::OnPaint();
  177. }
  178. }
  179. // The system calls this to obtain the cursor to display while the user drags
  180. // the minimized window.
  181. HCURSOR CMakeSetupDialog::OnQueryDragIcon()
  182. {
  183. return (HCURSOR) m_hIcon;
  184. }
  185. // Browse button
  186. bool CMakeSetupDialog::Browse(CString &result, const char *title)
  187. {
  188. CPathDialog dlg("Select Path", title, result);
  189. if(dlg.DoModal()==IDOK)
  190. {
  191. result = dlg.GetPathName();
  192. return true;
  193. }
  194. else
  195. {
  196. return false;
  197. }
  198. }
  199. void CMakeSetupDialog::SaveToRegistry()
  200. {
  201. HKEY hKey;
  202. DWORD dwDummy;
  203. if(RegCreateKeyEx(HKEY_CURRENT_USER,
  204. m_RegistryKey,
  205. 0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
  206. NULL, &hKey, &dwDummy) != ERROR_SUCCESS)
  207. {
  208. return;
  209. }
  210. else
  211. {
  212. // load some values
  213. CString regvalue;
  214. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource","C:\\");
  215. if(m_WhereSource != regvalue)
  216. {
  217. regvalue = "";
  218. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource3","");
  219. RegSetValueEx(hKey, _T("WhereSource4"), 0, REG_SZ,
  220. (CONST BYTE *)(const char *)regvalue,
  221. regvalue.GetLength());
  222. regvalue = "";
  223. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource2","");
  224. RegSetValueEx(hKey, _T("WhereSource3"), 0, REG_SZ,
  225. (CONST BYTE *)(const char *)regvalue,
  226. regvalue.GetLength());
  227. regvalue = "";
  228. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource","");
  229. RegSetValueEx(hKey, _T("WhereSource2"), 0, REG_SZ,
  230. (CONST BYTE *)(const char *)regvalue,
  231. regvalue.GetLength());
  232. RegSetValueEx(hKey, _T("WhereSource"), 0, REG_SZ,
  233. (CONST BYTE *)(const char *)m_WhereSource,
  234. m_WhereSource.GetLength());
  235. }
  236. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild","C:\\");
  237. if(m_WhereBuild != regvalue)
  238. {
  239. regvalue = "";
  240. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild3","");
  241. RegSetValueEx(hKey, _T("WhereBuild4"), 0, REG_SZ,
  242. (CONST BYTE *)(const char *)regvalue,
  243. regvalue.GetLength());
  244. regvalue = "";
  245. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild2","");
  246. RegSetValueEx(hKey, _T("WhereBuild3"), 0, REG_SZ,
  247. (CONST BYTE *)(const char *)regvalue,
  248. regvalue.GetLength());
  249. regvalue = "";
  250. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild","");
  251. RegSetValueEx(hKey, _T("WhereBuild2"), 0, REG_SZ,
  252. (CONST BYTE *)(const char *)regvalue,
  253. regvalue.GetLength());
  254. RegSetValueEx(hKey, _T("WhereBuild"), 0, REG_SZ,
  255. (CONST BYTE *)(const char *)m_WhereBuild,
  256. m_WhereBuild.GetLength());
  257. }
  258. }
  259. RegCloseKey(hKey);
  260. }
  261. void CMakeSetupDialog::ReadRegistryValue(HKEY hKey,
  262. CString *val,
  263. const char *key,
  264. const char *adefault)
  265. {
  266. DWORD dwType, dwSize;
  267. char *pb;
  268. dwType = REG_SZ;
  269. pb = val->GetBuffer(MAX_PATH);
  270. dwSize = MAX_PATH;
  271. if(RegQueryValueEx(hKey,_T(key), NULL, &dwType,
  272. (BYTE *)pb, &dwSize) != ERROR_SUCCESS)
  273. {
  274. val->ReleaseBuffer();
  275. *val = _T(adefault);
  276. }
  277. else
  278. {
  279. val->ReleaseBuffer();
  280. }
  281. }
  282. void CMakeSetupDialog::LoadFromRegistry()
  283. {
  284. HKEY hKey;
  285. if(RegOpenKeyEx(HKEY_CURRENT_USER,
  286. m_RegistryKey,
  287. 0, KEY_READ, &hKey) != ERROR_SUCCESS)
  288. {
  289. return;
  290. }
  291. else
  292. {
  293. // load some values
  294. this->ReadRegistryValue(hKey, &(m_WhereSource),"WhereSource","C:\\");
  295. this->ReadRegistryValue(hKey, &(m_WhereBuild),"WhereBuild","C:\\");
  296. m_WhereSourceControl.AddString(m_WhereSource);
  297. m_WhereBuildControl.AddString(m_WhereBuild);
  298. CString regvalue;
  299. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource2","C:\\");
  300. m_WhereSourceControl.AddString(regvalue);
  301. regvalue = "";
  302. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild2","C:\\");
  303. m_WhereBuildControl.AddString(regvalue);
  304. regvalue = "";
  305. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource3","C:\\");
  306. m_WhereSourceControl.AddString(regvalue);
  307. regvalue = "";
  308. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild3","C:\\");
  309. m_WhereBuildControl.AddString(regvalue);
  310. regvalue = "";
  311. this->ReadRegistryValue(hKey, &(regvalue),"WhereSource4","C:\\");
  312. m_WhereSourceControl.AddString(regvalue);
  313. regvalue = "";
  314. this->ReadRegistryValue(hKey, &(regvalue),"WhereBuild4","C:\\");
  315. m_WhereBuildControl.AddString(regvalue);
  316. }
  317. RegCloseKey(hKey);
  318. }
  319. // Callback for browse source button
  320. void CMakeSetupDialog::OnBrowseWhereSource()
  321. {
  322. this->UpdateData();
  323. Browse(m_WhereSource, "Enter Path to Source");
  324. this->UpdateData(false);
  325. this->OnChangeWhereSource();
  326. }
  327. // Callback for browser build button
  328. void CMakeSetupDialog::OnBrowseWhereBuild()
  329. {
  330. this->UpdateData();
  331. Browse(m_WhereBuild, "Enter Path to Build");
  332. this->UpdateData(false);
  333. this->OnChangeWhereBuild();
  334. }
  335. // Callback for build projects button
  336. void CMakeSetupDialog::OnBuildProjects()
  337. {
  338. if(!cmSystemTools::FileExists(m_WhereBuild))
  339. {
  340. std::string message =
  341. "Build directory does not exist, should I create it?\n\n"
  342. "Directory: ";
  343. message += (const char*)m_WhereBuild;
  344. if(MessageBox(message.c_str(), "Create Directory", MB_OKCANCEL) == IDOK)
  345. {
  346. cmSystemTools::MakeDirectory(m_WhereBuild);
  347. }
  348. else
  349. {
  350. MessageBox("Build Project aborted, nothing done.");
  351. return;
  352. }
  353. }
  354. // set the wait cursor
  355. ::SetCursor(LoadCursor(NULL, IDC_WAIT));
  356. // get all the info from the dialog
  357. this->UpdateData();
  358. if(!m_BuildPathChanged)
  359. {
  360. // if the build path has not changed save the
  361. // current GUI values to the cache
  362. this->SaveCacheFromGUI();
  363. }
  364. // Make sure we are working from the cache on disk
  365. this->LoadCacheFromDiskToGUI();
  366. // create a cmake object
  367. cmake make;
  368. // create the arguments for the cmake object
  369. std::vector<std::string> args;
  370. args.push_back((const char*)m_PathToExecutable);
  371. std::string arg;
  372. arg = "-H";
  373. arg += m_WhereSource;
  374. args.push_back(arg);
  375. arg = "-B";
  376. arg += m_WhereBuild;
  377. args.push_back(arg);
  378. // run the generate process
  379. if(make.Generate(args) != 0)
  380. {
  381. cmSystemTools::Error(
  382. "Error in generation process, project files may be invalid");
  383. cmSystemTools::ResetErrorOccuredFlag();
  384. }
  385. // update the GUI with any new values in the caused by the
  386. // generation process
  387. this->LoadCacheFromDiskToGUI();
  388. // save source and build paths to registry
  389. this->SaveToRegistry();
  390. // path is up-to-date now
  391. m_BuildPathChanged = false;
  392. // put the cursor back
  393. ::SetCursor(LoadCursor(NULL, IDC_ARROW));
  394. }
  395. // callback for combo box menu where build selection
  396. void CMakeSetupDialog::OnSelendokWhereBuild()
  397. {
  398. m_WhereBuildControl.GetLBText(m_WhereBuildControl.GetCurSel(),
  399. m_WhereBuild);
  400. this->UpdateData(FALSE);
  401. this->OnChangeWhereBuild();
  402. }
  403. // callback for combo box menu where source selection
  404. void CMakeSetupDialog::OnSelendokWhereSource()
  405. {
  406. m_WhereSourceControl.GetLBText(m_WhereSourceControl.GetCurSel(),
  407. m_WhereSource);
  408. this->UpdateData(FALSE);
  409. this->OnChangeWhereSource();
  410. }
  411. // callback for chaing source directory
  412. void CMakeSetupDialog::OnChangeWhereSource()
  413. {
  414. }
  415. // callback for changing the build directory
  416. void CMakeSetupDialog::OnChangeWhereBuild()
  417. {
  418. this->UpdateData();
  419. std::string cachefile = m_WhereBuild;
  420. cachefile += "/CMakeCache.txt";
  421. m_CacheEntriesList.RemoveAll();
  422. if(cmSystemTools::FileExists(cachefile.c_str()))
  423. {
  424. m_CacheEntriesList.ShowWindow(SW_SHOW);
  425. this->LoadCacheFromDiskToGUI();
  426. m_BuildPathChanged = true;
  427. }
  428. }
  429. // copy from the cache manager to the cache edit list box
  430. void CMakeSetupDialog::FillCacheGUIFromCacheManager()
  431. {
  432. const cmCacheManager::CacheEntryMap &cache =
  433. cmCacheManager::GetInstance()->GetCacheMap();
  434. for(cmCacheManager::CacheEntryMap::const_iterator i = cache.begin();
  435. i != cache.end(); ++i)
  436. {
  437. const char* key = i->first.c_str();
  438. const cmCacheManager::CacheEntry& value = i->second;
  439. switch(value.m_Type )
  440. {
  441. case cmCacheManager::BOOL:
  442. if(cmCacheManager::GetInstance()->IsOn(key))
  443. {
  444. m_CacheEntriesList.AddProperty(key,
  445. "ON",
  446. value.m_HelpString.c_str(),
  447. CPropertyList::CHECKBOX,"");
  448. }
  449. else
  450. {
  451. m_CacheEntriesList.AddProperty(key,
  452. "OFF",
  453. value.m_HelpString.c_str(),
  454. CPropertyList::CHECKBOX,"");
  455. }
  456. break;
  457. case cmCacheManager::PATH:
  458. m_CacheEntriesList.AddProperty(key,
  459. value.m_Value.c_str(),
  460. value.m_HelpString.c_str(),
  461. CPropertyList::PATH,"");
  462. break;
  463. case cmCacheManager::FILEPATH:
  464. m_CacheEntriesList.AddProperty(key,
  465. value.m_Value.c_str(),
  466. value.m_HelpString.c_str(),
  467. CPropertyList::FILE,"");
  468. break;
  469. case cmCacheManager::STRING:
  470. m_CacheEntriesList.AddProperty(key,
  471. value.m_Value.c_str(),
  472. value.m_HelpString.c_str(),
  473. CPropertyList::EDIT,"");
  474. break;
  475. case cmCacheManager::INTERNAL:
  476. break;
  477. }
  478. }
  479. }
  480. // copy from the list box to the cache manager
  481. void CMakeSetupDialog::FillCacheManagerFromCacheGUI()
  482. {
  483. cmCacheManager::GetInstance()->GetCacheMap();
  484. std::set<CPropertyItem*> items = m_CacheEntriesList.GetItems();
  485. for(std::set<CPropertyItem*>::iterator i = items.begin();
  486. i != items.end(); ++i)
  487. {
  488. CPropertyItem* item = *i;
  489. cmCacheManager::CacheEntry *entry =
  490. cmCacheManager::GetInstance()->GetCacheEntry(
  491. (const char*)item->m_propName);
  492. if (entry)
  493. {
  494. entry->m_Value = item->m_curValue;
  495. }
  496. }
  497. }
  498. //! Load cache file from m_WhereBuild and display in GUI editor
  499. void CMakeSetupDialog::LoadCacheFromDiskToGUI()
  500. {
  501. if(m_WhereBuild != "")
  502. {
  503. cmCacheManager::GetInstance()->LoadCache(m_WhereBuild);
  504. this->FillCacheGUIFromCacheManager();
  505. }
  506. }
  507. //! Save GUI values to cmCacheManager and then save to disk.
  508. void CMakeSetupDialog::SaveCacheFromGUI()
  509. {
  510. this->FillCacheManagerFromCacheGUI();
  511. if(m_WhereBuild != "")
  512. {
  513. cmCacheManager::GetInstance()->SaveCache(m_WhereBuild);
  514. }
  515. }
  516. void CMakeSetupDialog::OnSize(UINT nType, int cx, int cy)
  517. {
  518. CDialog::OnSize(nType, cx, cy);
  519. if(m_CacheEntriesList.m_hWnd)
  520. {
  521. m_ListFrame.SetWindowPos(&wndTop, 0, 0, cx-28, cy-137,
  522. SWP_NOMOVE | SWP_NOZORDER);
  523. m_CacheEntriesList.SetWindowPos(&wndTop, 0, 0, cx-48, cy-168,
  524. SWP_NOMOVE | SWP_NOZORDER);
  525. m_BuildProjects.SetWindowPos(&wndTop, 143, cy-33, 0, 0,
  526. SWP_NOSIZE | SWP_NOZORDER);
  527. m_MouseHelp.SetWindowPos(&wndTop, 159, cy-57,
  528. 0, 0,
  529. SWP_NOSIZE | SWP_NOZORDER);
  530. m_CancelButton.SetWindowPos(&wndTop, 329, cy-33, 0, 0,
  531. SWP_NOSIZE | SWP_NOZORDER);
  532. m_VersionDisplay.SetWindowPos(&wndTop, 5, cy-23, 0, 0,
  533. SWP_NOSIZE | SWP_NOZORDER);
  534. }
  535. }
  536. void CMakeSetupDialog::OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI )
  537. {
  538. lpMMI->ptMinTrackSize.x = 550;
  539. lpMMI->ptMinTrackSize.y = 272;
  540. }