Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
%Unicode = 1
#Include "Win32API.inc"
Global ghHook As Dword
Function PBMain() As Long
Local filevar$, countvar&
ghHook = SetWindowsHookEx(%WH_CBT, CodePtr(OpenFileProc), GetModuleHandle(""), GetCurrentThreadId)
Display Openfile 0, 100, 100, "Delete File", Exe.Path$, Chr$("Text",0,".txt",0), _
"", "", %OFN_Explorer Or %OFN_FileMustExist Or %OFN_HideReadOnly To filevar$, countvar&
If ghHook Then UnhookWindowsHookEx ghHook : ghHook = 0
End Function
Function OpenFileProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Function = CallNextHookEx(ByVal ghHook, ByVal nCode, ByVal wParam, ByVal lParam)
If nCode = %HCBT_ACTIVATE Then SetWindowText GetDlgItem(wParam,%IdOk), "&Delete"
End Function
'gbs_01399
'Date: 10-17-2014
http://www.garybeene.com/sw/gbsnippets.htm