Title: Re: [msvc] Only display system tray Icon..

Hi Jack,
  That worked, cheers.
Neil

----- Original Message -----
From: "Jack" <[EMAIL PROTECTED]>
To: "Neil Devlin" <[EMAIL PROTECTED]>
Sent: Tuesday, April 29, 2003 5:36 AM
Subject: Re: [msvc] Only display system tray Icon..


> Hello Neil,
>
> Friday, April 18, 2003, 5:38:30 AM, you wrote:
>
> >> Hi,
> >>   I have an application that has an icon on the system tray. I dont
want my
> >> window to appear, only the icon on the system tray.
>
> >> The application is a CFormview, and I have inserted the following code:
>
> >> BOOL CMyApp::InitInstance()
> >> {
> >> ...
> >> ...
> >>  m_pMainWnd->ShowWindow(SW_HIDE);
> >>  m_pMainWnd->UpdateWindow();
>
> >> this doesnt show the main window, which is correct, but I get the
window
> >> floashing up for a second, then disappearing. Is there a way to not
have the
> >> window appear at all?
>
> I ran across the same problem.  What I did was change the initial
> location of the window in PreCreateWindow.  If you want to later
> display the window you will need to use SetWindowPos or MoveWindow
> with the desired coordinates.
>
> BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
> {
>         if( !CFrameWnd::PreCreateWindow(cs) )
>                 return FALSE;
>
>         cs.x = 3000;  //cause window to be offscreen so it's not shown
initially
>         return TRUE;
> }
>
> --
> Jack
> mailto:[EMAIL PROTECTED]
>
>


Reply via email to