I have a WebView where I simulate a click to a button. Actually this button is to upload an image to the server. So, when you click to this button, a file dialog box opens and user needs to select whatever to upload. My task is to simulate this behavior because I already know what image to upload before.
I created an application where clicking to the upload button is working like charm. No problem there, file dialog box opens. I can also click on the cancel button on the file dialog box. However, I couldn't select the file that I want to upload. I tried to write the fullpath + filename to the ComboBox text part but it doesn't write anything there. I thought perhaps there is a trick to do somewhere and wanted to ask you guys. Here is what I have so far:
HWND handleForWindow = FindWindow(NULL, "Open"); //This finds the handle of the file dialog box, which comes correct. Checked with Spy++.
HWND hwndComboBox = FindWindowEx(handleForWindow, 0, "ComboBox", ""); // This handle comes correct as well.
//Here is the problem. I tried SendMessage and SetDlgItemText apis but didn't work.
SendMessage(hwndComboBox , WM_SETTEXT, IDOK, (LPARAM)("path")); //I don't see any text written in the box.
//Here if I say
SetFocus(hwndComboBox);
//Strange enough, it focuses on the combobox on the right side because when I press arrow-down key, that combo box opens. I am now wondering why it selects that combo box even though I say "" for the window name in the FindWindowEx call.
search for a combobox, But there may be more than one comboboxes and only first found is returned!
The control ID for the combobox you got seems to be cmb1 while what you need is cmb13.
See Explorer-Style Control Identifiers
Besides, it would be better if you attached the images to your post than upload them to dropbox. Go Advanced -> Additional Options ->| button "Manage Attachments"...
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.