I am checking for the window state in OnSize() but the problem is that when I call ShowWindow() inside OnSize() it causes a flicker for a second when applicatoin starts. I want to remove that.

What I am doing is if user minimize application, it should hide, when user maximized it from system tray it should show up again. What is the best place to do that so it does not cause flicker! Thanks.