Make your own free website on Tripod.com

AllApi.net

[an error occurred while processing this directive]
 
Const SHGFI_ICONLOCATION = &H1000
Const MB_ICONASTERISK = &H40&
Const MB_ICONEXCLAMATION = &H30&
Const MAX_PATH = 260
Private Type MSGBOXPARAMS
    cbSize As Long
    hwndOwner As Long
    hInstance As Long
    lpszText As String
    lpszCaption As String
    dwStyle As Long
    lpszIcon As String
    dwContextHelpId As Long
    lpfnMsgBoxCallback As Long
    dwLanguageId As Long
End Type
Private Declare Function GetCommandLine Lib "KERNEL32" Alias "GetCommandLineA" () As String
Private Declare Function GetLogicalDrives Lib "KERNEL32" () As Long
Private Declare Function MessageBoxEx Lib "user32" Alias "MessageBoxExA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal uType As Long, ByVal wLanguageId As Long) As Long
Private Declare Function MessageBoxIndirect Lib "user32" Alias "MessageBoxIndirectA" (lpMsgBoxParams As MSGBOXPARAMS) As Long
Private Declare Sub PostQuitMessage Lib "user32" (ByVal nExitCode As Long)
Private Sub Form_Paint()
    'KPD-Team 1999
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Dim MBP As MSGBOXPARAMS, LDs As Long, Cnt As Long, sDrives As String
    'get the available drives
    LDs = GetLogicalDrives
    sDrives = "Available drives:"
    For Cnt = 0 To 25
        If (LDs And 2 ^ Cnt) <> 0 Then
            sDrives = sDrives + " " + Chr$(65 + Cnt)
        End If
    Next Cnt
    'Show the commandline
    MessageBoxEx Me.hwnd, "The command line: " + GetCommandLine, "Command Line ...", MB_ICONEXCLAMATION, 0
    'Set the structure size
    MBP.cbSize = Len(MBP)
    'Set the icon style
    MBP.dwStyle = MB_ICONASTERISK
    'set the owner wndow
    MBP.hwndOwner = Me.hwnd
    'set teh text
    MBP.lpszText = sDrives
    'set the caption
    MBP.lpszCaption = "Available drives"
    'Show the messagebox
    MessageBoxIndirect MBP
    'end our application
    PostQuitMessage 0
End Sub


 
Copyright © 1998-2000, The KPD-Team.
Send mail to KPDTeam@Allapi.net with comments about this web site.
This site is located at
http://www.Allapi.net/