I have the windows file-browser dialog up, but I wish to know when it's being moved & when it's stopped moving.
I tried a simple callback with #wm_move & #wm_moving but they didn't seem to get fired. Is there a way to hook windows dialogs?
hooking windows dialog box?
Re: hooking windows dialog box?
Hi
You can use it with :
- OpenFileRequester()
- SaveFileRequester()
- MessageRequester()
- FontRequester() ;US OS
Title$ = "Font"
- ColorRequester() ;US OS
Title$ = "Color"
You can use it with :
- OpenFileRequester()
- SaveFileRequester()
- MessageRequester()
- FontRequester() ;US OS
Title$ = "Font"
- ColorRequester() ;US OS
Title$ = "Color"
Code: Select all
Global Title$
Procedure FBrowser(Parameter)
Repeat
hwnd = FindWindow_("#32770",Title$)
Until hwnd
Repeat
GetWindowRect_(hwnd,r.RECT)
If GetAsyncKeyState_(#VK_LBUTTON) = 32768 And r\left <> oldleft
Debug "Moving"
oldleft = r\left
flag = 1
ElseIf GetAsyncKeyState_(#VK_LBUTTON) = 32768 And (r\right - r\left <> oldwidth Or r\bottom -r\top <> oldheight)
Debug "Sizing"
oldwidth = r\right - r\left
oldheight = r\bottom -r\top
flag = 1
ElseIf GetAsyncKeyState_(#VK_LBUTTON) = 0 And flag = 1
Debug "Stopped"
flag = 0
EndIf
ForEver
EndProcedure
Thread = CreateThread(@FBrowser(), 0)
Title$ = "Please choose file to load"
File$ = OpenFileRequester(Title$, "", "", 0)
If File$
Debug File$
KillThread(Thread)
EndIf
Egypt my love
Re: hooking windows dialog box?
Code: Select all
Global hook, wndProc
Procedure HookCallback(hWnd, Msg, wParam, lParam)
Select Msg
Case #WM_WINDOWPOSCHANGED
*wp.WINDOWPOS = lParam
Debug "x:" + *wp\x + " y:" + *wp\y + " w:" + *wp\cx + " h:" + *wp\cy
EndSelect
ProcedureReturn CallWindowProc_(wndProc, hWnd, Msg, wParam, lParam)
EndProcedure
Procedure HookProc(nCode, wParam, lParam)
Select nCode
Case #HCBT_ACTIVATE
wndProc = SetWindowLongPtr_(wParam, #GWL_WNDPROC, @HookCallback())
UnhookWindowsHookEx_(hook)
ProcedureReturn 0
EndSelect
ProcedureReturn CallNextHookEx_(hook, nCode, wParam, lParam)
EndProcedure
hook = SetWindowsHookEx_(#WH_CBT, @HookProc(), #Null, GetCurrentThreadId_())
OpenFileRequester("Open", "", "All files (*.*)|*.*", 0)
Et cetera is my worst enemy
Re: hooking windows dialog box?
Thank you both.
The dialog I'm using is SHBrowseForFolder_() - I'll see if I can adapt/use either method with that.
Thank you for your replies... Sorry for my late reply, had a paper due that took all my attention.
The dialog I'm using is SHBrowseForFolder_() - I'll see if I can adapt/use either method with that.
Thank you for your replies... Sorry for my late reply, had a paper due that took all my attention.