Link to home
Start Free TrialLog in
Avatar of fredop
fredop

asked on

[VC++ 5] Hide Window?

I've written an SDI app, which I needed hidden so I used 'Show_window(SW_HIDE);' to achieve this. I specified this i

m_pMainWnd->ShowWindow(SW_HIDE);
in:
myapp::InitInstance()

This works fine apart from one thing. The window appears for a split second as the program is run.

Could anyone tell me why this is occuring and how I can fix it please?

Thanks.



Avatar of cyrilbdt
cyrilbdt

I suppose that in your InitInstance is following line
if (!ProcessShellCommand(cmdInfo))
 return FALSE;
Default implementation call OnFileNew where actualy main window is created and SHOWED. so if you override ID_FILE_NEW, there create your main window but not showing it, I think there be no problems.

hope this helps

Avatar of fredop

ASKER

Cyrilbdt,
I can't seem to get this to work. Could you possibly expand on your answer please?
Thanks.
Avatar of fredop

ASKER

I have found another way that does work:
before the line:
if (!ProcessShellCommand(cmdInfo))

insert the line:
m_nCmdShow=SW_HIDE;

thanks anyway
ASKER CERTIFIED SOLUTION
Avatar of sassas081597
sassas081597

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial