1.

Solve : Vb 6.0?

Answer»

Hi
1.Please give the code for FINDOUT the running vb APLLICATION(exe) name.
2.code for whether particular printer(dot matrix) is on or off.
3.Code for get FILE SIZE like (*.exe, *.mdb,*.exe,*.txt,...)
  THANKSI did a little search this is what i have found

This is for get files size

'This project needs
' -a Command Button (Command1)
' -a CommonDialog (CommonDialog1)
' -a Label (Label1)
Private Const OF_READ = &H0&
Private Declare Function LOPEN Lib "kernel32" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Long) As Long
Private Declare Function lclose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long

Private Declare Function GetFileSize Lib "kernel32" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long
Dim lpFSHigh As Long

Public Sub GetFileS(FilePath As String)
    Dim Pointer As Long, sizeofFile As Long
    Pointer = lOpen(FilePath, OF_READ)
    'size of the file
    sizeofFile = GetFileSize(Pointer, lpFSHigh)
    Label1.Caption = sizeofFile & " bytes"
    lclose Pointer
End Sub

Private Sub command1_Click()
    CommonDialog1.ShowOpen
    GetFileS CommonDialog1.filename
End Sub

Private Sub Form_Load()
    With CommonDialog1
        .DialogTitle = "Select a file"
        .Filter = "All the files|*.*"
    End With
    Command1.Caption = "Select a file"
End Sub__________________



Discussion

No Comment Found