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.
You can but it would be quite a hack. You would have to create the FileDialog and open it modeless rather than modal, and hidden. So the window is there but you can't see it. When you click your "popup" you can then could unhide the windows dialog.