[Qt-interest] FW: What makes an application show a console?

pmqt71 pmqt71 at gmail.com
Mon May 10 10:42:13 CEST 2010


under  Windows, try using this main prototype:

int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR
lpCmdLine, int nCmdShow)
{
...
}

instead of:
int main(int argc, char *argv[])
{
...
}

this should avoid the creation of the console.

pm



2010/5/10 Tony Rietwyk <tony.rietwyk at rightsoft.com.au>

>
>  -----Original Message-----
> *From:* Tony Rietwyk [mailto:tony.rietwyk at rightsoft.com.au]
> *Sent:* Monday, 10 May 2010 18:10
> *To:* 'Gabriele Kahlout'
> *Subject:* RE: [Qt-interest] What makes an application show a console?
>
> Try creating a hidden window.
>
>
>   -----Original Message-----
> *From:* Gabriele Kahlout [mailto:gabriele at mysimpatico.com]
> *Sent:* Monday, 10 May 2010 13:17
> *To:* Tony Rietwyk
> *Cc:* qt-interest at trolltech.com
> *Subject:* Re: [Qt-interest] What makes an application show a console?
>
> That's it. I'm writing a background application, that shows a window
> occassionaly (listening to key events).
> How could I then hide this console?
>
> 2010/5/10 Tony Rietwyk <tony.rietwyk at rightsoft.com.au>
>
>>
>> -----Original Message-----
>> > Hello,
>> >
>> > My GUI application also starts a cmd.exe window, along the window. While
>> other qt
>> > gui projects i create in qt creator (to compare) don't. What could be in
>> the DNA
>> > of my app to require that console?
>> >
>> > don't tell me CONFIG -= console, as these other gui apps don't have it,
>> and anyway
>> > it doesn't change a dyme.
>> >
>>
>> Are you sure that you are using QApplication in your main.cpp?
>>
>> Also, my understanding is that Windows starts a short timer when your
>> application starts.  If you do not create a window quickly enough, Windows
>> assumes the app is console.  Do you have a particularly long initialisation?
>>
>> HTH
>>
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>
>
>
> --
> Regards,
> K. Gabriele
>
> --- unchanged since 25/1/10 ---
> P.S. Unless a notification (LON), please reply either with an answer OR
> with " ACK" appended to this subject within 48 hours. Otherwise, I might
> resend.
> In(LON, this) ∨ In(48h, TimeNow) ∨ ∃x. In(x, MyInbox) ∧ IsAnswerTo(x, this)
> ∨ (In(subject(this), subject(x)) ∧ In(ACK, subject(x)) ∧
> ¬IsAnswerTo(x,this)) ⇒ ¬IResend(this).
>
> Also note that correspondence may be received only from specified a priori
> senders, or if the subject of this email ends with a code, eg. -LICHT01X,
> then also from senders whose reply contains it.
> ∀x. In(x, MyInbox) ⇒ In(senderAddress(x), MySafeSenderList) ∨ (∃y. In(y,
> subject(this) ) ∧ In(y,x) ∧ isCodeLike(y, -LICHT01X) ).
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.819 / Virus Database: 271.1.1/2864 - Release Date: 05/10/10
> 04:26:00
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100510/b11ee9ac/attachment.html 


More information about the Qt-interest-old mailing list