Results 1 to 7 of 7

Thread: Working in background

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2011
    Posts
    85

    Working in background

    I want to create a program working in background that:
    I open program and he is invisible (not appear on desktop and in taskbar).

    How I can do this ?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Working in background

    Depending on exactly what you want, you could create a Windows service, a Console application or you could create a Windows Forms app with no form. The latter would generally only make sense if the user was going to interact with it in some way, e.g. a system tray icon. If you want the third option then follow the CodeBank link in my signature and check out my Formless Tray App thread. If you'd like us to provide more information then you'll have to do the same for us first.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2011
    Posts
    85

    Re: Working in background

    Thanks man !

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2011
    Posts
    85

    Re: Working in background

    I have a new question:
    I want if I press f1 then music1 play end if ... where I can write this code ? in a windows form app I write this code in form.load ....

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Working in background

    Quote Originally Posted by Stunt3r View Post
    I have a new question:
    I want if I press f1 then music1 play end if ... where I can write this code ? in a windows form app I write this code in form.load ....
    F1 is a very poor choice for that functionality because it is the Windows standard for Help. You should choose some other, more unusual key combination, including at least one modifier key.

    You definitely wouldn't put such code in the Load event handler of a form because that would simply play the sound when the form loaded. It sounds like you do want a WinForms app without a form and you'll need to use the RegisterHotKey API to catch specific key combinations when your app does not have focus. There are plenty of examples around, including in the CodeBank forum on this very site.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2011
    Posts
    85

    Re: Working in background

    Can you give me a link or a code to call RegisterHotKey ?

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Working in background

    Quote Originally Posted by Stunt3r View Post
    Can you give me a link or a code to call RegisterHotKey ?
    I don't have one sitting in my pocket. To get one I would have to use Google or, as I suggested, search the CodeBank forum. Is there some reason that you're less capable of doing that than I am?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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