|
-
Oct 12th, 2000, 07:09 AM
#1
Thread Starter
New Member
Ok i see in alot of these programs that like open CD rom drives and make you start button click in the module or somewhere in the code they have like &H2 or some type of key address i am guessing thats what it is. I would like to know if there is a list of these or if anyone knows a code that will display that # whenever an action takes place on your computer. If not i vouge to write one as soon as i figure out how to use vbasic!
Anyway i'm lost and i'm new i read all the tutorials i could find and now i'm trying to take apart code.
Any help would be greatly appriciated!
Thanks in advance,
-
Oct 12th, 2000, 07:19 AM
#2
&H2 doesn't actually do anything - its just the numer 2 in hex format. It's how it is used (eg as a parametr in a function) that defines what it does.
- gaffa
-
Oct 12th, 2000, 07:24 AM
#3
Thread Starter
New Member
Humm... Now i'm really lost
I thought that every key and command you press on your keyboard has a value assigned to it. (infact i know this)
Like i remember in old days of BASIC i wrote a program than when you ran it would automaticly turn capslock on by sending the key code assigned to the key CAPSLOCK to the computer i don't remember how i did this or even where my old 286 is so i could boot up the darn thing to look at it. I hope that that makes a little more sence
Thanks in advance
-
Oct 12th, 2000, 07:41 AM
#4
transcendental analytic
that has nothing to do with the &H
As gaffa said &H means you convert the hex value following the &H to decimal, so you could as well type the decimal value: 2.
the keys that are assigned a code (keycode) are just plain numbers
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 12th, 2000, 08:45 AM
#5
Thread Starter
New Member
Alright then
Thanks for the replies maybe i'm confused (probably)
Anyway now that i have found out i'm dumb might you be able to tell me how to find out what key = what number
also do actions like opening you CD rom drive have defined numbers also? if so how might i found out what these numbers are?
thanks in advance and sorry about the confusion,
-
Oct 12th, 2000, 06:25 PM
#6
Thread Starter
New Member
Like you can disable cntrl-alt-delete
Like you can disable cntrl-alt-delete by not allowing those key codes to be input... anyone know?
-
Oct 12th, 2000, 06:33 PM
#7
You can find out what key = what number by looking up "ASCII" in the VB help file.
-
Oct 12th, 2000, 07:05 PM
#8
transcendental analytic
well those key codes may be intercepted with getasynckeystate:
Code:
'in declarations
Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
'in code
if GetAsyncKeyState(Keycode) then 'do whatever
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 12th, 2000, 08:19 PM
#9
Fanatic Member
Depending on The Function Called (usually API), A Certain
Constant like this
Code:
Public Const MY_CONST = &H4
can do many things. For Example, to open the CD Door you use the mciSendString API and send it a String Message (Don't rember the one though). Anyway, a better example would be this:
Code:
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Const SM_CXSCREEN = 0 'X Size of screen
Const SM_CYSCREEN = 1 'Y Size of Screen
'There are Tons of constants that can be used, only listed two.
'Then you pass them like this:
Dim retval As Long
retval = GetSystemMetrics(SM_CXSCREEN) 'etc.
Use the VB Api Viewer, or http://www.vbapi.com or the API ToolShed from http://www.allapi.com for this.
So those &HWhaterevers are just Constants being passed to a specific Function
Hope this helps.
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|