Pelles C forum
C language => Windows questions => Topic started 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)
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.
-
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 )
-
The attachment contains a project using the technique above.