If one looks at the MS documentation on PSN_WIZFINISH it is said that with version 5.80 of "comctl32.dll" you can return a window handle to 1) prevent the wizard from finishing and 2) set the focus on the window handle returned by the function. However, WTL negates the result so that returning TRUE allow the wizard to finish while returning FALSE prevent it. By doing so it is not possible to return a window handle.

For modeless wizard property sheet, once you clicked on the "Terminate" button the sheet should be destroyed by calling DestroyWindow. However the WTL instructions that handle that only check for IDOK and IDCANCEL not the identifier of the "Terminate Button"

Some useful links

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

Comments and Discussions

On line 1980 of atlhttp.inl (ATL 7.1), the call to m_current.Append() should pass the size of the data to append (otherwise if the data is binary and contains nulls, the default behavior of Append is to use strlen, which will cause append prematurely crop the data at the first null).

Existing code:
if (!m_current.Append((LPCSTR)result_buffer))

Should be:
if (!m_current.Append((LPCSTR)result_buffer, result_buffer.GetLength()))