I have a propertysheet-based program, originally developed to be interactive, which has been cobbled together to make it headless on a client's machine. The program is to be started by a program of the clients and so we can't be visible in anyway -no flickering or visibility in the task bar.

I override the WM_WINDOWPOSCHANGING message to stop the windows from becoming visible by toggling off SWP_SHOWWINDOW in the WINDOWPOS structure flags variable.

Code:
void CEraseDialog::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) 
{   
    if ( !m_bVisible )
    {
        lpwndpos->flags &= ~SWP_SHOWWINDOW;
    }
    CDialog::OnWindowPosChanging(lpwndpos);
}
However this seemingly does not occur on my clients machine - it appears visible. I have no way of reproducing this effect. So my first question is any ideas why this is occurring?

Secondly I am thinking about adding some debug messages to find out why this impossibility could be occurring - but since this doesn't happen on any of my office machines I can't debug it here (range of machines from 1ghz PIII all the way up to 2.8ghz, including dual-core laptops). The debug trace needs to revolve around the messages - since that what seems to be cause the failing. The idea I have is to develop a class that could be inherited by the dialog and that replaces the WndProc with it's own, logs the message and passes it back to the original via CallWindowProc. So question two is can anyone think of any easier way or problems with this approach?

And my third and final question is what messages should I be tracking? Too many will hide hide the symptoms and too few will hide the cause.

Thanks, G.