Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Debug Error On
#Debug Display On
#Include "Win32API.inc"
Global hDlg As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Push", 50,10,100,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If Cb.Msg = %WM_Command And Cb.Ctl = 100 And Cb.CtlMsg = %BN_Clicked Then
ReadMFT
End If
End Function
Sub ReadMFT
Local buffer2 As String * 4096, sWork As String, dwRead As Long
Local a As Asciiz * %Max_Path
a = "\\.\c:"
Open a For Binary Access Read Write Shared As #1
Seek 1, 513 ' start after boot sector so we're in the MFT
While Not Eof(1)
Get$ 1, SizeOf(buffer2), buffer2
sWork = ACode$(buffer2)
dwRead = Len(sWork)
Replace $Nul With $Spc In sWork
If ?(sWork + $Cr + $Cr + "Continue?",%MB_YesNo,Using$("#,", dwRead) + " bytes in buffer") = %IdNo Then Exit Loop
Wend
Close 1
End Sub
'gbs_00847
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm