Hiding a dialog based app on startup 
Author Message
 Hiding a dialog based app on startup

This is a multi-part message in MIME format.

------=_NextPart_000_01BC65E4.EB9AA260
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Environment: Windows NT4sp3, Visual C++ 5.0

How can I start a Dialog based app hidden?  I have tried calling
ShowWindow(SW_HIDE) in OnInitDialog( ) and also setting a value for
m_nCmdShow in the App's InitInstance( ) but they don't work.  I am trying
not to draw the window at all to eliminate showing it then hiding it
(causing a flash on the screen).

any ideas?
Felipe
--
My opinions are not those of Moody's Investors Service
------=_NextPart_000_01BC65E4.EB9AA260
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html><head></head><BODY bgcolor=3D"#FFFFFF"><p><font size=3D2 =
color=3D"#000080" face=3D"Tahoma"><br>Environment: Windows NT4sp3, =
Visual C++ 5.0<br><br>How can I start a Dialog based app hidden? &nbsp;I =
have tried calling ShowWindow(SW_HIDE) in OnInitDialog( ) and also =
setting a value for m_nCmdShow in the App's InitInstance( ) but they =
don't work. &nbsp;I am trying not to draw the window at all to eliminate =
showing it then hiding it (causing a flash on the screen).<br><br>any =
ideas?<br>Felipe<br>-- <br>My opinions are not those of Moody's =
Investors Service</p>
</font></body></html>
------=_NextPart_000_01BC65E4.EB9AA260--



Sun, 07 Nov 1999 03:00:00 GMT  
 Hiding a dialog based app on startup

Quote:

> Environment: Windows NT4sp3, Visual C++ 5.0

> How can I start a Dialog based app hidden?  I have tried calling
> ShowWindow(SW_HIDE) in OnInitDialog( ) and also setting a value for
> m_nCmdShow in the App's InitInstance( ) but they don't work.  I am
> trying not to draw the window at all to eliminate showing it then
> hiding it (causing a flash on the screen).

> any ideas?
> Felipe
> --
> My opinions are not those of Moody's Investors Service

I wonder what would happen if you removed the WS_VISIBLE style from the
dialog in OnInitDialog?

Cecil
--
Cecil Galbraith

Free programmer's utilities and MFC tips at
http://www.concentric.net/~cgalbrai



Sun, 07 Nov 1999 03:00:00 GMT  
 Hiding a dialog based app on startup

This is a multi-part message in MIME format.

------=_NextPart_000_01BC660C.93EA7C70
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

I tried using ModifyStyle( ) to remove the WS_VISIBLE style in
OnInitDialog( ) but it returns 0 (meaning it didn't work).  I also tried
setting the showCmd of the WINDOWPLACEMENT structure to SW_HIDE before I
apply it.  Something is going on here or I'm just not tapping into the
right place to change the 'window' attributes.  Especially since I can't
use PreCreateWindow( ) with a dialog based app.

Felipe



: > Environment: Windows NT4sp3, Visual C++ 5.0
: >
: > How can I start a Dialog based app hidden?  I have tried calling
: > ShowWindow(SW_HIDE) in OnInitDialog( ) and also setting a value for
: > m_nCmdShow in the App's InitInstance( ) but they don't work.  I am
: > trying not to draw the window at all to eliminate showing it then
: > hiding it (causing a flash on the screen).
:
: I wonder what would happen if you removed the WS_VISIBLE style from the
: dialog in OnInitDialog?

------=_NextPart_000_01BC660C.93EA7C70
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html><head></head><BODY bgcolor=3D"#FFFFFF"><p><font size=3D2 =
color=3D"#000000" face=3D"Arial"><br>I tried using ModifyStyle( ) to =
remove the WS_VISIBLE style in OnInitDialog( ) but it returns 0 (meaning =
it didn't work). &nbsp;I also tried setting the showCmd of the =
WINDOWPLACEMENT structure to SW_HIDE before I apply it. &nbsp;Something =
is going on here or I'm just not tapping into the right place to change =
the 'window' attributes. &nbsp;Especially since I can't use =
PreCreateWindow( ) with a dialog based app.<br><br>Felipe<br><br>Cecil =
A. Galbraith &lt;<font =

color=3D"#000000">&gt; wrote in article &lt;<font =

Environment: Windows NT4sp3, Visual C++ 5.0<br>: &gt; <br>: &gt; How can =
I start a Dialog based app hidden? &nbsp;I have tried calling<br>: &gt; =
ShowWindow(SW_HIDE) in OnInitDialog( ) and also setting a value for<br>: =
&gt; m_nCmdShow in the App's InitInstance( ) but they don't work. =
&nbsp;I am<br>: &gt; trying not to draw the window at all to eliminate =
showing it then<br>: &gt; hiding it (causing a flash on the =
screen).<br>: <br>: I wonder what would happen if you removed the =
WS_VISIBLE style from the<br>: dialog in OnInitDialog?<br><br></p>
</font></font></font></font></font></body></html>
------=_NextPart_000_01BC660C.93EA7C70--



Sun, 07 Nov 1999 03:00:00 GMT  
 Hiding a dialog based app on startup

--------------C3C6EA16405F99DD64E438BD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Quote:

> I tried using ModifyStyle( ) to remove the WS_VISIBLE style in
> OnInitDialog( ) but it returns 0 (meaning it didn't work).  I also
> tried setting the showCmd of the WINDOWPLACEMENT structure to SW_HIDE
> before I apply it.  Something is going on here or I'm just not tapping
> into the right place to change the 'window' attributes.  Especially
> since I can't use PreCreateWindow( ) with a dialog based app.

> Felipe




Quote:

> : > Environment: Windows NT4sp3, Visual C++ 5.0
> : >
> : > How can I start a Dialog based app hidden?  I have tried calling
> : > ShowWindow(SW_HIDE) in OnInitDialog( ) and also setting a value
> for
> : > m_nCmdShow in the App's InitInstance( ) but they don't work.  I am

> : > trying not to draw the window at all to eliminate showing it then
> : > hiding it (causing a flash on the screen).
> :
> : I wonder what would happen if you removed the WS_VISIBLE style from
> the
> : dialog in OnInitDialog?

Felipe,

Do you want the dialog-based app to just perform some pre-selected
actions and then terminate without ever having been displayed?  If that
is the case, you can just put an EndDialog call in your OnInitDialog
method.  Although it sounds questionable, it is perfectly legit.

However, if that was not the case and you need a work-around for your
visibility situation, you might try placing your dialog at some large
negative coordinates such as -5000, -5000 (via SetWindowPos or
MoveWindow) so that it would at least be off-screen.  Of course, you
might run into problems since it would probably show up as a running
process in the task list, on the task bar, and in the alt-tab list, but
I don't know if that is undesirable for your situation.  (I am only
suggesting this mechanism as a potential work-around until you get a
handle on whatever is really going on).

Regards,

= Jeff =

--------------C3C6EA16405F99DD64E438BD
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
<BODY BGCOLOR="#FFFFFF">
<BLOCKQUOTE TYPE=CITE><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>I
tried using ModifyStyle( ) to remove the WS_VISIBLE style in OnInitDialog(
) but it returns 0 (meaning it didn't work).&nbsp; I also tried setting
the showCmd of the WINDOWPLACEMENT structure to SW_HIDE before I apply
it.&nbsp; Something is going on here or I'm just not tapping into the right
place to change the 'window' attributes.&nbsp; Especially since I can't
use PreCreateWindow( ) with a dialog based app.</FONT></FONT></FONT>

<P><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>Felipe</FONT></FONT></FONT>

<P><FONT FACE="Arial"><FONT SIZE=-1><FONT COLOR="#000000">Cecil A. Galbraith


<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: Felipe Jord&atilde;o

<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: > Environment:
Windows NT4sp3, Visual C++ 5.0</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: ></FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: > How can
I start a Dialog based app hidden?&nbsp; I have tried calling</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: > ShowWindow(SW_HIDE)
in OnInitDialog( ) and also setting a value for</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: > m_nCmdShow
in the App's InitInstance( ) but they don't work.&nbsp; I am</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: > trying not
to draw the window at all to eliminate showing it then</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: > hiding it
(causing a flash on the screen).</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>:</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: I wonder what
would happen if you removed the WS_VISIBLE style from the</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>: dialog in
OnInitDialog?</FONT></FONT></FONT></BLOCKQUOTE>
Felipe,

<P>Do you want the dialog-based app to just perform some pre-selected actions
and then terminate without ever having been displayed?&nbsp; If that is
the case, you can just put an EndDialog call in your OnInitDialog method.&nbsp;
Although it sounds questionable, it is perfectly legit.

<P>However, if that was not the case and you need a work-around for your
visibility situation, you might try placing your dialog at some large negative
coordinates such as -5000, -5000 (via SetWindowPos or MoveWindow) so that
it would at least be off-screen.&nbsp; Of course, you might run into problems
since it would probably show up as a running process in the task list,
on the task bar, and in the alt-tab list, but I don't know if that is undesirable
for your situation.&nbsp; (I am only suggesting this mechanism as a potential
work-around until you get a handle on whatever is really going on).

<P>Regards,

<P>= Jeff =

<BR>
</BODY>
</HTML>

--------------C3C6EA16405F99DD64E438BD--



Tue, 09 Nov 1999 03:00:00 GMT  
 Hiding a dialog based app on startup

Quote:

>Environment: Windows NT4sp3, Visual C++ 5.0

>How can I start a Dialog based app hidden?  I have tried calling
>ShowWindow(SW_HIDE) in OnInitDialog( ) and also setting a value for
>m_nCmdShow in the App's InitInstance( ) but they don't work.  I am trying
>not to draw the window at all to eliminate showing it then hiding it
>(causing a flash on the screen).

>any ideas?

        if it's dialog-based, then there's a DoModal call in yourApp.cpp .

        whenever i have to do stuff before popping the dialog up, i just
do it before the DoModal call. You can still use all (well, most) of
the functions in the dialog class if it's not actually running.

        -c
-----------------------------------------------------------------------
                c  h  r  i  s    l  o  s  i  n  g  e  r

    He woke in darkness, the word "penumbras" ringing in his head.

     ReplyTo address has been corrupted to deter unwanted e-mail.
                        Use the address above.



Tue, 09 Nov 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Hide dialog based app on startup

2. How to create a Dialog based Application with MainDlg hidden on startup

3. HOWTO: hide dialog when a dialog-based app starts

4. Question on Dialog based app startup

5. Again: minimizing dialog-based app on startup....

6. Dialog based app minimize on startup???/

7. hiding an mfc dialog based app

8. How to hide a messagebox before it pops up, in a dialog based app

9. Hiding a dialog-based app

10. How can I tell when a dialog based app gets hidden or exposed

11. Hide dialog based apps

12. A: How to start dialog-based app hidden

 

 
Powered by phpBB® Forum Software