Logo crashrpt
A crash reporting system for Windows applications

Obsolete Functions


typedef BOOL(* LPGETLOGFILE )(LPVOID lpvState)
 Client crash callback function prototype.


int crAddScreenshot (DWORD dwFlags)
 Adds a screenshot to the crash report.

Detailed Description

Typedef Documentation

typedef BOOL( * LPGETLOGFILE)(LPVOID lpvState)

Client crash callback function prototype.

[in] lpvState Must be set to NULL.
This function is deprecated, it is recommended to use PFNCRASHCALLBACK() instead.

The crash callback function is called when crash occurs. This way client application is notified about the crash.

It is generally unsafe to do complex actions (e.g. memory allocation, heap operations) inside of this callback. The application state may be unstable.

One reason the application may use this callback for is to close handles to open log files that the application plans to include into the error report. Files should be accessible for reading, otherwise CrashRpt won't be able to include them into error report.

It is also possible (but not recommended) to add files, properties, desktop screenshots, registry keys inside of the crash callback function.

The crash callback function should typically return TRUE to allow generate error report. Returning FALSE will prevent crash report generation.

The following example shows how to use the crash callback function.

  // define the crash callback
  BOOL CALLBACK CrashCallback(LPVOID lpvState)
     // Do something...

     return TRUE;

See also:

Function Documentation

int crAddScreenshot ( DWORD  dwFlags  ) 

Adds a screenshot to the crash report.

This function returns zero if succeeded. Use crGetLastErrorMsg() to retrieve the error message on fail.
[in] dwFlags Flags, optional.
As of v.1.3.1, this function is deprecated and may be removed in one of the next releases. Use crAddScreenshot2() function instead.

This function can be used to take a screenshot at the moment of crash and add it to the error report. Screenshot information may help the developer to better understand the state of the application at the moment of crash and reproduce the error.

When this function is called, screenshot flags are saved, then the function returns control to the caller. When crash occurs, screenshot is made by the CrashSender.exe process and added to the report.


  • CR_AS_ALLOW_DELETE If this flag is specified, the user will be able to delete the file from error report using context menu of Error Report Details dialog.

Use one of the following constants to specify what part of virtual screen to capture:

The main application window is a window that has a caption (WS_CAPTION), system menu (WS_SYSMENU) and the WS_EX_APPWINDOW extended style. If CrashRpt doesn't find such window, it considers the first found process window as the main window.

Screenshots are added in form of PNG files by default. You can specify the CR_AS_USE_JPEG_FORMAT flag to save screenshots as JPEG files instead.

In addition, you can specify the CR_AS_GRAYSCALE_IMAGE flag to make a grayscale screenshot (by default color image is made). Grayscale image gives smaller file size.

If you use JPEG image format, you may better use the crAddScreenshot2() function, that allows to define JPEG image quality.

When capturing entire desktop consisting of several monitors, one screenshot file is added per each monitor.

You should be careful when using this feature, because screenshots may contain user-identifying or private information. Always specify purposes you will use collected information for in your Privacy Policy.

See also:

Generated on Wed Apr 29 10:17:32 2015 for CrashRpt by doxygen 1.5.9