Click to See Complete Forum and Search --> : windows Application with no window


cbodapati
July 23rd, 2005, 12:36 AM
hi all,
How do I go about creating a windows application in winAPI and MFC without a window.



thanks in advance.
Srikanth.

Ejaz
July 23rd, 2005, 05:00 AM
One way of doing that could be like, put all your stuff in InitInstance() and return FALSE in the end.

Another way could be, start your application in hidden mode, have a look at Dialogs: How to start your Dialog Application in hidden mode? (http://www.codeguru.com/forum/showthread.php?s=&threadid=231065)

cbodapati
July 23rd, 2005, 05:14 AM
hi Ejaz,
thanks for the reply.
I don't want the window to be created at all. no processing messages..
just a blank application and run some code.
is it possible ? pls help.

thanks in advance,

NoHero
July 23rd, 2005, 05:52 AM
hi Ejaz,
thanks for the reply.
I don't want the window to be created at all. no processing messages..
just a blank application and run some code.
is it possible ? pls help.

thanks in advance,

Of course:


Create a console application and do your stuff there
Just don't create a window ;) No one forces you to create one...


#include <windows.h>
#include <stdlib.h>

int WINAPI WinMain ( HINSTANCE hInst, HINSTANCE hPrev, LPSTR CmdLine, int ShowCmd )
{
// Do your stuff right here
return 0;
}

cbodapati
July 24th, 2005, 02:37 AM
hi,
thanks, if some dialog is to be displayed then ?

ovidiucucu
July 24th, 2005, 04:41 AM
hi all,
How do I go about creating a windows application in winAPI and MFC without a window.
if some dialog is to be displayed then ?
.. then display it. Just note first that a dialog is also a window.

richard-aggragant
August 17th, 2005, 04:37 PM
You could use MessageBox(...). You can open one from WinMain(...).