Pelles C forum

C language => Windows questions => Topic started by: CLR on January 31, 2013, 12:23:06 AM

Title: Setting the common dialog's path from hook function
Post by: CLR on January 31, 2013, 12:23:06 AM
Hello.

I want to set the common dialog's path from within hook function (http://msdn.microsoft.com/en-us/library/windows/desktop/ms646931%28v=vs.85%29.aspx).
I found this: http://computer-programming-forum.com/74-vb-winapi/376edc27d65dd36d.htm (see response by Don Bradne)

Code: [Select]
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.
Title: Re: Setting the common dialog's path from hook function
Post by: Tino on February 05, 2013, 06:40:00 AM
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 )

Title: Re: Setting the common dialog's path from hook function
Post by: CLR on March 12, 2013, 03:53:20 PM
The attachment contains a project using the technique above.