9#define IDT_PLAYTIMER 1000
11#define MAIN_WINDOW_HEIGHT 125
12#define MAIN_WINDOW_MIN_WIDTH 250
97 ptDifference.
x = (rcWindowRect.
right - rcWindowRect.
left) - rcClientRect.
right;
98 ptDifference.
y = (rcWindowRect.
bottom - rcWindowRect.
top) - rcClientRect.
bottom;
195 m = ((mciStatus.
dwReturn / (1000*60)) % 60);
196 h = ((mciStatus.
dwReturn / (1000*60*60)) % 24);
298 StringCbPrintf(szTempMessage,
sizeof(szTempMessage),
_T(
"MMSYS%lu: %s"), mciError, szErrorMessage);
442 DWORD dwNumDevices = 0;
446 mciSysInfo.
dwRetSize =
sizeof(dwNumDevices);
463 mciSysInfo.
dwNumber = dwDeviceIndex;
540 if (mciError != 0)
return mciError;
595 else if (mciStatus.
dwReturn < 100000)
599 else if (mciStatus.
dwReturn < 1000000)
723 if ((
UINT)dwNewPos <= 1)
935 StringCbCat(szFriendlyName,
sizeof(szFriendlyName),
_T(
"..."));
939 lpmii.
cbSize =
sizeof(lpmii);
956 static TCHAR szDefaultExtension[] =
_T(
"*.*");
963 DWORD dwValueNameLen;
964 DWORD dwValueDataSize;
968 DWORD dwExtensionLen;
969 DWORD dwPosition = 0;
984 if (
RegQueryInfoKey(
hKey,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, &dwNumValues, &dwValueNameLen, &dwValueDataSize,
NULL,
NULL) !=
ERROR_SUCCESS)
989 dwMaskLen = ((dwValueNameLen + 3) * dwNumValues) + 1;
991 szExtensionList =
malloc(dwMaskLen *
sizeof(
TCHAR));
992 if (!szExtensionList)
998 dwFilterSize = (
MAX_MCISTR + (dwMaskLen * 2) + 5) * dwNumDevices;
1007 szExtension =
malloc((dwValueNameLen + 1) *
sizeof(
TCHAR));
1011 szDevice =
malloc(dwValueDataSize +
sizeof(
TCHAR));
1017 uSizeRemain = dwFilterSize;
1020 for (
j = 1;
j <= dwNumDevices;
j++)
1040 uMaskRemain = dwMaskLen *
sizeof(
TCHAR);
1041 d = szExtensionList;
1043 for (
i = 0;
i < dwNumValues;
i++)
1045 dwExtensionLen = dwValueNameLen + 1;
1046 dwDeviceSize = dwValueDataSize +
sizeof(
TCHAR);
1064 uSizeRemain +=
sizeof(*d);
1068 StringCbPrintfEx(
c, uSizeRemain, &
c, &uSizeRemain, 0,
_T(
"%s (%s)"), szFriendlyName, szExtensionList);
1072 uSizeRemain -=
sizeof(*c);
1079 uSizeRemain -=
sizeof(*c);
1083 uMaskRemain = dwMaskLen *
sizeof(
TCHAR);
1084 d = szExtensionList;
1086 for (
i = 0;
i < dwNumValues;
i++)
1088 dwExtensionLen = dwValueNameLen + 1;
1099 uSizeRemain +=
sizeof(*d);
1107 uSizeRemain -=
sizeof(*c);
1113 if (szExtensionList)
free(szExtensionList);
1114 if (szExtension)
free(szExtension);
1115 if (szDevice)
free(szDevice);
1133 uSizeRemain -=
sizeof(*c);
1153 ZeroMemory(&OpenFileName,
sizeof(OpenFileName));
1179 lpmii.
cbSize =
sizeof(lpmii);
1222 drophandle = (HDROP)
wParam;
1246 switch (pnmhdr->
code)
1251 UINT idButton = (
UINT)lpttt->hdr.idFrom;
1538 if (*lpCmdLine ==
_T(
'"'))
#define IDS_TOOLTIP_SEEKBACK
#define IDS_MODE_NOT_READY
#define IDS_DEFAULTMCIERRMSG
#define IDS_TOOLTIP_EJECT
#define IDS_TOOLTIP_SEEKFORW
#define IDS_TOOLTIP_FORWARD
#define IDS_TOOLTIP_BACKWARD
#define IDS_TOOLTIP_PAUSE
#define IDS_ALL_TYPES_FILTER
#define RegCloseKey(hKey)
static const WCHAR szClassName[]
VOID WINAPI InitCommonControls(void)
#define OFN_FILEMUSTEXIST
#define OFN_PATHMUSTEXIST
#define MCI_DGV_PUT_DESTINATION
#define MCI_DGV_WINDOW_DEFAULT
#define MCI_DGV_WINDOW_HWND
#define MCI_DGV_WHERE_SOURCE
static const WCHAR szDeviceName[]
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
LANGID WINAPI GetUserDefaultUILanguage(void)
void WINAPI DragFinish(HDROP h)
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
static const WCHAR Message[]
static const WCHAR Cleanup[]
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define MCI_STATUS_POSITION
#define MCI_FORMAT_MILLISECONDS
#define mciGetErrorString
#define MCI_GETDEVCAPS_USES_FILES
#define MCI_ALL_DEVICE_ID
#define MCI_GETDEVCAPS_ITEM
#define MCI_STATUS_LENGTH
#define MCI_DEVTYPE_WAVEFORM_AUDIO
#define MCI_SEEK_TO_START
#define MCI_NOTIFY_SUCCESSFUL
#define MCI_MODE_NOT_READY
#define MCI_STATUS_TIME_FORMAT
#define MCI_SYSINFO_QUANTITY
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static VOID SwitchViewMode(HWND hwnd)
LRESULT CALLBACK MainWndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
static const TBBUTTON Buttons[]
static VOID CloseMediaFile(HWND hwnd)
static DWORD GetNumDevices(VOID)
static BOOL DeviceUsesFiles(LPTSTR lpDeviceName)
VOID CALLBACK PlayTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
static VOID SeekPlayback(HWND hwnd, DWORD dwNewPos)
static MCIERROR OpenMciDevice(HWND hwnd, LPTSTR lpType, LPTSTR lpFileName)
static VOID SeekBackPlayback(HWND hwnd)
static VOID ShowLastWin32Error(HWND hwnd)
#define MAIN_WINDOW_HEIGHT
static VOID SetImageList(HWND hwnd)
TCHAR szCurrentFile[MAX_PATH]
static DWORD GetDeviceMode(HWND hwnd)
void EnableMenuItems(HWND hwnd)
static VOID ShowMCIError(HWND hwnd, MCIERROR mciError)
static VOID TogglePlaybackState(HWND hwnd)
static MCIERROR CloseMciDevice(VOID)
static VOID ShowDeviceProperties(HWND hwnd)
static VOID HandleDeviceMenuItem(HWND hwnd, UINT uItem)
void UpdateWindowCaption(HWND hwnd)
static VOID SeekForwPlayback(HWND hwnd)
static DWORD GetDeviceFriendlyName(LPTSTR lpDeviceName, LPTSTR lpFriendlyName, DWORD dwFriendlyNameSize)
void DisableMenuItems(void)
static DWORD GetDeviceName(DWORD dwDeviceIndex, LPTSTR lpDeviceName, DWORD dwDeviceNameSize)
#define MAIN_WINDOW_MIN_WIDTH
static VOID StopPlayback(HWND hwnd)
static VOID BuildFileFilterAndDeviceMenu(VOID)
static VOID OpenMediaFile(HWND hwnd, LPTSTR lpFileName, LPTSTR lpType)
static VOID StartPlayback(HWND hwnd)
static DWORD InsertDeviceMenuItem(HMENU hMenu, UINT uItem, BOOL fByPosition, UINT uItemID, DWORD dwDeviceIndex)
static VOID OpenFileDialog(HWND hwnd, DWORD dwFilterIndex, LPTSTR lpType)
void ResizeClientArea(HWND hwnd, int nWidth, int nHeight)
TCHAR szDefaultFilter[MAX_PATH]
void UpdateTimeDisplay(HWND hwnd)
static VOID CleanupFileFilter(VOID)
static VOID InitControls(HWND hwnd)
unsigned __int3264 UINT_PTR
#define TBS_ENABLESELRANGE
#define LANG_USER_DEFAULT
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define INVALID_FILE_ATTRIBUTES
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
DWORD WINAPI GetLastError(void)
#define GetFileAttributes
#define FORMAT_MESSAGE_IGNORE_INSERTS
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define HKEY_LOCAL_MACHINE
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
#define WM_NCLBUTTONDBLCLK
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI UpdateWindow(_In_ HWND)
struct tagNMHDR * LPNMHDR
#define MB_ICONEXCLAMATION
BOOL WINAPI DestroyAcceleratorTable(_In_ HACCEL)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
VOID(CALLBACK * TIMERPROC)(HWND, UINT, UINT_PTR, DWORD)
#define TranslateAccelerator
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
HMENU WINAPI GetMenu(_In_ HWND)