Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile Exe
#Dim All
%Unicode = 1
#Include "Win32API.inc"
%IDC_TextBox = 500
%ID_Timer = 501
Global hDlg As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "PowerBASIC",300,300,200,80, %WS_OverlappedWindow To hDlg
Control Add TextBox, hDlg, %IDC_TextBox,"c:\_test\x.bas", 10,10,180,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Static oldFile, tempFile As DirData, temp$
Select Case Cb.Msg
Case %WM_InitDialog
SetTimer hDlg, %ID_Timer, 250, ByVal %Null
Control Get Text hDlg, %IDC_TextBox To temp$
temp$ = Dir$(temp$, 0, To oldFile)
Case %WM_Timer
Control Get Text hDlg, %IDC_TextBox To temp$
temp$ = Dir$(temp$, 0, To tempFile)
If tempFile.LastWriteTime <> OldFile.LastWriteTime Then
KillTimer hDlg, %ID_Timer
? "File changed!"
End If
Case %WM_Destroy
KillTimer hDlg, %ID_Timer
End Select
End Function
'gbs_01275
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm