Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a url silently?

Status
Not open for further replies.

sirugo

Programmer
Aug 1, 2000
162
SE
I want to create an exe-file with C++ that opens a url silently or "in the background".

Basically the idea is to send specific data (the current USERNAME from Netware, for example) to a php script on a webserver so that the script knows what type of user is reading the

I know how to retrieve the USERNAME with the code but how do I "execute" the url to the server:

preferrably without having to start Explorer
Can I use ShellExecute?

or anything else?
 
Also I tried using SW_HIDE as the last parameter but it still opens a Explorer-window. I also tried all the other parameters available but with no difference.
 
More on this issue.

If I put "iexplore.exe" instead of the url as the third argument SW_HIDE works, but not if I put the url there. I need explorer to visit that specific url, not only explorer itself.
 
If you just want to send HTTP requests and get an answer back into say a file, then how about Curl

--
 
The solution was easy.
The fourth argument should contain the url and he third iexplore.exe

Now it's working perfectly.
 
You assume that iexplorer.exe is the default browser!
On my computers Kerio Personal Firewall blocks access to the internet for iexplorer.
It would be better if your program could read the registry to see which program is the default browser.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top