how to prevent the console window poping out when running gtkmm app in windows vista?

View: New views
7 Messages — Rating Filter:   Alert me  

how to prevent the console window poping out when running gtkmm app in windows vista?

by 明覺 :: Rate this Message:

| View Threaded | Show Only this Message

I installed gtkmm and minWG in windows vista, and compiled a sample
gtkmm app successfully, it also runs successfully, but the problem is
it also pops out a console window with it, how to disable the console
window? thanks.

--
My platform is Gnu/Linux Debian(sid-amd64, lenny-intelx86) Gnome
Mozilla/Iceweasel Gmail/Evolution Gtkmm/Anjuta/Emacs Scim Totem
Pidgin.
_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Re: how to prevent the console window poping out when running gtkmm app in windows vista?

by Jonathon Jongsma-3 :: Rate this Message:

| View Threaded | Show Only this Message

明覺 wrote:
> I installed gtkmm and minWG in windows vista, and compiled a sample
> gtkmm app successfully, it also runs successfully, but the problem is
> it also pops out a console window with it, how to disable the console
> window? thanks.
>

I don't program on windows, but if I remember correctly, you have to compile (or link?)
with the -mwindows option or something like that.

--
jonner
_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Parent Message unknown Re: how to prevent the console window poping out when running gtkmm app in windows vista?

by Paul Richards-5 :: Rate this Message:

| View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

If you compile a non-console app, you'll also need to define WinMain like I do below:

 

#if defined(WIN32) || defined (_WIN32) || defined(WIN64) || defined(_WIN64)
namespace windowsh {
#include <windows.h>
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR lpCmdline, int)
{
 // you might want to parse lpCmdline into seperate args, I'll leave that up to you
 char* argv[2] = { lpCmdline, NULL };
 return main(0, argv); // Assuming here no argruments are passed...
}
}
#endif

---------[ Received Mail Content ]----------
Subject : Re: how to prevent the console window poping out when running gtkmm app in windows vista?
Date : Fri, 01 May 2009 10:00:31 -0500
From : Jonathon Jongsma <jonathon@...>
To : 明覺 <shi.minjue@...>
Cc : gtkmm-list@...

明覺 wrote:
> I installed gtkmm and minWG in windows vista, and compiled a sample
> gtkmm app successfully, it also runs successfully, but the problem is
> it also pops out a console window with it, how to disable the console
> window? thanks.
>

I don't program on windows, but if I remember correctly, you have to compile (or link?)
with the -mwindows option or something like that.

--
jonner
_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Re: how to prevent the console window poping out when running gtkmm app in windows vista?

by Armin Burgmeier :: Rate this Message:

| View Threaded | Show Only this Message

On Wed, 2009-05-06 at 01:36 -0400, Paul Richards wrote:

> If you compile a non-console app, you'll also need to define WinMain like I do below:
>
> #if defined(WIN32) || defined (_WIN32) || defined(WIN64) || defined(_WIN64)
> namespace windowsh {
> #include <windows.h>
> int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR lpCmdline, int)
> {
>  // you might want to parse lpCmdline into seperate args, I'll leave that up to you
>  char* argv[2] = { lpCmdline, NULL };
>  return main(0, argv); // Assuming here no argruments are passed...
> }
> }
> #endif

What's the advantage of doing this? main() seems to work equally well as
entry point for the few programs I build on Windows.

Armin

> ---------[ Received Mail Content ]----------
> Subject : Re: how to prevent the console window poping out when running gtkmm app in windows vista?
> Date : Fri, 01 May 2009 10:00:31 -0500
> >From : Jonathon Jongsma <jonathon@...>
> To : 明覺 <shi.minjue@...>
> Cc : gtkmm-list@...
>
> 明覺 wrote:
> > I installed gtkmm and minWG in windows vista, and compiled a sample
> > gtkmm app successfully, it also runs successfully, but the problem is
> > it also pops out a console window with it, how to disable the console
> > window? thanks.
> >
>
> I don't program on windows, but if I remember correctly, you have to compile (or link?)
> with the -mwindows option or something like that.
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list@...
> http://mail.gnome.org/mailman/listinfo/gtkmm-list

_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Re: how to prevent the console window poping out when running gtkmm app in windows vista?

by Christopher Harvey-2 :: Rate this Message:

| View Threaded | Show Only this Message

did you ever get one of those ugly popup console windows?
using winmain prevents this. It tells windows "I'm going to build a
windowed application, not a console app."
No other difference as far as I can tell.

Armin Burgmeier wrote:

> On Wed, 2009-05-06 at 01:36 -0400, Paul Richards wrote:
>  
>> If you compile a non-console app, you'll also need to define WinMain like I do below:
>>
>> #if defined(WIN32) || defined (_WIN32) || defined(WIN64) || defined(_WIN64)
>> namespace windowsh {
>> #include <windows.h>
>> int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR lpCmdline, int)
>> {
>>  // you might want to parse lpCmdline into seperate args, I'll leave that up to you
>>  char* argv[2] = { lpCmdline, NULL };
>>  return main(0, argv); // Assuming here no argruments are passed...
>> }
>> }
>> #endif
>>    
>
> What's the advantage of doing this? main() seems to work equally well as
> entry point for the few programs I build on Windows.
>
> Armin
>
>  
>> ---------[ Received Mail Content ]----------
>> Subject : Re: how to prevent the console window poping out when running gtkmm app in windows vista?
>> Date : Fri, 01 May 2009 10:00:31 -0500
>> >From : Jonathon Jongsma <jonathon@...>
>> To : 明覺 <shi.minjue@...>
>> Cc : gtkmm-list@...
>>
>> 明覺 wrote:
>>    
>>> I installed gtkmm and minWG in windows vista, and compiled a sample
>>> gtkmm app successfully, it also runs successfully, but the problem is
>>> it also pops out a console window with it, how to disable the console
>>> window? thanks.
>>>
>>>      
>> I don't program on windows, but if I remember correctly, you have to compile (or link?)
>> with the -mwindows option or something like that.
>>
>> _______________________________________________
>> gtkmm-list mailing list
>> gtkmm-list@...
>> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>>    
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list@...
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>  

_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Re: how to prevent the console window poping out when running gtkmm app in windows vista?

by Armin Burgmeier :: Rate this Message:

| View Threaded | Show Only this Message

On Wed, 2009-05-06 at 03:41 -0400, Christopher Harvey wrote:
> did you ever get one of those ugly popup console windows?
> using winmain prevents this.

I don't think this has anything to do with WinMain. At least with MinGW,
you can simply pass the -mwindows linker flag to avoid the console
window. For MSVC, I think you can change the application type from
Console to GUI somewhere in the project properties.

>  It tells windows "I'm going to build a
> windowed application, not a console app."
> No other difference as far as I can tell.

Armin

> Armin Burgmeier wrote:
> > On Wed, 2009-05-06 at 01:36 -0400, Paul Richards wrote:
> >  
> >> If you compile a non-console app, you'll also need to define WinMain like I do below:
> >>
> >> #if defined(WIN32) || defined (_WIN32) || defined(WIN64) || defined(_WIN64)
> >> namespace windowsh {
> >> #include <windows.h>
> >> int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR lpCmdline, int)
> >> {
> >>  // you might want to parse lpCmdline into seperate args, I'll leave that up to you
> >>  char* argv[2] = { lpCmdline, NULL };
> >>  return main(0, argv); // Assuming here no argruments are passed...
> >> }
> >> }
> >> #endif
> >>    
> >
> > What's the advantage of doing this? main() seems to work equally well as
> > entry point for the few programs I build on Windows.
> >
> > Armin
> >
> >  
> >> ---------[ Received Mail Content ]----------
> >> Subject : Re: how to prevent the console window poping out when running gtkmm app in windows vista?
> >> Date : Fri, 01 May 2009 10:00:31 -0500
> >> >From : Jonathon Jongsma <jonathon@...>
> >> To : 明覺 <shi.minjue@...>
> >> Cc : gtkmm-list@...
> >>
> >> 明覺 wrote:
> >>    
> >>> I installed gtkmm and minWG in windows vista, and compiled a sample
> >>> gtkmm app successfully, it also runs successfully, but the problem is
> >>> it also pops out a console window with it, how to disable the console
> >>> window? thanks.
> >>>
> >>>      
> >> I don't program on windows, but if I remember correctly, you have to compile (or link?)
> >> with the -mwindows option or something like that.
> >>
> >> _______________________________________________
> >> gtkmm-list mailing list
> >> gtkmm-list@...
> >> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >>    
> >
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list@...
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >  

_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Re: how to prevent the console window poping out when running gtkmm app in windows vista?

by Frank Naumann :: Rate this Message:

| View Threaded | Show Only this Message

Hello!

> window. For MSVC, I think you can change the application type from
> Console to GUI somewhere in the project properties.

Right, the application type shall be WIN32. But in this case you have
another entry called WinMain() instead main(). In my WinMain() I even use
RegisterClassEx to register an application title and application icons
(normal and small). Such code ist generated from the MSVC Wizard too (just
tested with Visual Studio C++ 2008 Express).

int APIENTRY _tWinMain(HINSTANCE hInstance,
                        HINSTANCE hPrevInstance,
                        LPTSTR lpCmdLine,
                        int nCmdShow)
{
         // check windows version
         DWORD dwVersion = GetVersion();

         if (!(dwVersion < 0x80000000))
         {
                 MessageBox(0, "This software requires Windows 2000/XP or above!", "Fatal Error", MB_OK);
                 return -1;
         }

         // Initialize global strings
         LoadString(hInstance, APPLICATION_TITLE, szWindowClass, MAX_LOADSTRING);
         MyRegisterClass(hInstance);

         return main(__argc, __argv);
}


Regards,
Frank
_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list