Startup Registry Key Problem

vbnovice
05-10-2003, 08:34 AM
Hi,
I have developed an application called "Quick Access XP" it is a program that basicly has a series of command buttons which allows a user to open up notepad e.c.t using the "Shell" command. I have programed the application to start as a tray icon and when it is clicked once (by left or right mouse button) it displays my program. I have menus which allow the user to minimize to tray and to exit. Also I have a Help menu which displays an about form.

Anyway everything works fine but now I want to make my program (using a reg key in HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\)
boot every time the PC starts so it is easily accessable by the user.

This is were I am having trouble I have tried reusing code from sample apps so many times it isn't funny but none of them seem to work.

This is my latest attempt:

On Error Resume Next ' Make sure no errors occur
If App.PrevInstance = True Then End ' If its already running , close this version
regkeyname = "QuickAccessXP"
UpdateKey &H80000002, "software\microsoft\windows\currentversion\run\", regkeyname , App.Path & "\" & App.EXEName & ".exe"



When it is run it comes up with this error "ByRef argument type mismatch"
and highlights the word in orange.

If you have read this far I THANK YOU very much in advance and if you chose to try and help me that is even better!

Thanks :cool:

Squirm
05-10-2003, 08:44 AM
What is the function/sub declaration for UpdateKey?
What variable type is regkeyname?

vbnovice
05-17-2003, 06:04 AM
Hi,
Sorry for this very late reply, my computer was having lots of problems.
You will find all the info you need to when you add the Module "Registry Access.bas" to your application. This is the module you need to add to be able to use these commands in your projects. It will tell you all about them!

Thanks,
vbnovice :cool:

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum