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.

157 lines
4.9 KiB

  1. /*----------------------------------------------------------------------------*\
  2. *
  3. * MCIWnd
  4. *
  5. * MCIWnd window class *internal* header file.
  6. *
  7. *----------------------------------------------------------------------------*/
  8. #include <windows.h>
  9. #include <windowsx.h>
  10. #include <mmsystem.h>
  11. #include <digitalv.h>
  12. #include <commdlg.h>
  13. #include <shellapi.h>
  14. #include "preview.h"
  15. #define NOUPDOWN
  16. #define NOSTATUSBAR
  17. #define NOMENUHELP
  18. #define NOBTNLIST
  19. #define NODRAGLIST
  20. #define NOPROGRESS
  21. #include "strings.rc"
  22. #include "commctrl.h"
  23. #include "mciwnd.h"
  24. /**************************************************************************
  25. ***************************************************************************/
  26. #define GetWS(hwnd) GetWindowLong(hwnd, GWL_STYLE)
  27. #define PutWS(hwnd, f) SetWindowLong(hwnd, GWL_STYLE, f)
  28. #define TestWS(hwnd,f) (GetWS(hwnd) & f)
  29. #define SetWS(hwnd, f) ((PutWS(hwnd, GetWS(hwnd) | f) & (f)) != (f))
  30. #define ClrWS(hwnd, f) ((PutWS(hwnd, GetWS(hwnd) & ~(f)) & (f)) != 0)
  31. /******************************************************************************
  32. *****************************************************************************/
  33. #ifdef DEBUG
  34. #define MODNAME "MCIWnd"
  35. static void cdecl dprintf(PSTR sz, ...);
  36. #define DPF dprintf
  37. #else
  38. #define DPF ; / ## /
  39. #endif
  40. #define ABS(x) ((int)(x) > 0) ? (x) : (-(x))
  41. // the place we load internationalizable strings into
  42. static char szString[128];
  43. #define LoadSz(ID) (LoadString(hInst, ID, szString, sizeof(szString)), szString)
  44. /******************************************************************************
  45. *****************************************************************************/
  46. // !!! Ack! A global in a library! But the Common Control code needs
  47. // !!! to know the instance that registered the class. I think.
  48. HINSTANCE hInst;
  49. char aszMCIWndClassName[] = MCIWND_WINDOW_CLASS;
  50. // A brush to draw our OwnerDraw menus with
  51. extern BOOL FAR PASCAL CreateDitherBrush(BOOL bIgnoreCount);
  52. extern BOOL FAR PASCAL FreeDitherBrush(void);
  53. extern HBRUSH hbrDither;
  54. /******************************************************************************
  55. *****************************************************************************/
  56. // icky constants
  57. #define TIMER1 1
  58. #define TIMER2 2
  59. #define ACTIVE_TIMER 500
  60. #define INACTIVE_TIMER 2000
  61. #define IDBMP_TOOLBAR 959
  62. #define ID_TOOLBAR 747
  63. #define TB_HEIGHT 21 //23 // toolbar windows are this high
  64. #define STANDARD_WIDTH 300 // width of non-windowed toolbar
  65. #define SMALLEST_WIDTH 60 // smallest width allowed
  66. #define IDM_MCIZOOM 11000
  67. #define IDM_MCIVOLUME 12000
  68. #define VOLUME_MAX 200
  69. #define IDM_MCISPEED 13000
  70. #define SPEED_MAX 200
  71. #define IDM_MCINEW 103
  72. #define IDM_MCIOPEN 104
  73. #define IDM_MCICLOSE 105
  74. #define IDM_MCIREWIND 106
  75. #define IDM_MENU 107 // menu button and menu id
  76. #define IDM_MCIEJECT 108 // eject button id
  77. #define TOOLBAR_END 109 // last item in toolbar
  78. #define IDM_MCICONFIG 110 // bring up a configure box
  79. #define IDM_MCICOMMAND 111
  80. #define IDM_COPY 112
  81. /******************************************************************************
  82. *****************************************************************************/
  83. typedef struct {
  84. HWND hwnd;
  85. HWND hwndOwner; // who gets notification
  86. UINT alias;
  87. UINT wDeviceID;
  88. UINT wDeviceType;
  89. DWORD dwError;
  90. DWORD dwStyle;
  91. BOOL fHasTracks;
  92. int iNumTracks;
  93. int iFirstTrack;
  94. LONG *pTrackStart;
  95. BOOL fRepeat;
  96. BOOL fCanWindow;
  97. BOOL fHasPalette;
  98. BOOL fCanRecord;
  99. BOOL fCanPlay;
  100. BOOL fCanSave;
  101. BOOL fCanEject;
  102. BOOL fCanConfig;
  103. BOOL fUsesFiles;
  104. BOOL fVideo;
  105. BOOL fAudio;
  106. BOOL fMdiWindow;
  107. BOOL fScrolling;
  108. BOOL fTracking;
  109. //BOOL fSeekExact;
  110. BOOL fVolume;
  111. WORD wMaxVol;
  112. BOOL fSpeed;
  113. BOOL fPlayAfterSeek;
  114. BOOL fActive; // Is this window active right now?
  115. BOOL fMediaValid; // have dwMediaStart and dwMediaLen been set?
  116. RECT rcNormal;
  117. HMENU hmenu;
  118. HMENU hmenuVolume;
  119. HMENU hmenuSpeed;
  120. HFONT hfont;
  121. HWND hwndToolbar;
  122. HWND hwndTrackbar;
  123. DWORD dwMediaStart;
  124. DWORD dwMediaLen;
  125. WORD wTimer;
  126. DWORD dwMode;
  127. DWORD dwPos;
  128. UINT iZoom;
  129. UINT iActiveTimerRate;
  130. UINT iInactiveTimerRate;
  131. char achFileName[128]; // to store open filename
  132. char achReturn[128]; // to store result of the last SendString
  133. OPENFILENAME ofn; // Remember current extension, etc. for opening files
  134. UINT uiHack; // For OwnerDraw hack
  135. HMENU hmenuHack; // For OwnerDraw hack
  136. HICON hicon;
  137. } MCIWND, NEAR * PMCIWND;