• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

Sending a message to a SaveAs common dialog that will change the file path

I am using a the webBrowser control that is creating a MODAL SaveAs Common Dialog when I use ExecWB ( in order to save a file).
I want that the ExecWB message will go without interference.
In order for that I need to update the
new saved file name and path and in some kind of way to order the saveAs message to go smoodly without opening this Modal SaveAs dialog.
Note that I cant change or overload any of the SaveAs common dialog functions cause it is created form inside of the control.
For now I have created a process that Identifies the HWND of the common dialog and I want to send it a message that will tell the dialog that a key was pressed , but I dont know how to do it!
Can someone give me a good advice how to solve my problem and succeed with the saveAs without interference?
  • 4
1 Solution
In the following code, a window is found by specifying the window title text and then the relevant button is pressed:

//------------ 1st - find the window ------------//

HWND hDlg = ::FindWindowEx(NULL, NULL, m_lpszClass, (LPCTSTR)m_strWindowText);

//------------ 2nd - find and click the control ------------//

if (hDlg)
HWND hControl = 0;
hControl = ::GetDlgItem(hDlg, m_nControlID);

if ( ::PostMessage(hDlg, WM_COMMAND, (WPARAM)((BN_CLICKED*0x10000)+m_nControlID), (LPARAM)hControl) )
if ( ! m_bLurk)
return true;
ErnAuthor Commented:
thank you for your answer ,but there are
two things that are still missing:

1) the saveas common dialog control - controls are not visible so I dont know there ID's.

2) In you example the DEFAULT path and
file name where chosen.I want to choose
my own path (maybe it can be done by sending key pressed messages).

ErnAuthor Commented:
Adjusted points to 200
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

ErnAuthor Commented:
Try finding a key board Event
ErnAuthor Commented:
I found it , thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now