Initiates "no response" reporting on the specified window.
HRESULT WerReportHang( HWND hwndHungApp, PCWSTR pwzHungApplicationName );
Handle to the window that is not responding.
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.
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.
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.
|Minimum supported client||Windows Vista with SP1 [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|