Invoking a console app and hiding the console. 
Author Message
 Invoking a console app and hiding the console.



Quote:
> As usual, there's more than one way to accomplish what you seek.

> A) Instead of a console application, make it a Win32 application with no
> window. The code will remain the same, except you can't use console I/O, and
> the main function will be WinMain.

But what if the goal is to stay away from the bastardization of main()
into WinMain()?

Tony



Wed, 29 Nov 2000 03:00:00 GMT  
 Invoking a console app and hiding the console.

Quote:



>> As usual, there's more than one way to accomplish what you seek.

>> A) Instead of a console application, make it a Win32 application with no
>> window. The code will remain the same, except you can't use console I/O, and
>> the main function will be WinMain.

>But what if the goal is to stay away from the bastardization of main()
>into WinMain()?

The original question was a technical one.  You presume a political
or propagandistic goal.  These are technical newsgroups.  Your post
is off-topic.  The name of the first C-level entry point for a non-console
(normally windowed) application, "WinMain", is not a bastardization,
as it well reflects the purpose of the startup code that calls it.  Take
your noise to where somebody cares, such as alt.destroy.microsoft.

--Larry Brasfield



Thu, 30 Nov 2000 03:00:00 GMT  
 Invoking a console app and hiding the console.

Quote:

>Hi,

>I would like to write a "console application" and invoke it from my
>install script, but avoid showing the console window. Is this possible?

Yes, I believe the system call is FreeConsole(). To get the console
window back, try AllocConsole();

--
Russell Corfman



Fri, 01 Dec 2000 03:00:00 GMT  
 Invoking a console app and hiding the console.


Quote:



> >> As usual, there's more than one way to accomplish what you seek.

> >> A) Instead of a console application, make it a Win32 application with no
> >> window. The code will remain the same, except you can't use console I/O, and
> >> the main function will be WinMain.

> >But what if the goal is to stay away from the bastardization of main()
> >into WinMain()?

> These are technical newsgroups.  Your post
> is off-topic.

Awareness of the lock-in mechanisms of commercial products is definitely
on-topic.

Tony



Fri, 01 Dec 2000 03:00:00 GMT  
 Invoking a console app and hiding the console.

If it really matters to you, just write (assuming C++):

extern "C" __declspec(dllimport) extern int __argc;
extern "C" __declspec(dllimport) extern char ** __argv;
int main(int argc, char *argv[]);
int __stdcall WinMain(void *, void *, char *, int) {
    return main(__argc, __argv);

Quote:
}

int main(int argc, char *argv[]) {
    // Do whatever you would normally do here without a console.
    return 0;

Quote:
}





>> >> As usual, there's more than one way to accomplish what you seek.

>> >> A) Instead of a console application, make it a Win32 application with
no
>> >> window. The code will remain the same, except you can't use console
I/O, and
>> >> the main function will be WinMain.

>> >But what if the goal is to stay away from the bastardization of main()
>> >into WinMain()?

>> These are technical newsgroups.  Your post
>> is off-topic.

>Awareness of the lock-in mechanisms of commercial products is definitely
>on-topic.

>Tony



Mon, 04 Dec 2000 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Invoke a .REG file from Win32 console app

2. Hide Console App

3. Hide cursor in console app

4. Hidden window in console app

5. console app using a hidden window

6. How to hide the console in a console app while running?

7. Connecting a console app and a WIN32 app using pipes

8. porting from win32 app to win32 console app

9. porting from win32 app to win32 console app

10. dif between console app and normal win app

11. win32 app vs win32 console app?

12. Console apps vs Windows Apps

 

 
Powered by phpBB® Forum Software