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

What about changing the visible status of the window in PreCreateWindow ... Not tried it, but it should work.

cheers, Craig

---
Craig Lemon, Information Developer,
Geodata Services, Christchurch City Council
PO Box 237, Christchurch, New Zealand
Ph: +64 3 941 8345 - Fax: +64 3 941 8384
mailto::[EMAIL PROTECTED]
---



-----Original Message-----
From: Jack [mailto:[EMAIL PROTECTED]]
Sent: 29 April 2003 4:36 p.m.
To: Neil Devlin
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]


**********************************************************************
This electronic email and any files transmitted with it are intended
solely for the use of the individual or entity to whom they are addressed.

The views expressed in this message are those of the individual
sender and may not necessarily reflect the views of the Christchurch
City Council.

If you are not the correct recipient of this email please advise the
sender and delete.

Christchurch City Council
http://www.ccc.govt.nz
**********************************************************************

Reply via email to