There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen blue screen of death boot bsod computer connection crash css dell display driver drivers email error excel firefox firefox 3 hard drive internet internet explorer itunes laptop linux malware monitor network networking outlook outlook 2003 outlook express partition password printer problem problems ram router security slow sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Registry Access


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
asbo's Avatar
Senior Member with 510 posts.
 
Join Date: Sep 2001
Location: who really knows anymore?
Experience: Advanced
15-Jul-2002, 10:12 PM #1
Registry Access
Ok, I know that I can use GetSetting(AppName, SubSetting, Value) to access settings from the said folder of that specific branch of the Registry (VB and VBA Programs). Now, in one of my multiple current projects, I need to find the ComputerName value on a computer, this being a DirectPlay/Message program. I know exactly where it is on all of the involved computers (98SE, ME, XP), and the value is in:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\
ComputerName

How can I access this? It's driving me crazy, and MSDN has nothing on the subject
__________________
·· ħþø ··
-----
- User Friendly by Illiad -
ratchet's Avatar
Senior Member with 1,502 posts.
 
Join Date: Dec 2001
Location: Carson City, NV
15-Jul-2002, 11:00 PM #2
asbo,
Not sure if this will help but you could snoop around.http://www.winguides.com/registry/. Has some interseting info, hope it helps.
IMM's Avatar
IMM IMM is offline IMM is authorized to help remove malware.
Distinguished Member with 3,160 posts.
 
Join Date: Feb 2002
15-Jul-2002, 11:01 PM #3
You could always use a wrapper for registry functions such as this class module http://www.planet-source-code.com/vb...d=609&lngWId=1 or just rip the relevant sections from it.
TimCottee's Avatar
Senior Member with 186 posts.
 
Join Date: Oct 2001
Location: Southampton, England
16-Jul-2002, 04:16 AM #4
Or alternatively use an API call to get the computer name and not bother with the registry for this.
Code:
'example by Donavon Kuhn (Donavon.Kuhn@Nextel.com)
Private Const MAX_COMPUTERNAME_LENGTH As Long = 31
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
    Dim dwLen As Long
    Dim strString As String
    'Create a buffer
    dwLen = MAX_COMPUTERNAME_LENGTH + 1
    strString = String(dwLen, "X")
    'Get the computer name
    GetComputerName strString, dwLen
    'get only the actual data
    strString = Left(strString, dwLen)
    'Show the computer name
    MsgBox strString
End Sub
DJ P@CkMaN's Avatar
Senior Member with 414 posts.
 
Join Date: Aug 2001
Location: Burpengary, QLD, Australia
16-Jul-2002, 05:33 AM #5
hmm.. you should all probably know by now that timmy knows all there is to know about VB i just direct by VB questions straight to him now
asbo's Avatar
Senior Member with 510 posts.
 
Join Date: Sep 2001
Location: who really knows anymore?
Experience: Advanced
16-Jul-2002, 11:26 AM #6
Hmm.. Since it appears to be copy, paste, I think I'll use Tim's way. Who wouldn't

ratchet, didn't look around much, since Tim posted an API work-around, but thanks for the link, I'll add it to my collection

IMM, I am by far, the WORST selctive copy-and-paster know to man . Thanks for the link, though, I'll add PSC to my group also.

Quote:
Originally posted by DJ P@CkMaN:
hmm.. you should all probably know by now that timmy knows all there is to know about VB i just direct by VB questions straight to him now
Lol DJ. I might havta join you.

TIM IS GOD!!

Thanks everyone!!
__________________
·· ħþø ··
-----
- User Friendly by Illiad -

Last edited by asbo : 16-Jul-2002 11:35 AM.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:12 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.