Total Format - Total Entertainment
 
 

Go Back   Total Format Forum > Computing Forums > Coding, Design & Graphics

Coding, Design & Graphics If you are programming a script, designing a web page, building your own graphics or anything related and need to discuss it, get help and tips or general advice, then you should post your thoughts to this section.

Reply
 
LinkBack Thread Tools Display Modes
Old 03-01-2006, 10:56   #1 (permalink)
Name, Title, Location kevin
Since 2005

England valid until april
England
Avatarkevin's Avatar
Mood
Posts161
Karma kevin is a beginner.kevin is a beginner.kevin is a beginner.kevin is a beginner.kevin is a beginner.kevin is a beginner.kevin is a beginner.kevin is a beginner.
Pu498.89
Default visual basic (edi tregistry)

ok u know when you edit the regisrty manually to kmake a program startup when the computer boots by editing HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

well does anyone know how i can do this in visual basic?

i just need for this one program to be placed there when someone clicks on my visual basic exe program
kevin's Sig:Always looking for advice
Toolskevin is offline
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links

Old 03-01-2006, 12:34   #2 (permalink)
Name, Title, Location Harv
Dr Slice n Dice M.s.C.

in bath wiv sash
United Kingdom
AvatarHarv's Avatar
Mood
Posts4,277
Karma Harv is outstanding.Harv is outstanding.Harv is outstanding.
Harv is outstanding.Harv is outstanding.Harv is outstanding.
Pu14,820.60
Critters
Blog
Blog Entries: 10
Awards
TF Top Poster Bronze 
Total Awards: 1
Heart Big Beer Umbrella Sunderland AFC Gift Box Cat 2
Default Re: visual basic (edi tregistry)

Registry Access through the Win32 API

By defining Win32 API functions using the Declare statement, you can access the entire registry and perform all operations that are supported by the Win32 API upon the registry. In order to do so, however, you need to define a number of constants in your code.

First, each top-level registry key corresponds to an intrinsic constant, as follows:
Quote:
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_CONFIG = &H80000005
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Second, each of the registry functions returns a numeric code indicating its success or failure. A successful function call returns the following:

Quote:
Public Const ERROR_SUCCESS = 0&
Among the constants representing error codes are the following:
Public Const ERROR_FILE_NOT_FOUND = 2& ' Registry path does not exist
Public Const ERROR_ACCESS_DENIED = 5& ' Requested permissions not available
Public Const ERROR_INVALID_HANDLE = 6& ' Invalid handle or top-level key
Public Const ERROR_BAD_NETPATH = 53 ' Network path not found
Public Const ERROR_INVALID_PARAMETER = 87 ' Bad parameter to a Win32 API function
Public Const ERROR_CALL_NOT_IMPLEMENTED = 120& ' Function valid only in WinNT/2000?XP
Public Const ERROR_INSUFFICIENT_BUFFER = 122 ' Buffer too small to hold data
Public Const ERROR_BAD_PATHNAME = 161 ' Registry path does not exist
Public Const ERROR_NO_MORE_ITEMS = 259& ' Invalid enumerated value
Public Const ERROR_BADDB = 1009 ' Corrupted registry
Public Const ERROR_BADKEY = 1010 ' Invalid registry key
Public Const ERROR_CANTOPEN = 1011& ' Cannot open registry key
Public Const ERROR_CANTREAD = 1012& ' Cannot read from registry key
Public Const ERROR_CANTWRITE = 1013& ' Cannot write to registry key
Public Const ERROR_REGISTRY_RECOVERED = 1014& ' Recovery of part of registry successful
Public Const ERROR_REGISTRY_CORRUPT = 1015& ' Corrupted registry
Public Const ERROR_REGISTRY_IO_FAILED = 1016& ' Input/output operation failed
Public Const ERROR_NOT_REGISTRY_FILE = 1017& ' Input file not in registry file format
Public Const ERROR_KEY_DELETED = 1018& ' Key already deleted
Public Const ERROR_KEY_HAS_CHILDREN = 1020& ' Key has subkeys & cannot be deleted
Third, some of the registry functions in the Win32 API have a parameter whose value is a security access mask indicating the rights that the current process must have in order for the function to execute successfully. The following are the possible values:

Quote:
Public Const KEY_CREATE_LINK = &H20
Public Const KEY_CREATE_SUB_KEY = &H4
Public Const KEY_ENUMERATE_SUB_KEYS = &H8
Public Const KEY_NOTIFY = &H10
Public Const KEY_QUERY_VALUE = &H1
Public Const KEY_READ = ((STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE
Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY)
And (Not SYNCHRONIZE))
Public Const KEY_SET_VALUE = &H2
Public Const KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE
Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE))
Public Const KEY_EXECUTE = ((KEY_READ) And (Not SYNCHRONIZE))
Public Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE
Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY
Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY
Or KEY_CREATE_LINK) And (Not SYNCHRONIZE))
A bit of background about the operation of the registry functions in the Win32 is also important. Registry keys are system objects, and like any system object in the Win32 API, they are accessible through their handles. In other words, to work with a registry key, you must open it. In some form, the function that opens the key will return (usually in a parameter passed to the function by reference) a handle to the registry key, or hKey.
ToolsHarv is offline
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
basic, edi, tregistry, visual

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Windows Vista Troubleshooting Guide Detomah Troubleshooting & Security 3 11-11-2007 23:50
visual c++ meow Coding, Design & Graphics 5 28-10-2007 15:32
Visual Basic WrinklyNinja General Discussion 13 19-01-2005 15:58
visual basic help pls (VB.NET) DeathKitten Coding, Design & Graphics 10 26-11-2004 09:36
Visual basic help ? Angelic Gabriel Coding, Design & Graphics 2 14-09-2004 20:07

 
 
Archive - RSS Feeds - About Us - Privacy - Terms of Use - Site Map - Advertising - Link To TF - Contact Us - Top
Content Relevant URLs by vBSEO 3.2.0 RC5 Copyright ©2003 - 2000, Total Format. Forums powered by vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Limited.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385