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.

99 lines
2.3 KiB

  1. //--------------------------------------------------------------------------;
  2. //
  3. // File: Roland.cpp
  4. //
  5. // Copyright (c) 1997 Microsoft Corporation. All rights reserved
  6. //
  7. //--------------------------------------------------------------------------;
  8. #include "mmcpl.h"
  9. #include <windowsx.h>
  10. #include <cpl.h>
  11. #include <commctrl.h>
  12. #include <string.h>
  13. #include <memory.h>
  14. ////////////
  15. // Functions
  16. ////////////
  17. INT_PTR CALLBACK RolandDlgHandler(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
  18. {
  19. BOOL fReturnVal = FALSE;
  20. static HBITMAP hLogo = NULL;
  21. switch (msg)
  22. {
  23. default:
  24. fReturnVal = FALSE;
  25. break;
  26. case WM_SYSCOLORCHANGE:
  27. {
  28. if (hLogo)
  29. {
  30. DeleteObject( (HGDIOBJ) hLogo);
  31. hLogo = NULL;
  32. }
  33. hLogo = (HBITMAP) LoadImage(ghInstance,MAKEINTATOM(IDB_ROLAND), IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS);
  34. if (hLogo)
  35. {
  36. SendDlgItemMessage(hDlg, IDC_LOGO_FRAME, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hLogo);
  37. }
  38. fReturnVal = TRUE;
  39. }
  40. break;
  41. case WM_DESTROY:
  42. {
  43. if (hLogo)
  44. {
  45. DeleteObject( (HGDIOBJ) hLogo);
  46. hLogo = NULL;
  47. }
  48. }
  49. break;
  50. case WM_INITDIALOG:
  51. {
  52. if (lParam)
  53. {
  54. SetWindowText(GetDlgItem(hDlg, IDC_RENDERER), (TCHAR *) lParam);
  55. }
  56. hLogo = (HBITMAP) LoadImage(ghInstance,MAKEINTATOM(IDB_ROLAND), IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS);
  57. if (hLogo)
  58. {
  59. SendDlgItemMessage(hDlg, IDC_LOGO_FRAME, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) hLogo);
  60. }
  61. fReturnVal = TRUE;
  62. }
  63. break;
  64. case WM_COMMAND:
  65. {
  66. switch (LOWORD(wParam))
  67. {
  68. case IDCANCEL:
  69. case IDOK:
  70. EndDialog(hDlg, TRUE);
  71. break;
  72. }
  73. break;
  74. }
  75. }
  76. return fReturnVal;
  77. }
  78. STDAPI_(void) RolandProp(HWND hwnd, HINSTANCE hInst, TCHAR *szName)
  79. {
  80. DialogBoxParam(hInst,MAKEINTRESOURCE(IDD_ROLAND),hwnd, RolandDlgHandler, (LPARAM) szName);
  81. }