I'm trying to add my own button to the OPENFILENAME dialog as a template, and it seems to work,
however, there's two small problems.

The first problem is that the button is being clipped by the drag icon. My template has
the "Clip Children" and "Clip Siblings" flags set to TRUE, but that doesn't seem to be working.
I also tried using SetWindowPos() and HWND_TOP/HWND_TOPMOST flag, but that doesn't work either.

Another problem is that the button has a dark outline. Turning the "Tapstop" flag on/off has
no effect of getting rid of it. The button seems to be in its own grouping, it's not part of
the other buttons, so that might explain why. But, I would like to get rid of the outline.

Any ideas to fix this?

I was thinking of just using the default CDN_HELP button, and rename it to what I want,
(which would solve all of my problems), but I didn't know what ill-effects this would cause, if any.



Some code I use:

Code:
{
 OPENFILENAME ofn;
 ofn.lStructSize 	= sizeof(OPENFILENAME);
 ofn.Flags 		= OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | 
                          OFN_EXPLORER | OFN_HIDEREADONLY |
                          OFN_ENABLEHOOK | 
                          OFN_ENABLETEMPLATE |
                          OFN_SHOWHELP |
                          OFN_ENABLESIZING;
 ofn.lpfnHook           = (LPOFNHOOKPROC)OpenFileHookProc;
 ofn.lpTemplateName  	= MAKEINTRESOURCE(IDD_MY_BUTTON_DIALOG);
 ofn.hInstance          = AfxGetResourceHandle();
}

BOOL CALLBACK
OpenFileHookProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {

 switch (message) {
    case WM_INITDIALOG:
         return TRUE;

     case WM_SIZE: {
          HWND hButton = GetDlgItem( hDlg, IDB_PRESSME );
          SetWindowPos( hButton, NULL, dw-bw-8*2+border, button_rect.top, 0,0, SWP_NOSIZE|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOOWNERZORDER);
          }
          break;

     default:
          break;
 }

 return FALSE;
}