Click here to Skip to main content
15,850,265 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Hi,

I am using VS 2010 to create an automation with .net 4 framework, and Spy++ toolkits for help.

1. The project i am creating is in windown form with a form called "TaskForm". When I click the button "Open FirstApp", the external window app "FirstApp.exe" proccess openned up (this is 3rd party vendor app)

2. From my application "TaskForm", i send data to textbox/combobox and send "Submit" button to "FirstApp.exe" using SendMessage method through DllImport("user32.dll"). After message was sent, this application openned up an IE window with secured data transfer and such.

MIDL
//class from main app spy++  Working codes
hwnd = FindWindow("WindowsForms1.Window.11.app.0.34323e", "FirstApp");
setForegroundWindow(hwnd);

//set text
locHwnd = FindWindowEx(hwnd, locHwnd, "WindowsForms1.EDIT.app.0.34323e", "RefNumber");
SendMessage(locHwnd, WM_SETTEXT, (int)IntPtr.Zero, "15");

//submit button
hwndChild = FindWindowEx((IntPtr)hwnd, IntPtr.Zero, "WindowsForms1.BUTTON.app.0.34323e", "Submit");
SendMessage(hwndChild, BN_CLICKED, 0, "");



3. Now, i am able to focus on the IE page but having really hard time trying to gain control and navigate through the IE page and I need help. What are the components i need in order for me to control the current active IE page and navigate through?

MIDL
//this is where i gain focus
hwnd = FindWindow("IEFrame", "");
SetForegroundWindow(hwnd);
//what to do next?



Important Notes: Using WebBrowser toolbox in Visual Studio 2010 won't work becuase navigation to the same URL gives error. I have to work with IE window as an External Application. With different project, I used WebBrower tool to open up an URL and able to navigate through the site with no issue, just don't know how to gain control outside of VS WebBrowser tool.

Any lead would be really appreciated.
Thank you!
Posted
Comments
Toli Cuturicu 1-Mar-11 15:54pm    
Don't post fake answers! Post comments instead. I deleted your "answer", because it was not an answer to your question!
lylylyly 2-Mar-11 17:15pm    
ah, thanks Toli

1 solution

You could try with this http://watin.sourceforge.net/[^].
 
Share this answer
 
Comments
lylylyly 2-Mar-11 17:14pm    
Thanks apaka, that didn't worked becuase using your method i had to open up a new ie with the same URL that the third vendor app passed over, which didn't have the secured data embedded behind it. I am looking for a way to read the current openned ie, not to open a new one. I am looking at SHDocVw and mshtml now and hopefully i'll get a solution soon.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900