I have a C++ program that display a browser using the Microsoft WebBrowser control. I pass hints in the URL parameters to the code so that alternative actions can be taken rather then simply allowing the browser to navigate to the new page.
For example, I might pass the URL "WRITE.EXE?RUN" to indicate that I want to run the executable in the URL.
In C#, I get the entire URL in the BeforeNavigate event but I only get the URL up to the ?. So in C# I get "WRITE.EXE?RUN" whereas in C++ the URL passed to BeforeNavigate2 is just "WRITE.EXE"
Any ideas on how to access the entire URL via C++?
I beleive the problem here is caused by the fact that since I dont specify a protocol for the URL, the WebBrowser handle it differently.
So if I specify http://write.exe?RUN, I get the whole URL path including the parameters whereas if if leave the protocol off or specify FILE://write.exe?RUN, it removes the arguments. The nice thing about the file protocol is that will return the entire path of the EXE as the URL.