Results 1 to 13 of 13

Thread: lets share some Undocumented API functions

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    19

    Talking

    i'll start with one i converted to vb from a C code i was looking at:

    it will shell explorer's Find Files dialog:

    Declare Function SHFindFiles Lib "shell32.dll" Alias "#90" (ByVal pidlRoot As Long, ByVal pidlSavedSearch As String) As Long

    to use it, SHFindFiles VbNull, VbNull

    what api's can you share?

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Cool, Fraid I don't know any Undocumented ones, I'm pretty sure there was something in that court case thing that said they were going to have to document all the APIs. Wo that'll be quite cool. (probably have to wait a few years knowing the blinding speed the U.S. Justice system works)

  3. #3
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    Here are some undocumented API:

    ****** File exists? ************
    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

    ****** Format dialog ************
    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

    ******
    szPath has an executable extension (if last 4 char are either ".exe", ".com", ".bat" or ".pif") ************
    Private Declare Function SHPathIsExe Lib "shell32" Alias "#43" (ByVal szPath As String) As Long
    Private Sub Form_Load()
    MsgBox "Is path EXEC?" + Str$(SHPathIsExe("c:\autoexec.bat"))
    End Sub

  4. #4
    Guest
    Both EnumDisplaySettings and ChangeDisplaySettings are undocumented. See this tip for their documentation.

  5. #5
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    This may sound like a stupid question...


    Hell, it is a stupid question, but is there a site that documents all the undocumented API functions, or will I have to sue Microsoft to find that out?
    Courgettes.

  6. #6
    Guest

    Talking Winsock

    I don't know what the API's are, but I know there are winsock APIs that are not documented.

  7. #7
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    Yet another usefull API:
    '************* GradientFill() ********
    Private Type TRIVERTEX
    x As Long
    y As Long
    Red As Integer 'Ushort value
    Green As Integer 'Ushort value
    Blue As Integer 'ushort value
    Alpha As Integer 'ushort
    End Type
    Private Type GRADIENT_RECT
    UpperLeft As Long 'In reality this is a UNSIGNED Long
    LowerRight As Long 'In reality this is a UNSIGNED Long
    End Type

    Const GRADIENT_FILL_RECT_H As Long = &H0 'In this mode, two endpoints describe a rectangle. The rectangle is
    'defined to have a constant color (specified by the TRIVERTEX structure) for the left and right edges. GDI interpolates
    'the color from the top to bottom edge and fills the interior.
    Const GRADIENT_FILL_RECT_V As Long = &H1 'In this mode, two endpoints describe a rectangle. The rectangle
    ' is defined to have a constant color (specified by the TRIVERTEX structure) for the top and bottom edges. GDI interpolates
    ' the color from the top to bottom edge and fills the interior.
    Const GRADIENT_FILL_TRIANGLE As Long = &H2 'In this mode, an array of TRIVERTEX structures is passed to GDI
    'along with a list of array indexes that describe separate triangles. GDI performs linear interpolation between triangle vertices
    'and fills the interior. Drawing is done directly in 24- and 32-bpp modes. Dithering is performed in 16-, 8.4-, and 1-bpp mode.
    Const GRADIENT_FILL_OP_FLAG As Long = &HFF

    Private Declare Function GradientFillRect Lib "msimg32" Alias "GradientFill" (ByVal hdc As Long, pVertex As TRIVERTEX, ByVal dwNumVertex As Long, pMesh As GRADIENT_RECT, ByVal dwNumMesh As Long, ByVal dwMode As Long) As Long
    Private Function LongToUShort(Unsigned As Long) As Integer
    'A small function to convert from long to unsigned short
    LongToUShort = CInt(Unsigned - &H10000)
    End Function
    Private Sub Form_Load()
    'API uses pixels
    Me.ScaleMode = vbPixels
    End Sub
    Private Sub Form_Paint()
    Dim vert(1) As TRIVERTEX
    Dim gRect As GRADIENT_RECT

    'from black
    With vert(0)
    .x = 0
    .y = 0
    .Red = 0&
    .Green = 0& '&HFF& '0&
    .Blue = 0&
    .Alpha = 0&
    End With

    'to blue
    With vert(1)
    .x = Me.ScaleWidth
    .y = Me.ScaleHeight
    .Red = 0&
    .Green = 0&
    .Blue = LongToUShort(&HFF00&)
    .Alpha = 0&
    End With

    gRect.UpperLeft = 0
    gRect.LowerRight = 1

    GradientFillRect Me.hdc, vert(0), 2, gRect, 1, GRADIENT_FILL_RECT_H
    End Sub

  8. #8
    Guest
    TransparentBlt
    Code:
    Private Declare Function TransparentBlt Lib "msimg32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal crTransparent As Long) As Boolean
    
    Private Sub Command1_Click()
        TransparentBlt Picture2.hdc, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, vbWhite
    End Sub
    
    Private Sub Form_Load()
        Picture1.ScaleMode = vbPixels
        Picture2.ScaleMode = vbPixels
    End Sub

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    19

    Wink shell...

    im currently working on a shell replacement..so im really looking for all the SH functions..i have some more, lemme know if anyone wants/needs them... Find Compuer dialog, fixed find files dialog, run dialog, special(virtual) folder paths..

  10. #10
    Addicted Member
    Join Date
    May 2000
    Posts
    240

    Talking I want them.

    I would like to see them.

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    19

    Smile

    here's what ive dug up so far...

    Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
    Declare Function SHFindFiles Lib "shell32.dll" Alias "#90" (ByVal pidlRoot As Long, ByVal pidlSavedSearch As Long)
    Declare Function SHFindComputer Lib "shell32.dll" Alias "#91" (ByVal pidlRoot As Long, ByVal pidlSavedSearch As Long)
    Declare Function FileMenu_AppendFilesForPidl Lib "shell32.dll" Alias "#124" (ByVal hMenu As Long, ByVal uReserved As Long, ByVal uID As Long, ByVal pidl As String, uFlags As Any, uEnumFlags As Any, lpfnCallback As Any)
    Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
    Public Declare Function SHRunDialog Lib "shell32" Alias "#61" (ByVal hOwner As Long, ByVal Unknown1 As Long, ByVal Unknown2 As Long, ByVal szTitle As String, ByVal szPrompt As String, ByVal uFlags As Long) As Long
    Public Declare Sub SHAddToRecentDocs Lib "shell32" (ByVal lFlags As Long, ByVal lPv As Any)
    Declare Function SHGetSpecialFolderLocation Lib "Shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long

    Public Declare Function SHGetFolderPath Lib "SHFolder" Alias "SHGetFolderPathA" (ByVal hwndOwner As Long, ByVal nFolder As Long, ByVal hToken As Long, ByVal dwFlags As Long, ByVal sPath As String) As Long



    ----

    im still lookinh for more :]
    vb5 pr

  12. #12
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386
    It took a while but I found the url again....
    http://www.geocities.com/SiliconValley/4942/
    It has a bunch of neat functions.
    Hope this helps

    Crazy D

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    19

    its a small web..

    that site is actually where i found some functions :]
    vb5 pr

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