Question: In Windows application, is it possible to show a popup message in front of SaveAs dialog after SaveAs dialog is being opened? All I managed to get is that popup shows after dialog is closed. 

I need to edit an old application written in C++ (I am not author) but can't manage this task. This is part of code:

/\* ---- called to display the save file dialog ---- \*/

```
ofn.hwndOwner = hwnd; 
ofn.lpstrFile = lpstrFileName; 
ofn.lpstrTitle = lpstrTitleName;

res = GetSaveFileNameW( &ofn );

/* ---- fix file extension ---- */

MessageBox(NULL, "Test", "Testing", MB_OK);

```

Thanks,  

Ilija

Answer: 
If I understand you correct, you want check some stuff (for example, file extension) before closing dialog and show message withou closing. If it's so please look at OFN\_ENABLEHOOK flag in [OPENFILENAME Structure](http://msdn.microsoft.com/en-us/library/ms646839%28VS.85%29.aspx). In this case your code will look something like

```
ofn.hwndOwner = hwnd; 
ofn.lpstrFile = lpstrFileName; 
ofn.lpstrTitle = lpstrTitleName;

/* enables the hook function */
ofn.Flags |= OFN_ENABLEHOOK;
ofn.ofn.lpfnHook = (LPOFNHOOKPROC) MyHookProc;

/* some code here */

res = GetSaveFileNameW( &ofn );

```

Code for `MyHookProc` will look like this:

```
static UINT CALLBACK MyHookProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    if (uMsg == WM_NOTIFY) {
        OFNOTIFYW *notify = (OFNOTIFYW *) lParam;

        if (notify->hdr.code == CDN_FILEOK) {
            /* your code here */
        }
    }
}

```

Hope it will be helpful for you.
It sounds like you want to extend the GUI of a save file dialog box. You can extend the GUI by using your own dialog resource template, and specify `OFN_ENABLETEMPLATE`. This is how many apps show previews / metadata of documents.