Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Check Registry Setting For Your App Startup


I know how to add my app to the registry so it will startup when the users computer starts, but I am a little confused on how to retrieve that value to check if its already been saved. I know in the sub it shows you how to get a saved registry setting, but again im still confused on how to get the start up registry setting.

I am using this method to save the entry:
------------------------------------------------------------------------

Code:
Call MakeStartUp(AddFile(App.Path, (App.EXEName & ".exe")))
------------------------------------------------------------------------
and this is the sub for it:
-------------------------------------------------------------------------

Code:
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long
Public Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long


Public Const REG_SZ = 1 ' Unicode nul terminated String
Public Const REG_DWORD = 4 ' 32-bit number
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Public Const HKEY_PERFORMANCE_DATA = &H80000004
Public Const ERROR_SUCCESS = 0&


'Option Explicit
Const UNIT_NAME = "UTILITY"


Public Sub MakeStartUp(FileName As String)
Dim Counter As Integer
Dim MarkPos As Integer
Dim Application As String

Application = GetFileName(FileName)
Application = Left(Application, (Len(Application) - 4)) 'Replace(Application, ".exe", "", , , vbTextCompare) & "~@#"
Call SaveString(HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindowsCurrentVersionRun", Application, FileName)
End Sub

Public Sub SaveKey(hKey As Long, strPath As String)
Dim KeyHand&
Dim r As Long

r = RegCreateKey(hKey, strPath, KeyHand&)
r = RegCloseKey(KeyHand&)
End Sub

Public Function GetString(hKey As Long, strPath As String, strValue As String)
'EXAMPLE:
'
'text1.text = getstring(HKEY_CURRENT_USE
'
' R, "SoftwareVBWRegistry", "String")
'
Dim KeyHand As Long
Dim datatype As Long
Dim lResult As Long
Dim strBuf As String
Dim lDataBufSize As Long
Dim intZeroPos As Integer
Dim r As Long
Dim lValueType As Long

r = RegOpenKey(hKey, strPath, KeyHand)
lResult = RegQueryValueEx(KeyHand, strValue, 0&, lValueType, ByVal 0&, lDataBufSize)


If lValueType = REG_SZ Then
strBuf = String(lDataBufSize, " ")
lResult = RegQueryValueEx(KeyHand, strValue, 0&, 0&, ByVal strBuf, lDataBufSize)


If lResult = ERROR_SUCCESS Then
intZeroPos = InStr(strBuf, Chr$(0))


If intZeroPos > 0 Then
GetString = Left(strBuf, intZeroPos - 1)
Else
GetString = strBuf
End If
End If
End If
End Function

Public Sub SaveString(hKey As Long, strPath As String, strValue As String, strdata As String)
'EXAMPLE:
'
'Call savestring(HKEY_CURRENT_USER, "Sof
'
' twareVBWRegistry", "String", text1.t
' ex
' t)
'
Dim KeyHand As Long
Dim r As Long

r = RegCreateKey(hKey, strPath, KeyHand)
r = RegSetValueEx(KeyHand, strValue, 0, REG_SZ, ByVal strdata, Len(strdata))
r = RegCloseKey(KeyHand)
End Sub


Function GetDWord(ByVal hKey As Long, ByVal strPath As String, ByVal strValueName As String) As Long
'EXAMPLE:
'
'text1.text = getdword(HKEY_CURRENT_USER
'
' , "SoftwareVBWRegistry", "Dword")
'
Dim lResult As Long
Dim lValueType As Long
Dim lBuf As Long
Dim lDataBufSize As Long
Dim r As Long
Dim KeyHand As Long

r = RegOpenKey(hKey, strPath, KeyHand)
' Get length/data type
lDataBufSize = 4
lResult = RegQueryValueEx(KeyHand, strValueName, 0&, lValueType, lBuf, lDataBufSize)


If lResult = ERROR_SUCCESS Then


If lValueType = REG_DWORD Then
GetDWord = lBuf
End If
'Else
'Call errlog("GetDWORD-" & strPath, Fals
'
' e)
End If
r = RegCloseKey(KeyHand)
End Function


Function SaveDword(ByVal hKey As Long, ByVal strPath As String, ByVal strValueName As String, ByVal lData As Long)
'EXAMPLE"
'
'Call SaveDword(HKEY_CURRENT_USER, "Soft
'
' wareVBWRegistry", "Dword", text1.tex
' t)
'
'
Dim lResult As Long
Dim KeyHand As Long
Dim r As Long

r = RegCreateKey(hKey, strPath, KeyHand)
lResult = RegSetValueEx(KeyHand, strValueName, 0&, REG_DWORD, lData, 4)
'If lResult <> error_success Then
' Call errlog("SetDWORD", False)
r = RegCloseKey(KeyHand)
End Function


Public Function DeleteKey(ByVal hKey As Long, ByVal strKey As String)
'EXAMPLE:
'
'Call DeleteKey(HKEY_CURRENT_USER, "Soft
'
' wareVBW")
'
Dim r As Long

r = RegDeleteKey(hKey, strKey)
End Function


Public Function DeleteValue(ByVal hKey As Long, ByVal strPath As String, ByVal strValue As String)
'EXAMPLE:
'
'Call DeleteValue(HKEY_CURRENT_USER, "So
'
' ftwareVBWRegistry", "Dword")
'
Dim KeyHand As Long
Dim r As Long

r = RegOpenKey(hKey, strPath, KeyHand)
r = RegDeleteValue(KeyHand, strValue)
r = RegCloseKey(KeyHand)
End Function

Public Sub DeleteFromStartup(FileName As String)
Dim Counter As Integer
Dim MarkPos As Integer
Dim Application As String

Application = GetFileName(FileName)
Application = Left(Application, (Len(Application) - 4)) 'Replace(Application, ".exe", "", , , vbTextCompare) & "~@#"
Call DeleteValue(HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindowsCurrentVersionRun", Application)
End Sub

Public Function GetFileName(Path As String) As String
'returnes the filename from a path.

Dim Counter As Integer
Dim LastPos As Integer

LastPos = 1
For Counter = 1 To Len(Path)
If Mid(Path, Counter, 1) = "" Then
LastPos = Counter
End If
Next Counter

GetFileName = Mid(Path, (LastPos + 1), Len(Path))

End Function

Public Function AddFile(Path As String, File As String) As String
'This procedure adds a file name to a path.
If Right(Path, 2) = ":" Then
Path = Path & File
Else
Path = Path & "" & File
End If

AddFile = Path
End Function




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Setting Startup Properties In VBA
Hey all, i'm trying to program my users to have different types of access depending on their user name. I've been trying to implement startup codes that will disable certain things within VBA. Attached is what i have so far. However, i find that, even with everything disabled (im using the special key "F11" to test) i'm still able to access the "disabled" items.

Edit: k, i kinda got it working now. but now what happens is the affects take place the next time i open it =S is there any way to ensure they affect the database immediately?

Setting Startup Module
When starting VB and opening a project, is there a way to set a particular module/form so that's form code appears?
I have a project with several modules, forms etc, but the one I work on most is not the opening.
Is there a way to set this parameter?
Thanks.

Windows Startup Setting
How do I give my app the option to load when Windows 2000 starts up?

Thanks

Setting Startup Form???
Hey, I'm testing something out to see if it works, and I added an example form to my empty project, I removed the form1. Now I just have a form called testform. When I try to run the program I get the following error message:

Must have Startup form or Sub Main()

How can I set testform as my startup form.

Thanks

Setting Startup Form?
how do I change the project startup form with a command button? thanks, Drew

Add To Startup In Registry.
How would I add a file to the startup in the registry?

Registry Startup Key
I've tried reading through a couple of examples but I can't really differentiate between what's what. Here's what I want to do:

I have a checkbox that says 'Start with windows.' When it is ticked, I want to create a key in HKCU...RUN with the path and when it is unticked I want it to delete this key.

Thanks for any help.

Registry Startup With XP
I knwo how to add something to the startup in Windows with VB and I can do it in the LocalMachine or CurrentUser but forr XP that has multiple logins on the one machine, how can I have it run for all users without having to do the install on each user? If I do it on the LocalMachine key, it only works if users have admin access.

Any suggestions?

Thanks!

Registry To 'On StartUp'?!
I wanna put an option in my app so the user can choose if he wants the app to b open on startup of windows.
is there a key for that option in the registry so i can write to it?

Registry And Startup
I want to be able to search through the registry and the win.ini to find all programs that are started up with my computer and list them in a ListView.

Does anyone have any ideas how I can go about doing this?

Startup Registry
I'm trying to get my program to run on startup of windows. I know about the Start Up folder, but that sounds flimsy.
I searched for some info about using the registry and it says to use the key
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun
but I don't know what to do from then on(and how to) in visual basic. Any helps?

Registry Startup
Hi Folks,
Just wondered if any of you knew where the registry strings are that startup up programs and other files? I know I could use the startup folder or win.ini etc, but I want to know where abouts those registry settings are. Thanx

Rhys
--------------
VB6 LE

Startup With Registry
I need to know how to make my program start up when the computer turns on, and I don't want to put in in the Startup folder in the programs/start menu. Is there a startup key in the registry where I can add my program into? Please help. Thanx.
-Mike

Help On Run-at-startup In Registry
I need my program to run on startup... One way is to place a shortcut in the STARTUP folder in the Start menu and another is putting it in the registry (That's a scary place). I know where to put it to run on Startup on my Computer, but do all the Windows Platforms have that same path?

Add To Registry-Startup
Hi Guys...

Could someone please tell me, how do i add code into my program to add itself into:
"HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun"

Does any1 have the code to do this, and where do i insert this code, such as it only executes the code the 1st time, add itself(the program) to the registry, and makes the program start everytime windows start up??

I know how to do it manually, but how do i do it through code.

Thanks guys

<DIESEL>
If it wasn't for the last minute, NOTHING would get done!!!

Setting Label Caption During Startup
I'm writing a Word Macro in VB6. How can I set the Caption setting with a variable as it starts up. I want to do this:


Code:
CurrentUser.Caption = CMNGetUserName()
CurrentPath.Caption = "\SERVER$" & CMNGetUserName() & ""
But if I put it at the top it says Invalid Outside Procedure, not suprising, but I don't know what to do!

Help Setting Webcam Resolution At Startup
I want to take pictures using a webcam and save the picture at 160x120 resolution. I want to be able to use an ini file to store the picture resolution so I don't have to re-compile my program if i want to change the resolution. I have the code below in my project behind a "Format" button, which pops up a window allowing me to change the resolution but I want to set the resolution values right away at start up. Can anyone help.


Code:
Dim temp As Long
temp = SendMessage(hCap, WM_CAP_DLG_VIDEOFORMAT, 0&, 0&)


thanks in advance

How Do I Add A Startup Item To The Registry?
How do i add a startup item to the registry?

I want to add "c:Text.exe" to start up when windows start up.
So i want to edit the Registry location or the startup item, location is:
"My ComputerHKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersion Run"

i want to add this string to it
Value name: Test
Value data: c:Test.exe

How would i do this? I read the example at http://www.mentalis.org/apilist/RegCreateKey.shtml but i didn't get it.

Can any one help with this?

Startup Registry Key Problem
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_MACHINEsoftwaremicrosoftwindowscurrentversion
un)
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, "softwaremicrosoftwindowscurrentversion
un", 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

How Can U Put A Program In Startup Via Registry?
how can you make the program automatically start up , by modifying the registry??

I find it more reliable.. but i dont know how to do it

can anybody tell me where the reg location is located?

Registry Startup Question
if i want to add an entry to my

HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun

does the 'name' have to be the name of the exe?

e.g... if this set the entry in registry

SetKeyValue HKEY_CURRENT_USER, "SoftwareMicrosoftWindowsCurrentVersionRun", "name", "C:lah.exe", Reg_String

would blah.exe startup everytime windows started, if that entry was in registry?

Startup Registry Code
VB Code:
Private Sub Form_Load()'Add the program to regedit. So it runs each time the computer restarts. Dim sAppEXE As String  sAppEXE = App.Path & IIf(Right$(App.Path, 1) = "", "", "") & App.EXEName & ".exe"    SaveSettingString HKEY_CURRENT_USER, "SoftwareMicrosoftWindowsCurrentVersionRun", App.Title, Chr$(34) & sAppEXE & Chr$(34)End Sub


do i need something for the 'SaveSettingString ' part? or will the code work fine as it is to make the program restart on my pc

Registry Startup Flags
Hello !

I am developing a software which loads itself in to the Systm Tray when windows loads.
I have created a value in the registry HKLM / Run section.

I have seen that many startup applications have put flags in the value data after specifying the path of the application.

i.e. /background /min -onboot -quite etc.

My question 1. What is the purpose of using thease flags?
My question 2. Could any body give the complete list of flags and it's Usage?

Thanks and looking forward to see the replies.

App As Startup Registry Problem.
Error:

Quote:





Compile error:
Argument not optional





Code

VB Code:
Private Sub cmdSaveChanges_Click()    On Error GoTo cmdSaveChanges_Click_Err     Dim SetNTService As Long    SetNTService = App.Path & "" & App.EXEName & ".exe"    If cboNTService.Text = "Enabled" Then        SaveSetting "HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionRun", "Operations Manager Pro", SetNTService    Else        DeleteSetting "HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionRun", "Operations Manager Pro", SetNTService    End If        Unload Me        Exit SubcmdSaveChanges_Click_Err:     STZ_ErrHandleFILE "cmdSaveChanges_Click"End Sub

Add File To Startup-registry
I'm want to make a program that you enter a filename of a exe or batch file into a text box and you click on a cmd that file will start when your computer starts. I would want it to use the registry, unfortunately, I have no clue on how to do this. Can somebody tell me how to make add something to the registry to make an app load up on startup? Thank you for your time

Registry Startup Error
Dim Reg As Object
Set Reg = CreateObject("wscript.shell")
Reg.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMICROSOFTWINDOWSCURRENTVERSIONRUN" & "App.EXEName", App.Path & "" & App.EXEName & ".exe"


run time error 2147024770 (8007007e)

Set Reg = CreateObject("wscript.shell")

any ideas :S?thanks

API Find Startup Registry
IS there an API that will tell me that path to the RUN folder in the registry?

you know

"HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun""

thanks

Run On Startup / Code For Registry ???
How do you get a program to run when the PC is restarted.

For some reason, some methods dont work on the particular PC's I'm using it on eg: putting it in the windowsstart menuprogramsstart up directory wont work.

Could you therefore post any way you know even if there is already other methods posted.


Thanks All

Adding To Startup Registry
ide like a simple startup registry code. nothing special, just one that will aloow me to have my add startup on every boot up.

Registry And Windows Startup.
hello.

I just found in some of the faqs one that posted by kgo how to run your program when windows starts,

Code:Dim Reg As Object
Set Reg = CreateObject("wscript.shell")
Reg.RegWrite "HKEY_LOCAL_MACHINESOFTWAREMICROSOFTWINDOWSCURRENTVERSIONRUN" & App.EXEName, App.Path & "" & App.EXEName & ".exe"

but the problem is that I have a preferences in my prog with checkbox ("Execute the program when Windows starts") so if there is a V in the checkbox so the code is entered to registry, but if there is no V so it need to be deleted if it was there. Can anyone help?

Registry Keys To Start An App At Win Startup
are there any oher keys like

HKLMSoftwareMicrosoftWindowsCurrentVersionRun
HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnce
HKCUSoftwareMicrosoftWindowsCurrentVersionRun
HKCUSoftwareMicrosoftWindowsCurrentVersionRunOnce

that i can use to run my app at windows startup i want a more hidden key than those

thnks

Registry Application Like Startup In Msconfig
i am new and need a little help. I have a project i am almost finished and am strugling with the last little bit of the project. i have created a listbox and have changed the type to checkbox. now what i want to do and need help with is this. I want to be able to list all the string names and values that exist at 7 different key and depending on what key they reside at, either have a check in the checkbox next to the string name and value that has been written to the listbox or not. for example: i want all the string names and values read from hkey_local_machinemicrosoftsoftwarewindowscurrentversion
un to be written to the listbox, as well as run-, runservices, runservices-,runonce, runonce-, etc...
If the string resides at a subkey that doesnt end in a "-" then the checkbox will be checked, but if the string and value do reside at a subkey that ends in a "-", the checkbox will be unchecked.

the second part i would like i to do is if you check or uncheck a box then it needs to copy the string value from the subkey with the "-" to the subkey without the "-" or vice versa.

basicly what this is is an application very similar to the startup portion of msconfig.exe in windows. please help me.

thank you

Mark

Running From Registry On Startup/Shutdown
Could someone remind me what the key is for running an app on startup, and is it possible to do the same thing on shutdown?- CHEEEEEEEERS.

Remove Startup Application From Registry!
How I can remove a startup application from "HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun" registery by visual basic 6.0 ?

*RESOLVED* Windows Registry - Startup
Help!
    I have an installation program that I wrote which installs an application on a clients PC. I would like to automatically add some code to the Windows registry so the application will start up each time the system re-boots. I have tried different API calls but have failed.

    I am sure there is a "simple" API procedure for this. Can someone help me?

Thanks,

Puffgroovy        




Edited by - Puffgroovy on 2/16/2005 7:10:18 AM

Editing The Registry To Launch My Program At Startup?
I know I need to use the win API of sorts to create a registry key to launch my program with windows. It's just basically my own personal little launch center... And rather than using the startup section (where my GF can delete the link - as she often does for no apparent reason) I'd like to have it in the registry where it will still come up but she will be sure not to find it =)

Thanks

Mike

Adding My File To The System Startup In The Registry
how can i add my file to the system startup in the registry

HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run"

HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\RunServices"

how is this done? i have seen source codes n searched this forum but nothings really got me any further

Unable To Read From Registry At Startup Everytime
Hi

I have a VB6 application which is in the startup folder. so it runs everytime the PC is turned on.

In the Main method - I am trying to find the name of the Computer from the Registry. The problem is that the code is not able to get the computer name every time. The field variable where the computer name is stored is g_cWorkStation. Perhaps the registry is inaccessible for a few milliseconds at startup ?

I am guessing here that the Registry has trouble  sometimes getting hold of the Workstation name at startup OR  there is a bug in my local class cRegistryAccess. cRegistryAccess handles all the information pertaining to the registry.

Has anyone heard of a similar problem ? where can I find out exactly what is going on ?

I set my registry object as follows


Set g_objReg = New cRegistryAccess

My code is as follow

'-----------------------------------------------------------------------------
Private Sub Main()
   
   On Error GoTo ErrorHandler
   
    'Init Prime/Drain labview event verification
    g_bLabViewEventReceived = False

    'Detect valid COM Port and connection
    Set g_objDeviceInfo = New DeviceInfo

    g_nCommPort = g_objDeviceInfo.DetectConnectedPort
    g_objDeviceInfo.CommPort = g_nCommPort
    
    'Set Device info XML Class
    Set g_objDevice = New cDevice
            
   ' Show the splash screen.
    frmSplash.Show

    g_cWorkStation = g_objReg.GetRegistryValue(HKEY_LOCAL_MACHINE, _
                "SYSTEMCurrentControlSetControlComputerNameActiveComputerName",  "ComputerName")
    
            
    Exit Sub

ErrorHandler:
    MsgBox "Please ensure the device is connected properly, then try again."     
    If Not frmSplash Is Nothing Then
        Unload frmSplash
    End If
    
End Sub

RegOpenKeyEx Reads Registry Erratically In Startup
Hi Anyone expert in windows API function RegOpenKeyEx

I have a VB6 application. It is in startup folder - so it gets started as soon as the PC is turned on. In the MAIN method - I try to find the computer name. 90% of the time the application is successful. The error handler has been commented out - so I don't know what happens - but sometimes the application is unable to get the computer name.

Is there an access issue right at startup ?

following is my code.

I declare my windows API as follows

Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias _
"RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, _
ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As _
Long) As Long

in my MAIN method I am calling my class object to find the computer name

g_cWorkStation = g_objReg.GetRegistryValue(HKEY_LOCAL_MACHINE, _
"SYSTEMCurrentControlSetControlComputerNameActiveComputerName", "ComputerName")
----------------------------------------------------
My application then calls the following method

------------------------------------------

Public Function GetRegistryValue(ByVal RootKeyName As RootKeyConst, _
ByVal KeyPath As String, ByVal SubKeyName As String) As Variant


Dim lRetVal As Long 'result of the API functions
Dim hKey As Long 'handle of opened key
Dim vValue As Variant 'setting of queried value

GetRegistryValue = Null
lRetVal = RegOpenKeyEx(RootKeyName, KeyPath, 0, _
KEY_ALL_ACCESS, hKey)

'If Not Errors(lRetVal) Then
lRetVal = QueryValueEx(hKey, SubKeyName, vValue)
'If Not Errors(lRetVal) Then
If Len(CStr(vValue)) >= 1 Then _
If Asc(Right(CStr(vValue), 1)) = 0 Then _
vValue = Left(vValue, Len(vValue) - 1)
GetRegistryValue = vValue
'End If
'End If
RegCloseKey (hKey)
End Function
-----------------------------------------------------

i have no clue whats going on - Please help.

khalid
(khalidhaque@yahoo.com)

Keypress Check On Startup
Hi guys,

i have used vb a loong time ago, so i need your help in the following ....
I made a new project and deleted the form - added a new module and thats my code for now ...

Dim RetVal
RetVal = Shell("batfile.bat", 1)

so i can start a "hidden" batchfile.
But what i want is to check on startup (executing the .exe file) if the user is pressing a key (ex: STRG+K or K). Can anyone help me to do so ? Is it possible to make a keycheck when the users starts the exe or is it just possible if a textbox looses his focus a.s.o. ?

Screen Resolution Check At Startup
I made an app with vb6 and all of the forms are exactly 800 x 600 pixels. I forgot to take the task bar height into consideration when I made created this because I never use 800 x 600 res. Anyhow, I spent a lot of time on the graphics so resizing each form is not an option.

What i want to do is check the users screen resolution when the app starts. If the screen res is 800 x 600 or less, a message will pop up saying that the app will not run.

Is there a simple way of doing this?

Get Setting From Registry?
How do I get a setting from the registry belonging to an application?

Like getting what's in HKEY_LOCAL_MACHINE --> SOFTWARE --> SOMEFOLDER --> SOMEFOLDER --> KEYNAME --> KEY

Registry Setting
I know how to save to the Registry using the SaveSetting function in VB. This allows a 'section' and a 'key'.

When I look at the Registry, and settings that were put there by software on my machine I see that the 'Tree' is not just one deep.

i.e

HKEY_CURRENT_USER
|
+--Software
|
+--Microsoft
|
+--Active Setup
|
+--Installed Components
|
+--Fonts Per User


Can anyone tell me if I can do this in VB without using API calls?
If not what API's would I need?

Get Registry Setting
How do I get a registry setting for another application. I want to get the value of the key "UninstallString" in "HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstallAppGate Connect"

Is there a built in command for this or do I have to use an API. I've looked at the function GetSetting but it seems like I only can read settings created by the application itself.

Please help me...

GunYan

Registry Setting?
I know this question is not really about VB or something; it's about Windows 2000. But with all the gathered wisdom here maybe it can be solved ...
Does anyone know if and how the user that Windows 2000 is registred to can be changed? I mean: if you right-click on the "My computer" icon on the desktop, you see on the tab "General" the username who windows is registred to.
I'm working on the computer that used to be someone else's, so Windows is registred to him. Each time i install software, his name comes in the field to who the software should be registred. That's why i'd like to change it .

Anyone can help me??

Setting The Registry
I have a form with a listview and 3 command buttons on it. I need to place code in it so that when the user resizes the form, the new dimensions of the form are remembered in the registry. When he opens the form, its dimensions are according to the new sizes that he adjusted his form to. Can anyone give me the code for this please

Add Setting To Run Registry Key?
How can i add a setting to the Windows registry key Run?

Then, how can i remove it? For when the user disables auto-startup.

Thanx!

Registry Setting?
Can anyone here remember the registry setting in vb, so that when it loads all the code windows are maximized?

I used to have this on my old machine but can't remember it now.

Regards

Chris

Registry VALUE Setting
I need to create a registry key,
two values in the registry key. and set those
two values to some data.

I know how to create the registry key, but
how do I create a named value in that key.



Purushothama R Naidu
pespurshi@usa.net

Copyright © 2005-08 www.BigResource.com, All rights reserved