Results 1 to 8 of 8

Thread: Startup

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    59

    Startup

    Can anyone tell me the code to make a program start up with the computer? Using the registry or win.ini? thanx

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Add a shortcut to the Startup folder

    There are registry keys too, but I forgot which ones. Run, RunOnce etc.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3
    Fanatic Member laserman's Avatar
    Join Date
    Jan 2002
    Location
    Wales U.K
    Posts
    775

    STARTMENU

    Why dont you place your program in the windows start menu

    Your exe. file

    Huw

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    HKEY_LOCAL_MACHINE
    Software
    Microsoft
    Windows
    CurrentVersion
    Run

    You can place it in the HKEY_CURRENT_USER hive as this will have the same path under it & only apply to the user who installed your program as opposed to everyone on that machine.

    RunOnce is used when you attempt to install a file & an existing one is in use - you can't overwrite the file so you place an entry to copy over the file in this key which'll excecute the next time windows starts. You don't want this one or the runonce, just use run or as mentioned above (which'll be easier for you) use the startup folder.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    59
    Alex would you mind telling how to to add things to the regestry?

  6. #6
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Phew, took a little while to write this one, but this little module should cover any work relating to adding items into the windows registry...
    Attached Files Attached Files

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  7. #7

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    59
    Thanks a lot man

  8. #8
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: Startup

    Quote Originally Posted by alex_read
    Phew, took a little while to write this one, but this little module should cover any work relating to adding items into the windows registry...

    Yeah.. and it took me a while to debug the problem as well.. Sorry I have just got to post this alex... there is a tiny teeny bit of problem here... you forgot to add the count of the null terminating character for the size of the value.


    This is in CreateRegistryKeyValue
    VB Code:
    1. lngReturnKeyValueSize = Len(Trim(strTempValue)) + 1
    2.            
    3.             If (RegSetValueEx(lngReturnKeyHandle, strKeyName, ByVal 0&, REG_SZ, Trim(strTempValue) & vbNullChar, lngReturnKeyValueSize) = 0) Then
    4.                 CreateRegistryKeyValue = True
    5.             End If

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