Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

614 lines
17 KiB

  1. /********************************************************/
  2. /* */
  3. /* */
  4. /* EUDC EDITOR ( Windows 95) */
  5. /* */
  6. /* * Japanese Version */
  7. /* * Korea Version */
  8. /* * Chinese Version */
  9. /* */
  10. /* */
  11. /* Copyright (c) 1997-1999 Microsoft Corporation. */
  12. /********************************************************/
  13. #include "stdafx.h"
  14. #include <afxpriv.h>
  15. #include "eudcedit.h"
  16. #include "mainfrm.h"
  17. #include "registry.h"
  18. #include "util.h"
  19. #include "assocdlg.h"
  20. #define STRSAFE_LIB
  21. #include <strsafe.h>
  22. #ifdef _DEBUG
  23. #undef THIS_FILE
  24. static char BASED_CODE THIS_FILE[] = __FILE__;
  25. #endif
  26. BEGIN_MESSAGE_MAP(CEudcApp, CWinApp)
  27. //{{AFX_MSG_MAP(CEudcApp)
  28. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  29. //}}AFX_MSG_MAP
  30. ON_COMMAND(ID_CONTEXT_HELP, CWinApp::OnContextHelp)
  31. END_MESSAGE_MAP()
  32. /* Global parameter */
  33. INT CAPTION_HEIGHT; // height of caption
  34. INT BITMAP_WIDTH; // width of bitmap
  35. INT BITMAP_HEIGHT; // height of bitmap
  36. TCHAR HelpPath[MAX_PATH]; // help file path
  37. TCHAR ChmHelpPath[MAX_PATH]; // help file path for HtmlHelp
  38. TCHAR FontPath[MAX_PATH]; // font file path
  39. DWORD COLOR_GRID; // grid color
  40. DWORD COLOR_FITTING; // bitmap color on show outline
  41. DWORD COLOR_CURVE; // color of outline
  42. DWORD COLOR_FACE; // Win95 3D Face SystemColor
  43. DWORD COLOR_HLIGHT; // Win95 3D HighLight System Color
  44. DWORD COLOR_SHADOW; // Win95 3D Shadow SystemColor
  45. DWORD COLOR_WIN; // Win95 Window System Color
  46. CString NotMemTtl;
  47. CString NotMemMsg;
  48. HCURSOR ToolCursor[NUMTOOL]; // cursor for tool
  49. HCURSOR ArrowCursor[NUMRESIZE]; // cursor for resize
  50. COUNTRYINFO CountryInfo; // country information structure
  51. /* Global function */
  52. extern BOOL SetCountryInfo( UINT LocalCP);
  53. BOOL g_bKeepEUDCLink = TRUE;
  54. extern "C" BOOL AnyLinkedFonts();
  55. CEudcApp NEAR theApp;
  56. /************************************************/
  57. /* */
  58. /* Default Constructor */
  59. /* */
  60. /************************************************/
  61. CEudcApp::CEudcApp()
  62. {
  63. }
  64. /************************************************/
  65. /* */
  66. /* Initialize Instance */
  67. /* */
  68. /************************************************/
  69. BOOL
  70. CEudcApp::InitInstance()
  71. {
  72. CString MainWndTitle;
  73. CRect MainWndRect;
  74. UINT MaxWndFlag;
  75. HRESULT hresult;
  76. // Check whether EUDC editor can open or not
  77. if( !CheckPrevInstance())
  78. return FALSE;
  79. //
  80. // Cicero and Cicero TIP currently does not support EUDC mode.
  81. // Use IMM32's IMEs on eudcedit.exe.
  82. //
  83. DisableCUAS();
  84. /*------------------------------------------------
  85. * check if it's Administrator
  86. *------------------------------------------------*/
  87. TCHAR winpath[MAX_PATH];
  88. HANDLE nfh;
  89. GetSystemWindowsDirectory( winpath, MAX_PATH);
  90. #ifdef IN_FONTS_DIR // CAssocDlg::OnOK()
  91. //*STRSAFE* lstrcat( winpath, TEXT("\\FONTS\\"));
  92. hresult = StringCchCat(winpath , ARRAYLEN(winpath), TEXT("\\FONTS\\"));
  93. if (!SUCCEEDED(hresult))
  94. {
  95. return FALSE;
  96. }
  97. #else
  98. //*STRSAFE* lstrcat( winpath, TEXT("\\"));
  99. hresult = StringCchCat(winpath , ARRAYLEN(winpath), TEXT("\\"));
  100. if (!SUCCEEDED(hresult))
  101. {
  102. return FALSE;
  103. }
  104. #endif // IN_FONTS_DIR
  105. //*STRSAFE* lstrcat(winpath, _T("eudcadm.tte"));
  106. hresult = StringCchCat(winpath , ARRAYLEN(winpath), _T("eudcadm.tte"));
  107. if (!SUCCEEDED(hresult))
  108. {
  109. return FALSE;
  110. }
  111. nfh = CreateFile(winpath,
  112. GENERIC_WRITE,
  113. FILE_SHARE_DELETE,
  114. NULL,
  115. CREATE_ALWAYS,
  116. FILE_ATTRIBUTE_NORMAL,
  117. NULL);
  118. if ( nfh == INVALID_HANDLE_VALUE)
  119. {
  120. HINSTANCE hInst = AfxGetInstanceHandle();
  121. TCHAR szMessage[256];
  122. LoadString(hInst, IDS_ACCESSDENIED, szMessage, sizeof(szMessage) / sizeof(TCHAR));
  123. AfxMessageBox(szMessage, MB_OK, 0);
  124. return FALSE;
  125. }
  126. else
  127. {
  128. CloseHandle(nfh);
  129. DeleteFile(winpath);
  130. }
  131. // Set background color for dialog
  132. COLOR_FACE = ::GetSysColor( COLOR_3DFACE);
  133. COLOR_HLIGHT = ::GetSysColor( COLOR_3DHILIGHT);
  134. COLOR_SHADOW = ::GetSysColor( COLOR_3DSHADOW);
  135. COLOR_WIN = ::GetSysColor( COLOR_WINDOW);
  136. // SetDialogBkColor( COLOR_FACE);
  137. // Set 3d controls
  138. Enable3dControls();
  139. // Create registry subkey
  140. if( !CreateRegistrySubkey())
  141. return FALSE;
  142. // Open "EUDCEDIT.INI", read data
  143. if( !GetProfileText( &MainWndRect, &MaxWndFlag))
  144. return FALSE;
  145. // Get Language ID with GetSystemDefaultLCID()
  146. // Get area of EUDC from registry and WideCharToMultiByte().
  147. if( !GetCountryInfo())
  148. return FALSE;
  149. #if WINVER >= 0x0500
  150. // Remember original font link status before we do anything
  151. //pliu g_bKeepEUDCLink = AnyLinkedFonts();
  152. #endif
  153. // Get Cursor from resource
  154. if( !GetCursorRes())
  155. return FALSE;
  156. // Get font and help file path
  157. if( !GetFilePath())
  158. return FALSE;
  159. // Create MDI mainFrame window
  160. MainWndTitle.LoadString( IDS_MAINFRAMETITLE);
  161. CMainFrame* pMainFrame = new CMainFrame;
  162. if (!pMainFrame->Create( MainWndTitle,
  163. WS_OVERLAPPEDWINDOW , MainWndRect,
  164. MAKEINTRESOURCE( IDR_MAINFRAME))){
  165. return FALSE;
  166. }
  167. pMainFrame->ShowWindow( m_nCmdShow);
  168. if( MaxWndFlag){
  169. pMainFrame->ShowWindow( SW_SHOWMAXIMIZED);
  170. }
  171. pMainFrame->UpdateWindow();
  172. m_pMainWnd = pMainFrame;
  173. CAssocDlg dlg(m_pMainWnd);
  174. if (!dlg.InitSystemFontAssoc())
  175. {
  176. return FALSE;
  177. }
  178. pMainFrame->m_wndGuideBar.PositionStatusPane();
  179. pMainFrame->SendMessage(WM_COMMAND, ID_READ_CHAR, NULL);
  180. return TRUE;
  181. }
  182. BOOL
  183. CEudcApp::ExitInstance()
  184. {
  185. HRESULT hresult;
  186. if (!g_bKeepEUDCLink && CountryInfo.bOnlyUnicode)
  187. {
  188. DWORD dwStart = GetTickCount();
  189. // Stop if this has taken too long
  190. while (1)
  191. {
  192. if( GetTickCount() - dwStart >= 1000 )
  193. break;
  194. }
  195. EnableEUDC(FALSE);
  196. TCHAR szDefaultFace[LF_FACESIZE];
  197. TCHAR szFontPath[MAX_PATH];
  198. TCHAR *Ptr;
  199. GetStringRes(szDefaultFace, IDS_SYSTEMEUDCFONT_STR, ARRAYLEN(szDefaultFace));
  200. if (InqTypeFace(szDefaultFace, szFontPath,MAX_PATH))
  201. {
  202. //
  203. // delete file eudc.tte
  204. //
  205. DeleteFile(szFontPath);
  206. if(( Ptr = Mytcsrchr( szFontPath, '.')) != NULL)
  207. {
  208. *Ptr = '\0';
  209. //*STRSAFE* lstrcat( szFontPath, TEXT(".EUF"));
  210. hresult = StringCchCat(szFontPath , ARRAYLEN(szFontPath), TEXT(".EUF"));
  211. if (!SUCCEEDED(hresult))
  212. {
  213. goto RET;
  214. }
  215. //
  216. // delete file eudc.euf
  217. //
  218. DeleteFile(szFontPath);
  219. }
  220. }
  221. DeleteRegistrySubkey();
  222. EnableEUDC(TRUE);
  223. }
  224. RET:
  225. return CWinApp::ExitInstance();
  226. }
  227. /************************************************/
  228. /* */
  229. /* Check whether editor can open or not */
  230. /* */
  231. /************************************************/
  232. BOOL
  233. CEudcApp::CheckPrevInstance()
  234. {
  235. HWND hWnd;
  236. TCHAR TitleBuf[50];
  237. GetStringRes(TitleBuf, IDS_MAINFRAMETITLE, ARRAYLEN(TitleBuf));
  238. // Search previous eudcedit mainframe.
  239. hWnd = ::FindWindow( NULL, TitleBuf);
  240. if( hWnd == NULL)
  241. return TRUE;
  242. else ::SetForegroundWindow( hWnd);
  243. return FALSE;
  244. }
  245. /************************************************/
  246. /* */
  247. /* disable CUAS */
  248. /* */
  249. /************************************************/
  250. void
  251. CEudcApp::DisableCUAS()
  252. {
  253. typedef BOOL (*PFNIMMDISABLETEXTFRAMESERVICE)(DWORD);
  254. PFNIMMDISABLETEXTFRAMESERVICE pfn;
  255. HMODULE hMod = LoadLibrary(TEXT("imm32.dll"));
  256. if (hMod)
  257. {
  258. pfn = (PFNIMMDISABLETEXTFRAMESERVICE)GetProcAddress(hMod,
  259. "ImmDisableTextFrameService");
  260. if (pfn)
  261. pfn(-1);
  262. }
  263. }
  264. /************************************************/
  265. /* */
  266. /* Correspond to waitting for Input */
  267. /* */
  268. /************************************************/
  269. BOOL
  270. CEudcApp::OnIdle(
  271. LONG lCount)
  272. {
  273. CWnd *pWnd;
  274. if( !lCount){
  275. for( pWnd = m_pMainWnd->GetWindow( GW_HWNDFIRST); pWnd != NULL;
  276. pWnd = pWnd->GetNextWindow( GW_HWNDNEXT)){
  277. if( m_pMainWnd == pWnd->GetParent()){
  278. if( pWnd == m_pMainWnd->GetActiveWindow() &&
  279. ( ::GetCapture() == NULL))
  280. m_pMainWnd->SetActiveWindow();
  281. pWnd->SendMessage( WM_IDLEUPDATECMDUI,
  282. (WPARAM)TRUE, 0L);
  283. }
  284. }
  285. }
  286. return CWinApp::OnIdle( lCount);
  287. }
  288. /************************************************/
  289. /* */
  290. /* Open "EUDCEDIT.INI" */
  291. /* Set parameter of EUDC Editor */
  292. /* */
  293. /************************************************/
  294. BOOL
  295. CEudcApp::GetProfileText(
  296. LPRECT MainWndRect,
  297. UINT *MaxWndFlag)
  298. {
  299. TCHAR ProfileBuf[MAX_PATH], *pString;
  300. TCHAR Separation[] = TEXT(" ,");
  301. INT xScreen , yScreen;
  302. UINT BitmapSiz;
  303. BYTE Rcolor, Gcolor, Bcolor;
  304. CString GridColor, CurvColor, FittColor, MainWnd;
  305. if (!MaxWndFlag)
  306. {
  307. return FALSE;
  308. }
  309. // Get system metrics
  310. CAPTION_HEIGHT = ::GetSystemMetrics( SM_CYCAPTION);
  311. xScreen = ::GetSystemMetrics( SM_CXSCREEN);
  312. yScreen = ::GetSystemMetrics( SM_CYSCREEN);
  313. // Read bitmapsize and maxflag
  314. BitmapSiz = this->GetProfileInt(TEXT("Bitmap"), TEXT("BitmapSize"), DEF_BITMAPSIZE);
  315. if( BitmapSiz <= 0)
  316. BitmapSiz = DEF_BITMAPSIZE;
  317. if( BitmapSiz > MAX_BITMAPSIZE)
  318. BitmapSiz = DEF_BITMAPSIZE;
  319. BitmapSiz = ((BitmapSiz + sizeof(WORD)-1)/sizeof(WORD))*sizeof(WORD);
  320. if( BitmapSiz > MAX_BITMAPSIZE)
  321. BitmapSiz = MAX_BITMAPSIZE;
  322. if( BitmapSiz < MIN_BITMAPSIZE)
  323. BitmapSiz = MIN_BITMAPSIZE;
  324. BITMAP_WIDTH = BitmapSiz;
  325. BITMAP_HEIGHT = BitmapSiz;
  326. *MaxWndFlag = this->GetProfileInt(TEXT("WindowSize"), TEXT("MinMaxFlag"), 0);
  327. // Read color
  328. GridColor = this->GetProfileString(TEXT("Color"), TEXT("Grid"), TEXT("128 128 128"));
  329. CurvColor = this->GetProfileString(TEXT("Color"), TEXT("Curve"), TEXT("255 0 0"));
  330. FittColor = this->GetProfileString(TEXT("Color"), TEXT("Fitting"), TEXT("128 128 128"));
  331. // Read grid color
  332. ConvStringRes((TCHAR *)ProfileBuf, GridColor, ARRAYLEN(ProfileBuf));
  333. if(( pString = Mytcstok( ProfileBuf, Separation)) == NULL)
  334. Rcolor = 0;
  335. else Rcolor = (BYTE)Myttoi( pString);
  336. if(( pString = Mytcstok( NULL, Separation)) == NULL)
  337. Gcolor = 0;
  338. else Gcolor = (BYTE)Myttoi( pString);
  339. if(( pString = Mytcstok( NULL, Separation)) == NULL)
  340. Bcolor = 0;
  341. else Bcolor = (BYTE)Myttoi( pString);
  342. COLOR_GRID = RGB( Rcolor, Gcolor, Bcolor);
  343. // Read outline color
  344. ConvStringRes(ProfileBuf, CurvColor,ARRAYLEN(ProfileBuf));
  345. if(( pString = Mytcstok( ProfileBuf, Separation)) == NULL)
  346. Rcolor = 0;
  347. else Rcolor = (BYTE)Myttoi( pString);
  348. if(( pString = Mytcstok( NULL, Separation)) == NULL)
  349. Gcolor = 0;
  350. else Gcolor = (BYTE)Myttoi( pString);
  351. if(( pString = Mytcstok( NULL, Separation)) == NULL)
  352. Bcolor = 0;
  353. else Bcolor = (BYTE)Myttoi( pString);
  354. COLOR_CURVE = RGB( Rcolor, Gcolor, Bcolor);
  355. // Read bitmap color in show outline
  356. ConvStringRes(ProfileBuf, FittColor,ARRAYLEN(ProfileBuf));
  357. if(( pString = Mytcstok( ProfileBuf, Separation)) == NULL)
  358. Rcolor = 0;
  359. else Rcolor = (BYTE)Myttoi( pString);
  360. if(( pString = Mytcstok( NULL, Separation)) == NULL)
  361. Gcolor = 0;
  362. else Gcolor = (BYTE)Myttoi( pString);
  363. if(( pString = Mytcstok( NULL, Separation)) == NULL)
  364. Bcolor = 0;
  365. else Bcolor = (BYTE)Myttoi( pString);
  366. COLOR_FITTING = RGB( Rcolor, Gcolor, Bcolor);
  367. // Read main window size
  368. MainWnd = this->GetProfileString(TEXT("WindowSize"),TEXT("MainWindowSize"), TEXT(""));
  369. if( *MainWnd == '\0'){
  370. MainWndRect->left = 0;
  371. MainWndRect->top = 0;
  372. MainWndRect->right = (xScreen/5)*4;
  373. MainWndRect->bottom =(yScreen/5)*4;
  374. }else{
  375. ConvStringRes(ProfileBuf, MainWnd, ARRAYLEN(ProfileBuf));
  376. pString = Mytcstok( ProfileBuf, Separation);
  377. MainWndRect->left = Myttoi( pString);
  378. pString = Mytcstok( NULL, Separation);
  379. MainWndRect->top = Myttoi( pString);
  380. pString = Mytcstok( NULL, Separation);
  381. MainWndRect->right = Myttoi( pString);
  382. pString = Mytcstok( NULL, Separation);
  383. MainWndRect->bottom = Myttoi( pString);
  384. }
  385. return TRUE;
  386. }
  387. /************************************************/
  388. /* */
  389. /* Get country information */
  390. /* */
  391. /************************************************/
  392. BOOL
  393. CEudcApp::GetCountryInfo()
  394. {
  395. UINT LocalCP;
  396. HRESULT hresult;
  397. CountryInfo.CurrentRange = 0;
  398. CountryInfo.LangID = (int)GetSystemDefaultLCID();
  399. LocalCP = GetACP();
  400. CountryInfo.bUnicodeMode = FALSE;
  401. CountryInfo.bOnlyUnicode = FALSE;
  402. switch( CountryInfo.LangID){
  403. case EUDC_JPN:
  404. CountryInfo.CharacterSet = SHIFTJIS_CHARSET;
  405. break;
  406. case EUDC_HKG:
  407. CountryInfo.LangID = EUDC_CHT;
  408. //
  409. // fall through
  410. //
  411. case EUDC_CHT:
  412. CountryInfo.CharacterSet = CHINESEBIG5_CHARSET;
  413. break;
  414. case EUDC_KRW:
  415. CountryInfo.CharacterSet = HANGEUL_CHARSET;
  416. break;
  417. case EUDC_SIN:
  418. CountryInfo.LangID = EUDC_CHS;
  419. //
  420. // Fall through
  421. //
  422. case EUDC_CHS:
  423. CountryInfo.CharacterSet = GB2312_CHARSET;
  424. break;
  425. default:
  426. CHARSETINFO csi;
  427. if (TranslateCharsetInfo((DWORD*)IntToPtr(LocalCP), &csi, TCI_SRCCODEPAGE))
  428. CountryInfo.CharacterSet = csi.ciCharset;
  429. CountryInfo.bOnlyUnicode = TRUE;
  430. CountryInfo.bUnicodeMode = TRUE;
  431. //*STRSAFE* lstrcpy(CountryInfo.szForceFont, _T("Microsoft Sans Serif"));
  432. hresult = StringCchCopy(CountryInfo.szForceFont , ARRAYLEN(CountryInfo.szForceFont), _T("Microsoft Sans Serif"));
  433. if (!SUCCEEDED(hresult))
  434. {
  435. return FALSE;
  436. }
  437. break;
  438. }
  439. if( !SetCountryInfo( LocalCP))
  440. return FALSE;
  441. else return TRUE;
  442. }
  443. /************************************************/
  444. /* */
  445. /* Get Cursor resource file */
  446. /* */
  447. /************************************************/
  448. BOOL
  449. CEudcApp::GetCursorRes()
  450. {
  451. int i;
  452. // For tool cursor
  453. ToolCursor[PEN] = this->LoadCursor(IDC_PENCIL);
  454. ToolCursor[BRUSH] = this->LoadCursor(IDC_BRUSH);
  455. ToolCursor[CIRCLE] = this->LoadStandardCursor(IDC_CROSS);
  456. ToolCursor[CIRCLEFILL] = this->LoadStandardCursor(IDC_CROSS);
  457. ToolCursor[SLOPE] = this->LoadStandardCursor(IDC_CROSS);
  458. ToolCursor[RECTBAND] = this->LoadStandardCursor(IDC_CROSS);
  459. ToolCursor[RECTFILL] = this->LoadStandardCursor(IDC_CROSS);
  460. ToolCursor[FREEFORM] = this->LoadStandardCursor(IDC_CROSS);
  461. ToolCursor[RECTCLIP] = this->LoadStandardCursor(IDC_CROSS);
  462. ToolCursor[ERASER] = this->LoadCursor(IDC_ERASER);
  463. for( i = PEN; i <= ERASER; i++){
  464. if( ToolCursor[i] == NULL){
  465. return FALSE;
  466. }
  467. }
  468. // For select rectangle cursur
  469. ArrowCursor[VERTICAL] = this->LoadStandardCursor(
  470. MAKEINTRESOURCE(IDC_SIZEWE));
  471. ArrowCursor[RIGHTSLOPE]= this->LoadStandardCursor(
  472. MAKEINTRESOURCE(IDC_SIZENESW));
  473. ArrowCursor[LEFTSLOPE] = this->LoadStandardCursor(
  474. MAKEINTRESOURCE(IDC_SIZENWSE));
  475. ArrowCursor[HORIZONTAL]= this->LoadStandardCursor(
  476. MAKEINTRESOURCE(IDC_SIZENS));
  477. ArrowCursor[ALLDIRECT] = this->LoadStandardCursor(
  478. MAKEINTRESOURCE(IDC_SIZEALL));
  479. for( i = VERTICAL; i <= ALLDIRECT; i++){
  480. if( ArrowCursor[i] == NULL){
  481. return FALSE;
  482. }
  483. }
  484. return TRUE;
  485. }
  486. /************************************************/
  487. /* */
  488. /* Get help file path */
  489. /* */
  490. /************************************************/
  491. BOOL
  492. CEudcApp::GetFilePath()
  493. {
  494. HRESULT hresult;
  495. if( !GetSystemWindowsDirectory( FontPath, MAX_PATH))
  496. return FALSE;
  497. //*STRSAFE* lstrcat(FontPath, TEXT("\\"));
  498. hresult = StringCchCat(FontPath , ARRAYLEN(FontPath), TEXT("\\"));
  499. if (!SUCCEEDED(hresult))
  500. {
  501. return FALSE;
  502. }
  503. //*STRSAFE* lstrcpy(HelpPath, FontPath);
  504. hresult = StringCchCopy(HelpPath , ARRAYLEN(HelpPath), FontPath);
  505. if (!SUCCEEDED(hresult))
  506. {
  507. return FALSE;
  508. }
  509. //*STRSAFE* lstrcpy(ChmHelpPath, FontPath);
  510. hresult = StringCchCopy(ChmHelpPath , ARRAYLEN(ChmHelpPath), FontPath);
  511. if (!SUCCEEDED(hresult))
  512. {
  513. return FALSE;
  514. }
  515. //*STRSAFE* lstrcat(HelpPath, TEXT("Help\\EUDCEDIT.HLP"));
  516. hresult = StringCchCat(HelpPath , ARRAYLEN(HelpPath), TEXT("Help\\EUDCEDIT.HLP"));
  517. if (!SUCCEEDED(hresult))
  518. {
  519. return FALSE;
  520. }
  521. //*STRSAFE* lstrcat(ChmHelpPath, TEXT("Help\\EUDCEDIT.CHM"));
  522. hresult = StringCchCat(ChmHelpPath , ARRAYLEN(ChmHelpPath), TEXT("Help\\EUDCEDIT.CHM"));
  523. if (!SUCCEEDED(hresult))
  524. {
  525. return FALSE;
  526. }
  527. NotMemTtl.LoadString( IDS_MAINFRAMETITLE);
  528. NotMemMsg.LoadString( IDS_NOTENOUGHMEMORY_ERROR);
  529. return TRUE;
  530. }
  531. /************************************************/
  532. /* */
  533. /* COMMAND "About" */
  534. /* */
  535. /************************************************/
  536. void
  537. CEudcApp::OnAppAbout()
  538. {
  539. HICON hIcon;
  540. TCHAR TitleBuf[50];
  541. hIcon = LoadIcon( IDR_MAINFRAME);
  542. GetStringRes((TCHAR *)TitleBuf, IDS_MAINFRAMETITLE, ARRAYLEN(TitleBuf));
  543. ShellAbout( m_pMainWnd->GetSafeHwnd(), TitleBuf, TEXT(""), hIcon);
  544. }