Source code of Windows XP (NT5)
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.

624 lines
16 KiB

  1. /**************************************************/
  2. /* */
  3. /* */
  4. /* Reference other characters */
  5. /* (Dialog) */
  6. /* */
  7. /* */
  8. /* Copyright (c) 1997-1999 Microsoft Corporation. */
  9. /**************************************************/
  10. #include "stdafx.h"
  11. #include "eudcedit.h"
  12. #include "refrdlg.h"
  13. #include "util.h"
  14. #ifdef _DEBUG
  15. #undef THIS_FILE
  16. static char BASED_CODE THIS_FILE[] = __FILE__;
  17. #endif
  18. BOOL CodeFocus;
  19. BOOL CharFocus;
  20. BOOL CompFinalized;
  21. CHOOSEFONT chf;
  22. extern LOGFONT ReffLogFont;
  23. extern LOGFONT EditLogFont;
  24. extern BOOL TitleFlag;
  25. static BOOL CALLBACK ComDlg32DlgProc(HWND hDlg, UINT uMsg,
  26. WPARAM wParam, LPARAM lParam);
  27. LRESULT CALLBACK EditCharProc( HWND hwnd, UINT uMsg,
  28. WPARAM wParam, LPARAM lParam);
  29. HIMC hImcCode = NULL;
  30. BEGIN_MESSAGE_MAP(CRefrDlg, CDialog)
  31. //{{AFX_MSG_MAP(CRefrDlg)
  32. ON_BN_CLICKED(IDC_BUTTOMFONT, OnClickedButtomfont)
  33. ON_EN_CHANGE(IDC_EDITCODE, OnChangeEditcode)
  34. ON_EN_SETFOCUS(IDC_EDITCODE, OnSetfocusEditcode)
  35. ON_EN_KILLFOCUS(IDC_EDITCODE, OnKillfocusEditcode)
  36. ON_EN_SETFOCUS(IDC_EDITCHAR, OnSetfocusEditchar)
  37. ON_EN_KILLFOCUS(IDC_EDITCHAR, OnKillfocusEditchar)
  38. ON_EN_CHANGE(IDC_EDITCHAR, OnChangeEditchar)
  39. ON_WM_DESTROY()
  40. //}}AFX_MSG_MAP
  41. END_MESSAGE_MAP()
  42. LRESULT CALLBACK EditCharProc( HWND hwnd, UINT uMsg,
  43. WPARAM wParam, LPARAM lParam)
  44. {
  45. switch (uMsg)
  46. {
  47. case WM_CHAR:
  48. {
  49. //
  50. // We always delete whatever in edit window before
  51. // proceeding to avoid multiple characters in the
  52. // window
  53. //
  54. SetWindowText(hwnd, TEXT(""));
  55. CompFinalized = TRUE;
  56. break;
  57. }
  58. case WM_IME_COMPOSITION:
  59. {
  60. if (lParam & CS_INSERTCHAR)
  61. {
  62. // This is KOR ime only. We want to clear the edit
  63. // window when the first and only the first composition
  64. // char is entered.
  65. //
  66. if (CompFinalized)
  67. {
  68. SetWindowText(hwnd, TEXT(""));
  69. }
  70. CompFinalized = FALSE;
  71. }
  72. break;
  73. }
  74. }
  75. return(AfxWndProc(hwnd, uMsg, wParam, lParam));
  76. }
  77. /****************************************/
  78. /* */
  79. /* Default Constructor */
  80. /* */
  81. /****************************************/
  82. CRefrDlg::CRefrDlg( CWnd* pParent)
  83. : CDialog(CRefrDlg::IDD, pParent)
  84. {
  85. //{{AFX_DATA_INIT(CRefrDlg)
  86. //}}AFX_DATA_INIT
  87. }
  88. /****************************************/
  89. /* */
  90. /* MESSAGE "WM_INITDIALOG" */
  91. /* */
  92. /****************************************/
  93. BOOL
  94. CRefrDlg::OnInitDialog()
  95. {
  96. CString DialogTitle;
  97. LOGFONT LogFont;
  98. CWnd *ViewWnd;
  99. CRect CharViewRect;
  100. HWND hWndCode;
  101. HWND hWndChar;
  102. CDialog::OnInitDialog();
  103. // Implement "?" in this dialog.
  104. LONG WindowStyle = GetWindowLong( this->GetSafeHwnd(), GWL_EXSTYLE);
  105. WindowStyle |= WS_EX_CONTEXTHELP;
  106. SetWindowLong( this->GetSafeHwnd(), GWL_EXSTYLE, WindowStyle);
  107. // Set Dialog title name.
  108. if( !TitleFlag)
  109. DialogTitle.LoadString( IDS_REFERENCE_DLGTITLE);
  110. else DialogTitle.LoadString( IDS_CALL_DLGTITLE);
  111. this->SetWindowText( DialogTitle);
  112. // Subclass Dialog Control Item
  113. m_CodeList.SubclassDlgItem( ID_REFERCODE, this);
  114. m_RefListFrame1.SubclassDlgItem( IDC_LISTFRAME1, this);
  115. m_RefInfoFrame.SubclassDlgItem( IDC_INFOFRAME, this);
  116. m_ColumnHeadingR.SubclassDlgItem( IDC_COLUMNHEADINGR, this);
  117. m_EditChar.SubclassDlgItem( IDC_EDITCHAR, this);
  118. hWndChar = this->GetDlgItem(IDC_EDITCHAR)->GetSafeHwnd();
  119. if (GetWindowLongPtr(hWndChar, GWLP_WNDPROC) == (LONG_PTR)AfxWndProc)
  120. {
  121. SetWindowLongPtr(hWndChar, GWLP_WNDPROC, (LONG_PTR)EditCharProc);
  122. }
  123. hWndCode = GetDlgItem(IDC_EDITCODE)->GetSafeHwnd();
  124. if (hWndCode && ::IsWindow(hWndCode))
  125. {
  126. hImcCode = ImmAssociateContext(hWndCode, NULL);
  127. }
  128. GetFont()->GetObject( sizeof(LOGFONT), &LogFont);
  129. m_CodeList.SysFFont.CreateFontIndirect( &LogFont);
  130. m_CodeList.CalcCharSize();
  131. m_CodeList.SendMessage( WM_SETFONT,
  132. (WPARAM)m_CodeList.SysFFont.GetSafeHandle(),
  133. MAKELPARAM( TRUE, 0));
  134. m_ColumnHeadingR.SysFFont.CreateFontIndirect( &LogFont);
  135. ViewWnd = this->GetDlgItem( IDC_EDITCHAR);
  136. ViewWnd->GetClientRect( &CharViewRect);
  137. if( CharViewRect.Width() >= CharViewRect.Height())
  138. vHeight = CharViewRect.Height() - 10;
  139. else vHeight = CharViewRect.Width() - 10;
  140. if( !TitleFlag){
  141. memcpy( &m_CodeList.rLogFont, &ReffLogFont, sizeof( LOGFONT));
  142. m_CodeList.rLogFont.lfHeight = vHeight;
  143. m_CodeList.ViewFont.CreateFontIndirect( &m_CodeList.rLogFont);
  144. if( m_CodeList.CharSize.cx >= m_CodeList.CharSize.cy)
  145. m_CodeList.rLogFont.lfHeight = m_CodeList.CharSize.cy-2;
  146. else m_CodeList.rLogFont.lfHeight = m_CodeList.CharSize.cx-2;
  147. m_CodeList.CharFont.CreateFontIndirect( &m_CodeList.rLogFont);
  148. lstrcpy( (TCHAR *)FontName,
  149. (const TCHAR *)m_CodeList.rLogFont.lfFaceName);
  150. AdjustFontName();
  151. this->SetDlgItemText( IDC_EDITFONT, (LPTSTR)FontName);
  152. }else{
  153. memcpy( &m_CodeList.cLogFont, &EditLogFont, sizeof( LOGFONT));
  154. m_CodeList.cLogFont.lfHeight = vHeight;
  155. m_CodeList.ViewFont.CreateFontIndirect( &m_CodeList.cLogFont);
  156. if( m_CodeList.CharSize.cx >= m_CodeList.CharSize.cy)
  157. m_CodeList.cLogFont.lfHeight = m_CodeList.CharSize.cy-2;
  158. else m_CodeList.cLogFont.lfHeight = m_CodeList.CharSize.cx-2;
  159. m_CodeList.CharFont.CreateFontIndirect( &m_CodeList.cLogFont);
  160. lstrcpy( (TCHAR *)FontName,
  161. (const TCHAR *)m_CodeList.cLogFont.lfFaceName);
  162. AdjustFontName();
  163. this->SetDlgItemText( IDC_EDITFONT, (LPTSTR)FontName);
  164. }
  165. m_CodeList.SetCodeRange();
  166. SetViewFont();
  167. m_CodeList.EnableScrollBar(SB_VERT, ESB_ENABLE_BOTH);
  168. m_CodeList.Invalidate( FALSE);
  169. m_CodeList.UpdateWindow();
  170. CodeFocus = FALSE;
  171. CharFocus = FALSE;
  172. CompFinalized=TRUE;
  173. this->SendDlgItemMessage(IDC_EDITCODE, EM_LIMITTEXT,
  174. (WPARAM)4, (LPARAM)0);
  175. this->SendDlgItemMessage(IDC_EDITCHAR, EM_LIMITTEXT,
  176. (WPARAM)1, (LPARAM)0);
  177. return TRUE;
  178. }
  179. void
  180. CRefrDlg::OnDestroy()
  181. {
  182. if (hImcCode)
  183. {
  184. HWND hWndCode;
  185. hWndCode = GetDlgItem(IDC_EDITCODE)->GetSafeHwnd();
  186. if (hWndCode && ::IsWindow(hWndCode))
  187. {
  188. ImmAssociateContext(hWndCode, hImcCode);
  189. hImcCode = NULL;
  190. }
  191. }
  192. }
  193. /****************************************/
  194. /* */
  195. /* Set font on ViewEdit */
  196. /* */
  197. /****************************************/
  198. void
  199. CRefrDlg::SetViewFont()
  200. {
  201. HWND hWnd;
  202. hWnd = ::GetDlgItem( this->GetSafeHwnd(), IDC_EDITCHAR);
  203. ::SendMessage( hWnd, WM_SETFONT,
  204. (WPARAM)m_CodeList.ViewFont.m_hObject, MAKELPARAM(TRUE,0));
  205. }
  206. /****************************************/
  207. /* */
  208. /* COMMAND "FONT" */
  209. /* */
  210. /****************************************/
  211. void
  212. CRefrDlg::OnClickedButtomfont()
  213. {
  214. HDC hDC;
  215. hDC = ::GetDC( this->GetSafeHwnd());
  216. chf.hDC = ::CreateCompatibleDC( hDC);
  217. ::ReleaseDC( this->GetSafeHwnd(), hDC);
  218. if( !TitleFlag){
  219. m_CodeList.rLogFont.lfHeight = 40;
  220. chf.lpLogFont = &m_CodeList.rLogFont;
  221. }else{
  222. m_CodeList.cLogFont.lfHeight = 40;
  223. chf.lpLogFont = &m_CodeList.cLogFont;
  224. }
  225. chf.lStructSize = sizeof(CHOOSEFONT);
  226. chf.hwndOwner = this->GetSafeHwnd();
  227. chf.rgbColors = GetSysColor(COLOR_WINDOWTEXT); //COLOR_BLACK;
  228. chf.lCustData = 0;
  229. chf.hInstance = AfxGetInstanceHandle();
  230. chf.lpszStyle = (LPTSTR)NULL;
  231. chf.nFontType = SCREEN_FONTTYPE;
  232. chf.lpfnHook = (LPCFHOOKPROC)(FARPROC)ComDlg32DlgProc;
  233. chf.lpTemplateName = (LPTSTR)MAKEINTRESOURCE(FORMATDLGORD31);
  234. chf.Flags = CF_SCREENFONTS | CF_NOSIMULATIONS | CF_ENABLEHOOK |
  235. CF_ENABLETEMPLATE | CF_INITTOLOGFONTSTRUCT;
  236. if( ChooseFont( &chf ) == FALSE){
  237. ::DeleteDC( chf.hDC);
  238. return ;
  239. }
  240. ::DeleteDC( chf.hDC);
  241. m_CodeList.SetCodeRange();
  242. m_CodeList.ResetParam();
  243. this->SetDlgItemText( IDC_EDITCODE, TEXT(""));
  244. this->SetDlgItemText( IDC_EDITCHAR, TEXT(""));
  245. m_CodeList.CharFont.DeleteObject();
  246. m_CodeList.ViewFont.DeleteObject();
  247. if( !TitleFlag){
  248. lstrcpy( (TCHAR *)FontName,
  249. (const TCHAR *)m_CodeList.rLogFont.lfFaceName);
  250. AdjustFontName();
  251. this->SetDlgItemText( IDC_EDITFONT, FontName);
  252. m_CodeList.rLogFont.lfHeight = vHeight;
  253. m_CodeList.rLogFont.lfQuality = PROOF_QUALITY;
  254. m_CodeList.ViewFont.CreateFontIndirect( &m_CodeList.rLogFont);
  255. if( m_CodeList.CharSize.cx >= m_CodeList.CharSize.cy)
  256. m_CodeList.rLogFont.lfHeight = m_CodeList.CharSize.cy-2;
  257. else m_CodeList.rLogFont.lfHeight = m_CodeList.CharSize.cx-2;
  258. m_CodeList.CharFont.CreateFontIndirect( &m_CodeList.rLogFont);
  259. }else{
  260. lstrcpy(FontName,
  261. (const TCHAR *)m_CodeList.cLogFont.lfFaceName);
  262. AdjustFontName();
  263. this->SetDlgItemText( IDC_EDITFONT, FontName);
  264. m_CodeList.cLogFont.lfHeight = vHeight;
  265. m_CodeList.cLogFont.lfQuality = PROOF_QUALITY;
  266. m_CodeList.ViewFont.CreateFontIndirect( &m_CodeList.cLogFont);
  267. if( m_CodeList.CharSize.cx >= m_CodeList.CharSize.cy)
  268. m_CodeList.cLogFont.lfHeight = m_CodeList.CharSize.cy-2;
  269. else m_CodeList.cLogFont.lfHeight = m_CodeList.CharSize.cx-2;
  270. m_CodeList.CharFont.CreateFontIndirect( &m_CodeList.cLogFont);
  271. }
  272. SetViewFont();
  273. m_CodeList.Invalidate( TRUE);
  274. m_CodeList.UpdateWindow();
  275. CWnd *cWnd = GetDlgItem( ID_REFERCODE);
  276. GotoDlgCtrl( cWnd);
  277. return;
  278. }
  279. /****************************************/
  280. /* */
  281. /* Adjust Font Name */
  282. /* */
  283. /****************************************/
  284. void
  285. CRefrDlg::AdjustFontName()
  286. {
  287. CClientDC dc(this);
  288. CRect ViewFontRect;
  289. CSize FontNameSize, CharSize;
  290. int i;
  291. CWnd *cWnd = GetDlgItem( IDC_EDITFONT);
  292. cWnd->GetClientRect( &ViewFontRect);
  293. GetTextExtentPoint32( dc.GetSafeHdc(), (const TCHAR *)FontName,
  294. lstrlen((const TCHAR *)FontName), &FontNameSize);
  295. if( ViewFontRect.Width() <= FontNameSize.cx){
  296. GetTextExtentPoint32( dc.GetSafeHdc(), TEXT("<<"), 2, &CharSize);
  297. i = ( ViewFontRect.Width() /CharSize.cx) * 2;
  298. FontName[i-2] = '.';
  299. FontName[i-1] = '.';
  300. FontName[i] = '\0';
  301. }
  302. }
  303. /****************************************/
  304. /* */
  305. /* jump Reference code */
  306. /* */
  307. /****************************************/
  308. void CRefrDlg::JumpReferCode()
  309. {
  310. if( !m_CodeList.CodeButtonClicked())
  311. {
  312. if (CharFocus && !CompFinalized)
  313. {
  314. //
  315. // We want to cancel ime composition with wParam = 0, lParam
  316. // contains CS_INSERTCHAR.
  317. //
  318. this->SendDlgItemMessage(IDC_EDITCHAR,
  319. WM_IME_COMPOSITION,
  320. 0,
  321. CS_INSERTCHAR | CS_NOMOVECARET |
  322. GCS_COMPSTR | GCS_COMPATTR);
  323. }
  324. OutputMessageBox( this->GetSafeHwnd(),
  325. IDS_ILLEGALCODE_TITLE,
  326. IDS_ILLEGALCODE_MSG, TRUE);
  327. }else{
  328. if (CharFocus)
  329. {
  330. //
  331. // We don't want to highlight an interim KOR IME composition.
  332. //
  333. if (CompFinalized)
  334. {
  335. this->SendDlgItemMessage(IDC_EDITCHAR, EM_SETSEL, 0, -1);
  336. }
  337. }
  338. else
  339. {
  340. this->SendDlgItemMessage(IDC_EDITCODE, EM_SETSEL, 0, -1);
  341. }
  342. }
  343. }
  344. /****************************************/
  345. /* */
  346. /* COMMAND "IDOK" */
  347. /* */
  348. /****************************************/
  349. void
  350. CRefrDlg::OnOK()
  351. {
  352. if( !m_CodeList.SelectCode){
  353. OutputMessageBox( this->GetSafeHwnd(),
  354. IDS_REFERENCE_DLGTITLE,
  355. IDS_NOTSELCHARACTER_MSG, TRUE);
  356. return;
  357. }
  358. if( !TitleFlag){
  359. memcpy( &ReffLogFont, &m_CodeList.rLogFont, sizeof( LOGFONT));
  360. }else{
  361. memcpy( &EditLogFont, &m_CodeList.cLogFont, sizeof( LOGFONT));
  362. }
  363. CDialog::OnOK();
  364. }
  365. /****************************************/
  366. /* */
  367. /* COMMAND "IDCANCEL" */
  368. /* */
  369. /****************************************/
  370. void
  371. CRefrDlg::OnCancel()
  372. {
  373. m_CodeList.SelectCode = 0;
  374. CDialog::OnCancel();
  375. }
  376. /****************************************/
  377. /* */
  378. /* MESSAGE "EM_CHANGE" */
  379. /* */
  380. /****************************************/
  381. void CRefrDlg::OnChangeEditcode()
  382. {
  383. TCHAR EditCode[5];
  384. int i;
  385. EditCode[0] = '\0';
  386. this->GetDlgItemText(IDC_EDITCODE, EditCode, sizeof(EditCode)/sizeof(TCHAR));
  387. for (i=0; i<lstrlen(EditCode); i++)
  388. {
  389. if ( EditCode[i] < TEXT('0') ||
  390. (EditCode[i] > TEXT('9') && EditCode[i] < TEXT('A')) ||
  391. (EditCode[i] > TEXT('F') && EditCode[i] < TEXT('a')) ||
  392. EditCode[i] > TEXT('f'))
  393. {
  394. OutputMessageBox( this->GetSafeHwnd(),
  395. IDS_ILLEGALCODE_TITLE,
  396. IDS_ILLEGALCODE_MSG, TRUE);
  397. this->SendDlgItemMessage(IDC_EDITCODE, EM_SETSEL, 0, -1);
  398. return;
  399. }
  400. }
  401. if( lstrlen( EditCode) == 4 && CodeFocus)
  402. {
  403. JumpReferCode();
  404. }
  405. }
  406. /****************************************/
  407. /* */
  408. /* MESSAGE "WM_SETFOCUS" */
  409. /* */
  410. /****************************************/
  411. void
  412. CRefrDlg::OnSetfocusEditcode()
  413. {
  414. this->SendDlgItemMessage(IDC_EDITCODE, EM_SETSEL, 0, -1);
  415. CodeFocus = TRUE;
  416. }
  417. /****************************************/
  418. /* */
  419. /* MESSAGE "WM_KILLFOCUS" */
  420. /* */
  421. /****************************************/
  422. void
  423. CRefrDlg::OnKillfocusEditcode()
  424. {
  425. CodeFocus = FALSE;
  426. }
  427. /****************************************/
  428. /* */
  429. /* MESSAGE "WM_SETFOCUS" */
  430. /* */
  431. /****************************************/
  432. void
  433. CRefrDlg::OnSetfocusEditchar()
  434. {
  435. if (CompFinalized)
  436. {
  437. this->SendDlgItemMessage( IDC_EDITCHAR, EM_SETSEL, 0, -1);
  438. }
  439. CharFocus = TRUE;
  440. }
  441. /****************************************/
  442. /* */
  443. /* MESSAGE "WM_KILLFOCUS" */
  444. /* */
  445. /****************************************/
  446. void
  447. CRefrDlg::OnKillfocusEditchar()
  448. {
  449. CharFocus = FALSE;
  450. }
  451. /****************************************/
  452. /* */
  453. /* MESSAGE "EM_CHANGE" */
  454. /* */
  455. /****************************************/
  456. void
  457. CRefrDlg::OnChangeEditchar()
  458. {
  459. WCHAR EditChar[5] = {0};
  460. EditChar[0]=TEXT('\0');
  461. #ifdef UNICODE
  462. ::GetDlgItemTextW(this->GetSafeHwnd(),IDC_EDITCHAR, (LPWSTR)EditChar, sizeof(EditChar)/sizeof(WCHAR));
  463. #else
  464. CHAR eChar[4];
  465. int nchar = ::GetDlgItemText(this->GetSafeHwnd(),IDC_EDITCHAR, (LPSTR)eChar, sizeof(eChar));
  466. MultiByteToWideChar(CP_ACP, 0, eChar, nchar, EditChar, sizeof(EditChar)/sizeof(EditChar[0]));
  467. #endif
  468. if( CharFocus && EditChar[0] != TEXT('\0') )
  469. {
  470. int iPos = 1;
  471. /*
  472. #ifndef UNICODE
  473. if (IsDBCSLeadByte(EditChar[0]))
  474. {
  475. iPos = 2;
  476. }
  477. #endif
  478. */
  479. EditChar[iPos]=TEXT('\0');
  480. JumpReferCode();
  481. }
  482. }
  483. /****************************************/
  484. /* */
  485. /* Callback function */
  486. /* */
  487. /****************************************/
  488. static BOOL CALLBACK
  489. ComDlg32DlgProc(
  490. HWND hDlg,
  491. UINT uMsg,
  492. WPARAM wParam,
  493. LPARAM lParam)
  494. {
  495. switch (uMsg)
  496. {
  497. case WM_INITDIALOG:
  498. long WindowStyle;
  499. WindowStyle = GetWindowLong( hDlg, GWL_EXSTYLE);
  500. WindowStyle |= WS_EX_CONTEXTHELP;
  501. SetWindowLong( hDlg, GWL_EXSTYLE, WindowStyle);
  502. break;
  503. default:
  504. return FALSE;
  505. }
  506. return TRUE;
  507. }
  508. static DWORD aIds[] =
  509. {
  510. ID_REFERCODE, IDH_EUDC_REFLIST,
  511. IDC_COLUMNHEADINGR, IDH_EUDC_REFLIST,
  512. IDC_STATICC, IDH_EUDC_REFCODE,
  513. IDC_EDITCODE, IDH_EUDC_REFCODE,
  514. IDC_STATICS, IDH_EUDC_REFCHAR,
  515. IDC_EDITCHAR, IDH_EUDC_REFCHAR,
  516. IDC_STATICF, IDH_EUDC_REFFONT,
  517. IDC_EDITFONT, IDH_EUDC_REFFONT,
  518. IDC_INFOFRAME, IDH_EUDC_REFFONT,
  519. IDC_BUTTOMFONT, IDH_EUDC_FONT,
  520. // IDOK, IDH_EUDC_OK,
  521. // IDCANCEL, IDH_EUDC_CANCEL,
  522. 0,0
  523. };
  524. static DWORD aIdsCall[] =
  525. {
  526. ID_REFERCODE, IDH_EUDC_CALLLIST,
  527. IDC_COLUMNHEADINGR, IDH_EUDC_CALLLIST,
  528. IDC_STATICC, IDH_EUDC_CALLCODE,
  529. IDC_EDITCODE, IDH_EUDC_CALLCODE,
  530. IDC_STATICS, IDH_EUDC_CALLCHAR,
  531. IDC_EDITCHAR, IDH_EUDC_CALLCHAR,
  532. IDC_STATICF, IDH_EUDC_CALLFONT,
  533. IDC_EDITFONT, IDH_EUDC_CALLFONT,
  534. IDC_INFOFRAME, IDH_EUDC_CALLFONT,
  535. IDC_BUTTOMFONT, IDH_EUDC_FONT,
  536. // IDOK, IDH_EUDC_OK,
  537. // IDCANCEL, IDH_EUDC_CANCEL,
  538. 0,0
  539. };
  540. /****************************************/
  541. /* */
  542. /* Window procedure */
  543. /* */
  544. /****************************************/
  545. LRESULT
  546. CRefrDlg::WindowProc(
  547. UINT message,
  548. WPARAM wParam,
  549. LPARAM lParam)
  550. {
  551. if( message == WM_HELP){
  552. ::WinHelp((HWND)((LPHELPINFO)lParam)->hItemHandle,
  553. HelpPath, HELP_WM_HELP, (DWORD_PTR)(LPTSTR)(TitleFlag ? aIdsCall:aIds));
  554. return(0);
  555. }
  556. if( message == WM_CONTEXTMENU){
  557. ::WinHelp((HWND)wParam, HelpPath,
  558. HELP_CONTEXTMENU, (DWORD_PTR)(LPTSTR)(TitleFlag ? aIdsCall : aIds));
  559. return(0);
  560. }
  561. return CDialog::WindowProc( message, wParam, lParam);
  562. }