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

    How can I run a program at startup?

    I know this is more a windows question than a c++ question so I will especially appreciate any responses. How can you run tell windows to start a program (besides the registry and the startup folder). I am trying to make a program that will analyze windows and all the programs that are running (including the ones hidden from task manager). I would like to be able to present a true list of all the programs that are running at startup.
    Matthew Sanford

    "The man who doesn't read good books has no advantage over the man who can't read them."
    -- Mark Twain

  2. #2
    Join Date
    Apr 2003
    Location
    Hyderabad,India
    Posts
    486

    I feel why don't have other options..

    Hi, i read your question, As i know we don't have any other way of doing things.
    but you do this through program only.
    write another application which can place that exe file in the startup folder.. or a shortcut of that..
    why do you need any other way of doing it.
    But if you come to know that do let me know that

    cheers
    Thanks n Regards
    Harinath Reddy
    Learn Hello World Program
    A good scientist is a person with original ideas. A good engineer is a person who makes a design that works with as few original ideas as possible. There are no prima donnas in engineering. - Freeman Dyson

  3. #3
    Join Date
    Aug 2002
    Location
    United States
    Posts
    729
    search the forum for "services" or something to that extent. it also depends on what operating system you're working with.

    i remember once seeing a program that claimed it could turn your regular application into a service.

    win.ini, start folder, registry, services, what loads on startup and i dont think the win.ini is still done since win2k

  4. #4
    Join Date
    Apr 2003
    Location
    Hyderabad,India
    Posts
    486

    As a service it is possible

    I know working with service..
    I think service will solve the basic question of this thread.

    MSDN has even sample code also.
    yesterday i was learning how to start service from program.

    even creating service (converting an exe to service) is not tough.

    search with key words "StartService" "OpenService" "CreateService".. etc.. in vc++ and related tab

    if you need further help i feel happy to do but I am also a newbie to this.

    cheers
    harinath
    Thanks n Regards
    Harinath Reddy
    Learn Hello World Program
    A good scientist is a person with original ideas. A good engineer is a person who makes a design that works with as few original ideas as possible. There are no prima donnas in engineering. - Freeman Dyson

  5. #5
    Join Date
    Jan 2002
    Location
    TamilNadu, India
    Posts
    158
    Looking at your requirement, I think the service idea proposed is the best suited for u. If you need any sample on this topic, u can probably look at this link
    Win32 services

    Hope this helps.
    Muthu

  6. #6
    Join Date
    Apr 2003
    Posts
    12
    hi !
    i think that you can do it in another way. there's a registry key called RunOnce which runs the programs once when the system starts. you can check it out.
    more info on that is available at
    http://msdn.microsoft.com/library/en...asp?frame=true

    Cheers!
    Shelly.

  7. #7
    Join Date
    Apr 2003
    Posts
    39

    a bit cryptic way to do this

    Checkout "creating Winlogon Notification Package" & "WLX_NOTIFICATION_INFO" structure in particular. (in MSDN)
    it takes a 2K machine to implement that stuff

    Winlogon will notify your DLL of these events -- Startup Logon,Logoff,Shutdown,Machine Lock,StartShell,Unlock.

    Provide a handlers for these events, make your system aware of your DLL by creating Reg Keys as mentioned in MSDN, and

    you will have your own "event logger and manager" kinda stuff.

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