|
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 (peterpartch
PMCONSULT.COM)
Date: Wed Aug 25 2004 - 18:40:44 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I was under the impression that the original poster wanted
to allow the console to be shut down *without* having the
COM local server shutdown.
Ok, I'll take a look at SetConsoleCtrlHandler...
Peter Partch
---- Original message ----
>Date: Wed, 25 Aug 2004 16:35:35 -0700
>From: Chuck Bell <chuckb
MICROSOFT.COM>
>Subject: Re: [DCOM] Console with COM EXE
>To: DCOM
DISCUSS.MICROSOFT.COM
>
>Take a look at the docs on SetConsoleCtrlHandler. You can
use it to
>ignore the CTRL_CLOSE_EVENT and the Console Window will
stay open until
>your app exits.
>
>Chuck
>
>-----Original Message-----
>From: Distributed COM-Based Code
[mailto:DCOM
DISCUSS.MICROSOFT.COM] On
>Behalf Of Christopher Lawton
>Sent: Wednesday, August 25, 2004 4:08 PM
>To: DCOM
DISCUSS.MICROSOFT.COM
>Subject: Re: Console with COM EXE
>
>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: DCOM
DISCUSS.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-
request
DISCUSS.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-
request
DISCUSS.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-
request
DISCUSS.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-request
DISCUSS.MICROSOFT.COM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]