Background Execution

This is a discussion on Background Execution within the Windows Programming forums, part of the Platform Specific Boards category; hi there, what code should we write so that no window is displayed on the screen. and the execution of ...

  1. #1
    raj
    raj is offline
    Registered User
    Join Date
    Apr 2003
    Posts
    3

    Background Execution

    hi there,

    what code should we write so that no window is displayed on the screen. and the execution of the program takes place in the background.

    thank u.

  2. #2
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Depends on your app. Are you using MFC?

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    After you have created your window, there is no need to show it at all, either don't call ShowWindow() or call it with the SW_HIDE property.

    Be careful, if you have no WIndow, then you do not have any ordinary way to stop your program. Normally, if I have a background task running, I put an icon in the system tray, which will popup a menu that will at lest let me stop it.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    raj
    raj is offline
    Registered User
    Join Date
    Apr 2003
    Posts
    3

    Background Execution

    i am using c .
    so it would be helpful if the code is in c / c++.

    thank u.

  5. #5
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    If you are using API or manually using MFC it is a lot easier to do since you control the creation of the window/dialog (see adrianxw's post).
    If you are using appwizard MFC it is not as simple, but it is possible with a few steps.

    Again, it depends on your app. I wasn't talking about the language (of course you're using c/c++ silly : )). If I'm still not being clear, just tell me how you're creating the app. Are you using WinMain()? Are you creating an AppWizard MFC app in MSVC? More details, por favor.

  6. #6
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    It doesn't really matter what language you are using if you are not going to call a function. An example of not calling a function in C would look eactly the same as an example of not calling a function in C++...
    Code:
     
    ...I think you really need to expand a little on what you have got so far.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  7. #7
    Registered User
    Join Date
    Dec 2001
    Posts
    108

    Re: Background Execution

    Originally posted by raj
    hi there,

    what code should we write so that no window is displayed on the screen. and the execution of the program takes place in the background.

    thank u.
    This can depend on wether your using a main or WinMain function as the entry point of the application, not just code within the WinMain function. You can build console level applications that do not display a DOS box by just passing a windows flag to the compiler.

  8. #8
    Registered User
    Join Date
    Apr 2003
    Posts
    6
    hi there,

    i am very interested about this tip....

    can you tell me please how i can write a console application without showing the dos window please?



    i am using MS visual C ++ v6
    Last edited by Aenaos; 04-15-2003 at 12:47 PM.

  9. #9
    Registered User
    Join Date
    Apr 2003
    Posts
    6
    ! ! ! ! PLEASE ! ! ! !

    i had to shut down....

    but i will check ....

    also i have my mail, if someone want to mail me ONLY about this thread


    thanx in advance,
    Last edited by Aenaos; 04-15-2003 at 12:46 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Execution Time - Rijandael encryption
    By gamer4life687 in forum C++ Programming
    Replies: 5
    Last Post: 09-20-2008, 09:25 PM
  2. Replies: 0
    Last Post: 10-06-2007, 01:25 PM
  3. Windows background color
    By Exile in forum Windows Programming
    Replies: 2
    Last Post: 01-23-2005, 06:55 AM
  4. Detect Close of a background process
    By Schwarzhelm in forum C Programming
    Replies: 1
    Last Post: 11-05-2003, 12:46 AM
  5. Background Execution
    By raj in forum C Programming
    Replies: 1
    Last Post: 04-09-2003, 02:48 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21