Tambahin Realtime Scanning bro... (wah.. dah kayak bikin virus aja neh.. hehehe)
Buat sebuah fungsi buat ngecek direktori yang sedang dibuka. pake timer ja.. aku set 200, biar cepet..
Trus cek deh direktori yang sedang dibuka
Neh modul API yang dipake buat cek direktory berdasarkan Caption Window-nya....
Tambahan ja... ^_^
Buat sebuah fungsi buat ngecek direktori yang sedang dibuka. pake timer ja.. aku set 200, biar cepet..
Code:
Sub Lokasi_DirSekarang()
Dim B1 As Long
Dim B2 As Long
Dim B3 As Long
Dim B4 As Long
Dim I As Integer
Dim CURRENT_DIR As String
Dim temp As String * 256
Dim temp2 As String * 256
B1 = FindWindow("ExploreWClass", vbNullString)
B10 = FindWindow("CabinetWClass", vbNullString)
If B1 = GetForegroundWindow Then
B2 = FindWindowEx(B1, 0&, "WorkerW", vbNullString)
SendMessage B1, WM_GETTEXT, 200, ByVal temp2
ElseIf B10 = GetForegroundWindow Then
B2 = FindWindowEx(B10, 0&, "WorkerW", vbNullString)
SendMessage B10, WM_GETTEXT, 200, ByVal temp2 '
End If
B3 = FindWindowEx(B2, 0&, "RebarWindow32", vbNullString)
B4 = FindWindowEx(B3, 0&, "ComboBoxEx32", vbNullString)
SendMessage B4, WM_GETTEXT, 200, ByVal temp
CURRENT_DIR = Mid$(temp, 1, InStr(temp, Chr$(0)) - 1)
On Error GoTo p3k
CUR_DIR.Path = CURRENT_DIR 'Ne DirListBox
CUR_FILE.Path = CUR_DIR.Path 'Ne FileListBox
p3k:
If Err.Number = 76 Then
CUR_DIR.Path = App.Path
End If
End Sub
sub cekSelalu_Timer()
Lokasi_DirSekarang
End SubTrus cek deh direktori yang sedang dibuka
Code:
Sub cekVir_Di_Dir_Sekarang()
Fungsi_Scanning_M31_mu()
'Misalnya
'If Right(CUR_DIR.Path, 1) = "\" Then
' ScanFolder = CUR_DIR.Path & CUR_FILE.List(idx)
'Else
' ScanFolder = CUR_DIR.Path & "\" & CUR_FILE.List(idx)
'End If
End SubNeh modul API yang dipake buat cek direktory berdasarkan Caption Window-nya....
Code:
Public Const DRIVE_REMOVABLE = 2
Public Const DRIVE_FIXED = 3
Public Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Public Declare Function GetForegroundWindow Lib "user32" () As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_GETTEXT = &HDTambahan ja... ^_^
<[[[--- Seorang ninja pun akan melakukan harakiri jika sudah menyangkut dengan harga diri ---]]]>



