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.

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