Change type of captureFlags to DWORD