HelpDialog.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //-------------------------------------------------------------------------------
  2. /**
  3. * This program is distributed under the terms of the GNU Lesser General
  4. * Public License (LGPL).
  5. *
  6. * ASSIMP Viewer Utility
  7. *
  8. */
  9. //-------------------------------------------------------------------------------
  10. #include "stdafx.h"
  11. #include "assimp_view.h"
  12. #include "RICHEDIT.H"
  13. namespace AssimpView {
  14. //-------------------------------------------------------------------------------
  15. // Message procedure for the help dialog
  16. //-------------------------------------------------------------------------------
  17. INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg,
  18. WPARAM wParam,LPARAM lParam)
  19. {
  20. lParam;
  21. switch (uMsg)
  22. {
  23. case WM_INITDIALOG:
  24. {
  25. // load the help file ...
  26. HRSRC res = FindResource(NULL,MAKEINTRESOURCE(IDR_TEXT1),"TEXT");
  27. HGLOBAL hg = LoadResource(NULL,res);
  28. void* pData = LockResource(hg);
  29. SETTEXTEX sInfo;
  30. sInfo.flags = ST_DEFAULT;
  31. sInfo.codepage = CP_ACP;
  32. SendDlgItemMessage(hwndDlg,IDC_RICHEDIT21,
  33. EM_SETTEXTEX,(WPARAM)&sInfo,( LPARAM) pData);
  34. UnlockResource(hg);
  35. FreeResource(hg);
  36. return TRUE;
  37. }
  38. case WM_CLOSE:
  39. EndDialog(hwndDlg,0);
  40. return TRUE;
  41. case WM_COMMAND:
  42. if (IDOK == LOWORD(wParam))
  43. {
  44. EndDialog(hwndDlg,0);
  45. return TRUE;
  46. }
  47. case WM_PAINT:
  48. {
  49. PAINTSTRUCT sPaint;
  50. HDC hdc = BeginPaint(hwndDlg,&sPaint);
  51. HBRUSH hBrush = CreateSolidBrush(RGB(0xFF,0xFF,0xFF));
  52. RECT sRect;
  53. sRect.left = 0;
  54. sRect.top = 26;
  55. sRect.right = 1000;
  56. sRect.bottom = 507;
  57. FillRect(hdc, &sRect, hBrush);
  58. EndPaint(hwndDlg,&sPaint);
  59. return TRUE;
  60. }
  61. };
  62. return FALSE;
  63. }
  64. };