How to Control CrashFinder Recorder from a Third Party Application


 

With CrashFinder Pro 2.3, CrashFinder Recorder can now be controlled by any third party applications. This feature allows any company to use CrashFinder in conjunction with their application to easily create UI replay log. In the event of software defect the replay log can be sent to your developer for easy debugging.
 

Set up your application to control the CrashFinder Recorder

CrashFinder Pro listens to Windows messages to start or stop the recorder. The third party application should send a WM_COPYDATA message to control the recording.

For instance the following code (in C++) can be added when your application is launched to start the recorder:

// These two values should not be changed
#define CRASHFINDER_START_RECORDING 0x4ba3c811
#define CRASHFINDER_STOP_RECORDING 0x705f0765

// Start the recording
// This is the file name location
char* sFileName = "C:\\Temp\\TestRec.rep";
COPYDATASTRUCT cpData;
cpData.dwData = CRASHFINDER_START_RECORDING;
cpData.lpData = sFileName;
cpData.cbData = (DWORD)strlen(sFileName);
::SendMessage(	HWND_BROADCAST, 
		WM_COPYDATA, 
		(WPARAM)m_hWnd, 
		(LPARAM)(LPVOID)&cpData);

The following code can be used when the third application closes to stop the recorder:

// Stop Recording
COPYDATASTRUCT cpData;
cpData.dwData = CRASHFINDER_STOP_RECORDING; 
// dummy data (cannot call WM_COPYDATA msg with no data)
int nVal = 0;
cpData.lpData = &nVal;
cpData.cbData = sizeof(nVal);
::SendMessage(HWND_BROADCAST, 
		WM_COPYDATA, 
		(WPARAM)m_hWnd, 
		(LPARAM)(LPVOID)&cpData);
			

Note: the third party application can launch CrashFinder minimized by using the command line: CRASHFINDER.EXE -minimized 

 

  » Download the sample project (VC++ 8.0)