OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Console with COM EXE

From: Peter Partch (peterpartchPMCONSULT.COM)
Date: Wed Aug 25 2004 - 18:39:03 CDT


If SC_CLOSE is used to remove the x box, then the user can
still type in "exit" at the command prompt....this will not
post a WM_QUIT?

Peter Partch

---- Original message ----
>Date: Wed, 25 Aug 2004 16:07:30 -0700
>From: Christopher Lawton <clawtonCSC.COM>
>Subject: Re: [DCOM] Console with COM EXE
>To: DCOMDISCUSS.MICROSOFT.COM
>
>Remove the SC_CLOSE from the cmd window.
>
>
>Some sample code:
>
> ...
> //Get the window of the console somehow...I've used
FindWindow()
>successfully....
> HMENU hm = GetSystemMenu(hWnd, FALSE);
> DeleteMenu(hm, SC_CLOSE, MF_BYCOMMAND);
>
> //The close box isn't actually gone but it is grayed
out...
>
>
>
>Chris
>
>
>
>------------------------------------------------------------
----------------------------
>
>This is a PRIVATE message. If you are not the intended
recipient, please
>delete without copying and kindly advise us by e-mail of
the mistake in
>delivery. NOTE: Regardless of content, this e-mail shall
not operate to
>bind CSC to any order or other contract unless pursuant to
explicit written
>agreement or government initiative expressly permitting the
use of e-mail
>for such purpose.
>------------------------------------------------------------
----------------------------
>
>
>
>
>|---------+--------------------------->
>| | Wagner Schalch |
>| | <wagner.schalch |
>| | TRANSPORT.ALSTO|
>| | M.COM> |
>| | Sent by: |
>| | Distributed |
>| | COM-Based Code |
>| | <DCOM |
>| | |
>| | |
>| | 08/25/2004 02:24|
>| | PM |
>| | Please respond |
>| | to Distributed |
>| | COM-Based Code |
>| | |
>|---------+--------------------------->
> >---------------------------------------------------------
-------------------------------------------------------------
----------------------------|
>
|

                         |
> | To:
DCOMDISCUSS.MICROSOFT.COM

       |
> |
cc:

                |
> | Subject: Console with COM
EXE
                                                   |
> >---------------------------------------------------------
-------------------------------------------------------------
----------------------------|
>
>
>
>
>Hello,
>
> I have an EXE COM object that creates a console
through
>AllocConsole() and CreateFile() APIs. I have an MFC
application that
>creates this EXE COM object. Everything is working just
fine: the MFC
>application starts, the process of the EXE COM objects
starts and the
>console starts. The outputs from the EXE object are being
sent to the
>console just fine.
>
> The problem: When I close the console through
the 'X' button on
>the top of it, its process terminates and also the process
of the EXE COM
>object terminates!!! I would like that only the process of
the console
>should be terminated. I have already tried FreeConsole()
CloseHandle(
>m_hConsole ), but nothing is working... Does anyone know
how to do it?
>
>Thanks in advance,
>Wagner
>
>
>:.________________
>CONFIDENTIALITY : This e-mail and any attachments are
confidential and
>may be privileged. If you are not a named recipient,
please notify the
>sender immediately and do not disclose the contents to
another person, use
>it for any purpose or store or copy the information in any
medium.
>
>------------------------------------------------------------
----
>Users Guide
http://discuss.microsoft.com/archives/mailfaq.html
>contains important info. Save time, search the archives at
>http://discuss.microsoft.com/archives/index.html .
>To unsubscribe, mailto:DCOM-signoff-
requestDISCUSS.MICROSOFT.COM
>
>------------------------------------------------------------
----
>Users Guide
http://discuss.microsoft.com/archives/mailfaq.html
>contains important info. Save time, search the archives at
>http://discuss.microsoft.com/archives/index.html .
>To unsubscribe, mailto:DCOM-signoff-
requestDISCUSS.MICROSOFT.COM

----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.html
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM