Link to home
Start Free TrialLog in
Avatar of Ern
Ern

asked on

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?
Avatar of jhattingh
jhattingh

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;
}
Avatar of Ern

ASKER

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).


Avatar of Ern

ASKER

Adjusted points to 200
Avatar of Ern

ASKER

test
ASKER CERTIFIED SOLUTION
Avatar of Avi_cohen
Avi_cohen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ern

ASKER

I found it , thanks!