Results 1 to 14 of 14

Thread: Undocumented API's

  1. #1
    Guest

    Lightbulb

    Code:
    'does a file exist?
    Private Declare Function SHFileExists Lib "shell32" Alias "#45" (ByVal szPath As String) As Long
    Private Sub Form_Load()
        MsgBox "Does the file exist?" + Str$(SHFileExists("c:\autoexec.bat"))
    End Sub
    Code:
    'format a drive
    Const SHFD_CAPACITY_DEFAULT = 0 ' default drive capacity
    Const SHFD_CAPACITY_360 = 3 ' 360KB, applies to 5.25" drives only
    Const SHFD_CAPACITY_720 = 5 ' 720KB, applies to 3.5" drives only
    Const SHFD_FORMAT_QUICK = 0 ' quick format
    Const SHFD_FORMAT_FULL = 1 ' full format
    Const SHFD_FORMAT_SYSONLY = 2 ' copies system files only (Win95 Only!)
    Private Declare Function SHFormatDrive Lib "shell32" (ByVal hwndOwner As Long, ByVal iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As Long) As Long
    Private Sub Form_Load()
        'iDrive = The drive number to format. Drive A=0, B=1 (if present, otherwise C=1), and so on.
        SHFormatDrive Me.hwnd, 0, SHFD_CAPACITY_DEFAULT, SHFD_FORMAT_QUICK
    End Sub
    Code:
    'change windows password
    Private Declare Function PwdChangePassword Lib "mpr" Alias "PwdChangePasswordA" (ByVal lpcRegkeyname As String, ByVal hwnd As Long, ByVal uiReserved1 As Long, ByVal uiReserved2 As Long) As Long
    Private Sub Form_Load()
        PwdChangePassword "SCRSAVE", Me.hwnd, 0, 0
    End Sub
    Code:
    'flash a window more than once
    Const FLASHW_STOP = 0 'Stop flashing. The system restores the window to its original state.
    Const FLASHW_CAPTION = &H1 'Flash the window caption.
    Const FLASHW_TRAY = &H2 'Flash the taskbar button.
    Const FLASHW_ALL = (FLASHW_CAPTION Or FLASHW_TRAY) 'Flash both the window caption and taskbar button. This is equivalent to setting the FLASHW_CAPTION Or FLASHW_TRAY flags.
    Const FLASHW_TIMER = &H4 'Flash continuously, until the FLASHW_STOP flag is set.
    Const FLASHW_TIMERNOFG = &HC 'Flash continuously until the window comes to the foreground.
    Private Type FLASHWINFO
        cbSize As Long
        hwnd As Long
        dwFlags As Long
        uCount As Long
        dwTimeout As Long
    End Type
    Private Declare Function FlashWindowEx Lib "user32" (pfwi As FLASHWINFO) As Boolean
    Private Sub Form_Load()
        Dim FlashInfo As FLASHWINFO
        'Specifies the size of the structure.
        FlashInfo.cbSize = Len(FlashInfo)
        'Specifies the flash status
        FlashInfo.dwFlags = FLASHW_ALL Or FLASHW_TIMER
        'Specifies the rate, in milliseconds, at which the window will be flashed. If dwTimeout is zero, the function uses the default cursor blink rate.
        FlashInfo.dwTimeout = 0
        'Handle to the window to be flashed. The window can be either opened or minimized.
        FlashInfo.hwnd = Me.hwnd
        'Specifies the number of times to flash the window.
        FlashInfo.uCount = 0
        FlashWindowEx FlashInfo
    End Sub
    Private Sub Form_Paint()
        Me.CurrentX = 0
        Me.CurrentY = 0
        Me.Print "Click me !"
    End Sub

    those are the only good ones I found, if anybody has any other ones they would like to share, post them, Please!

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    A while ago, there was a post just like this one. And someone spoke about a site with a lot of undocumented api's.
    This is the url: http://www.geocities.com/SiliconValley/4942/index.html

  3. #3
    Guest
    I have that place bookmarked in 3 different folders in my favorite places

    but that is more of a C++ site.....

    and this is a VB Forum...(well this one right here(general vb QA)

  4. #4
    Guest
    There was a topic about this awhile ago. It's in the API forum.

  5. #5
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444
    is it possible that these api's are not documented because some of them do not appear to work under NT 4.0?
    I am so skeptical, I can hardly believe it!
    PS I am not a 'hyperactive member' I am a cool, calm, and collected member

  6. #6
    Guest
    I think the reason lots of them are undocumented is because they are, for whatever reason, not acceptable i.e:
    consume too much resources or they have been supersended by another function. Have any of you Non-C++ programmers
    heard of _hread or _lopen?

    Another reason that some believe is that Microsoft wants to hide them from the public! lol.

  7. #7
    Guest
    well, All api's are documented, just not publicly

    it would be stupid to add a hidden function, and not even write the declaration down.... hehehe.....

  8. #8
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Has Microsoft released the source code of Windows to the public?

  9. #9
    Guest
    Not yet. There should have been a headline (or some advertisement) on their website to let people know that it's up.

    Dennis: Actually, not all of them are documented. Some people have to dig deep into the dll files to extract the functions.

  10. #10
    Hyperactive Member badgers's Avatar
    Join Date
    Sep 1999
    Location
    Madison, WI USA
    Posts
    444

    oetje:
    which version of windows are you referring to?
    I am so skeptical, I can hardly believe it!
    PS I am not a 'hyperactive member' I am a cool, calm, and collected member

  11. #11
    Guest
    Megatron, you mean M$ put functions in the dll's and didnt even document the declaration??

  12. #12
    Guest
    Yes. They, of course, have a documentation of it, but do not release some of them.

  13. #13
    Guest
    thats what I meant, MS has all of them documented, thats why I said "not publicly" because it is not available to the public, just MS.

  14. #14
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553

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