Results 1 to 9 of 9

Thread: How do i find out what &H2 does

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    6

    Exclamation

    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,
    Mallek

  2. #2
    Guest
    &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

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    6

    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
    Mallek

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    6

    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,
    Mallek

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    6

    Exclamation 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?
    Mallek

  7. #7
    Guest
    You can find out what key = what number by looking up "ASCII" in the VB help file.

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  9. #9
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    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
  •  



Click Here to Expand Forum to Full Width