CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2003
    Location
    india
    Posts
    5

    windows Application with no window

    hi all,
    How do I go about creating a windows application in winAPI and MFC without a window.



    thanks in advance.
    Srikanth.
    best regards
    srikanth

  2. #2
    Ejaz's Avatar
    Ejaz is offline Elite Member Power Poster
    Join Date
    Jul 2002
    Location
    Lahore, Pakistan
    Posts
    4,211

    Re: windows Application with no window

    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?

  3. #3
    Join Date
    Nov 2003
    Location
    india
    Posts
    5

    Re: windows Application with no window

    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,
    best regards
    srikanth

  4. #4
    Join Date
    Mar 2004
    Location
    (Upper-) Austria
    Posts
    2,899

    Re: windows Application with no window

    Quote Originally Posted by cbodapati
    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:

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


    Code:
    #include <windows.h>
    #include <stdlib.h>
    
    int WINAPI WinMain ( HINSTANCE hInst, HINSTANCE hPrev, LPSTR CmdLine, int ShowCmd )
    {
       // Do your stuff right here
       return 0;
    }
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!

  5. #5
    Join Date
    Nov 2003
    Location
    india
    Posts
    5

    Re: windows Application with no window

    hi,
    thanks, if some dialog is to be displayed then ?
    best regards
    srikanth

  6. #6
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: windows Application with no window

    Quote Originally Posted by cbodapati
    hi all,
    How do I go about creating a windows application in winAPI and MFC without a window.
    Quote Originally Posted by cbodapati
    if some dialog is to be displayed then ?
    .. then display it. Just note first that a dialog is also a window.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  7. #7
    Join Date
    Aug 2005
    Posts
    6

    Re: windows Application with no window

    You could use MessageBox(...). You can open one from WinMain(...).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured