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?
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?
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).
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).
ASKER
Adjusted points to 200
ASKER
test
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found it , thanks!
//------------ 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*0x100
if ( ! m_bLurk)
return true;
}