Article ID: 109696
Article Last Modified on 7/11/2005
BOOL CALLBACK __export FileOpenHook (HWND hDlg, UINT message,
WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_COMMAND:
switch(wParam)
{
// This simulates a double-click on the list of directories,
// effectively forcing the common dialogs to re-read the
// current directory of files and to refresh the list of files.
case IDCANCEL :
PostMessage( hDlg, WM_COMMAND, lst2,
MAKELPARAM(GetDlgItem(hDlg, lst2),
LBN_DBLCLK);
return TRUE;
}
break;
}
return FALSE;
}
If the application targets Win32, the notification message to the list box
is sent differently; here is the PostMessage for Win32 applications:
PostMessage (hDlg, WM_COMMAND, MAKEWPARAM (lst2,LBN_DBLCLK),
(LPARAM)GetDlgItem (hDlg, lst2));
Applications using the IDs of the common dialog box's controls must include
the DLGS.H file.
Additional query words: refresh redraw
Keywords: kbcmndlg kbcmndlgfileo kbcmndlgsave kbhowto KB109696