WerReportHang function (errorrep.h)
Initiates "no response" reporting on the specified window.
Syntax
HRESULT WerReportHang(
[in] HWND hwndHungApp,
[in, optional] PCWSTR pwzHungApplicationName
);
Parameters
[in] hwndHungApp
Handle to the window that is not responding.
[in, optional] pwzHungApplicationName
The name of the not-responding application to be shown in the Hang Reporting UI. The name is limited to 128 characters including the NULL terminator. If NULL, WER tries to get the name from the target image resources. If it cannot get the name from the image, the image name will be used.
Return value
Returns S_OK if the function was able to initiate the reporting or an error code on failure. Note that S_OK does not necessarily mean that "no response" reporting has completed successfully, only that it was initiated.
Remarks
This function is asynchronous; it does not wait for no-response reporting to complete. There is no way to cancel no-response reporting after it is started.
If you use this function, it is important that you adhere to the following requirements:
- Ensure that child windows are created by a separate process. After no-response reporting has completed, it will terminate the process that created the window.
- Provide visual clues in the child window that it is not responding; no-response reporting will not dim the child window, it will only show the reporting dialog box.
- Confirm that the user wants to terminate the child window that is not responding before calling this function.
- To have the no-response reporting UI appear in front of the window that is not responding, the application should call the AllowSetForegroundWindow (passing ASFW_ANY for the process identifier) function from the top-level window's process.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista with SP1 [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | errorrep.h |
Library | Faultrep.lib |
DLL | Faultrep.dll |