Click to See Complete Forum and Search --> : Double Click on desktop thru a C++ call


Albatross
February 16th, 2004, 01:02 PM
I double click on the MyInternet icon and I am into the internet.
I double click on the MyVPN icon and I am into my own virtual private network.
And then with C++ code I can make a socket and glom onto a tcp/ip address and port.

It all works fine.

But I'd like to do my double clicking in C++ code.

Can I write

MyInternet.Start(); ?
MyVPN.Start(); ?

or does MS have something like

AfxDblClickOn("MyInternet"); ?

Is there an API function where I can reach these two items in my Win2000 system
and start them, stop them, see if they're running?

Codeplug
February 16th, 2004, 02:30 PM
You can execute anything with a shell association using system() (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_system.2c_._wsystem.asp).
For example, calling system("mydoc.doc") will launch Word and load that document - as if you double-clicked it.

Stopping "it" and checking if "it" is running takes a little more work.

gg

Albatross
February 17th, 2004, 02:04 AM
Very Interesting !!!
Looks easier than I expected.

But one little thing : I want to do this on a Windows CE instead of a Win2000.

The MyVPN is not really visible as an ABC.doc or DoMe.exe file.
It's hidden inside the "\Windows\Control.exe" app which shows a window full of icons.
Drilling down further is WCE magic.
So MyInternet.exe and MyVPN.exe are not visible for a system("MyVPN.exe") type of command.

Any idea of good sites for WCE codegurus?