Setting the common dialog's path from hook function

Started by CLR, January 31, 2013, 12:23:06 AM

Previous topic - Next topic

CLR

Hello.

I want to set the common dialog's path from within hook function.
I found this: http://computer-programming-forum.com/74-vb-winapi/376edc27d65dd36d.htm (see response by Don Bradne)


SendMessage GetParent(hWnd), CDM_SETCONTROLTEXT, ID_FILETEXT, ByVal "C:\Program Files"
SendMessage GetDlgItem(GetParent(hWnd), ID_OPEN), WM_LBUTTONDOWN, 0&, ByVal 0&
SendMessage GetDlgItem(GetParent(hWnd), ID_OPEN), WM_LBUTTONUP, 0&, ByVal 0&
SendMessage GetParent(hWnd), CDM_SETCONTROLTEXT, ID_FILETEXT, ByVal ""


I've tried and it works. However, it looks a bit strange. I wonder if there's a better way of doing this.

Tino

Hi  :)

I m not sure if its about Hook s or File Dialogs,
maybe the attached project helps you.

( had to reupload since it was part of old forum i think )


CLR

The attachment contains a project using the technique above.