How can I reverse engineer a DirectShow graph?

You can watch the graph you created using GraphEdit, a tool from the DirectShow SDK. In GraphEdit, select File->Connect to remote Graph… In order to find your graph in the list, you have to register it in the running object table: void AddToRot( IUnknown *pUnkGraph, DWORD *pdwRegister ) { IMoniker* pMoniker; IRunningObjectTable* pROT; GetRunningObjectTable( 0, … Read more

Capture screen using DirectX

Here is some sample code to capture the screen with DirectX 9. You shouldn’t have to install any SDK (except the standard files that come with Visual Studio, although I didn’t tested VS 2010). Just create a simple Win32 console application, add the following in the stdafx.h file: #include <Wincodec.h> // we use WIC for … Read more

How to smooth ugly jitter/flicker/jumping when resizing windows, especially dragging left/top border (Win 7-10; bg, bitblt and DWM)?

PART 2: Identifying and Fixing Windows Resize Problems Note: you want to read PART 1 first for this answer to make sense. This answer will not solve all your resizing problems. It organizes the still-usable ideas from other posts and adds a few novel ideas. None of this behavior is at all documented on Microsoft’s … Read more

How to convert UCHAR Virtual-Key Codes into std::string [duplicate]

Three problems in getKeyPressedString: 1) You´re not deleting lpszName again. Either make a delete lpszName; before returning, or use a static buffer in the first place. 2) keyString = *lpszName; only assigns the first character, not the whole string. Remove *. 3) GetKeyNameText can fail. Check the return value, and GetLastError too. (side note: ERROR_INSUFFICIENT_BUFFER … Read more