ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

How to create a shortcut for the "wireless network connection" in Windows XP?

<< < (6/16) > >>

Stoic Joker:
Stoic Joker, does whatever you use to call the window open it asynchronously on its own thread, inside of your process? E.g. does your message loop actually matter and do stuff, or could you have used a Sleep(10000) and still have stuff basically function till the loop runs out and kills the app after 10s? In that case I might have a solution as I already bumped into such a problem once in the past.-worstje (January 24, 2011, 11:09 PM)
--- End quote ---

I tried replacing the whole shebang with Sleep(2000) last night assuming that it just needed some "Hang-Time" to finish getting the Network Connections window open. The window opened for 2 seconds, and then closed.

...So I'm guessing it's somehow important. However it's apparently not important enough to talk to afterwards... as any message I've tried checking for (like WM_QUIT) never comes.

At this point, I'm just waiting for SB to see if there is any type of GUI (tray icon etc.) he wants this wrapped in. Then I could just chain the loop to that and be done with it.

But I do appreciate (and am open for) the suggestion.

worstje:
Ah, great naps are great. :D

You probably want to try to use the ProcessReference class mentioned in these articles. While I am not 100% sure it will work, I am very hopeful.

Reading a contract from the other side: SHSetInstanceExplorer and SHGetInstanceExplorer
Simulating a drop, part two

I had to use it in order to get certain popup commands to work in Cautomaton, since Cautomaton has a habit of closing immediately. Your app would be the same, so instead you want to make sure to keep running till the window gets closed. :)

If you are unsure how to use it, let me know and I can probably whip out my Cautomaton code as an example (although it doesn't really change compared to the code in those links.)

Stoic Joker:
Cool, thanks ... I'll take a stab at it (and a few other ideas I came up with) tonight when I get home.

I just noticed from SB's screen shot (in the other thread) that hard-coding the window name ain't gonna work (not that I really had my hopes up...) as it'll close on him in 2 seconds because it can't find a "Wireless Network Connection" window, as his ends in " 2".

superboyac:
Stoic, i tried your file, but it didn't work.  it gives the error "No GUID Given".

At this point, I'm just waiting for SB to see if there is any type of GUI (tray icon etc.) he wants this wrapped in. Then I could just chain the loop to that and be done with it.
-Stoic Joker (January 25, 2011, 05:43 AM)
--- End quote ---
It doesn't need a GUI at all.  It should just be a shortcut icon that you can double click and it will open the window.  It's basically a launcher for the window.  That way, I can take the file and put it in my launcher or start menu or whatever.  It's just a file.

Stoic Joker:
Stoic, i tried your file, but it didn't work.  it gives the error "No GUID Given".-superboyac (January 25, 2011, 09:23 AM)
--- End quote ---

Right, you have to give it the machine specific GUID for your wireless NIC.

I have it setup to pass the GUID to the program via the command line
i.e. WiFi.exe 261AAE34-9C9D-40EB-A25C-CFEDF328E3CF
--- End quote ---

That is why skwire didn't want to get into this because he didn't want to deal with supporting the machine specific hard-coded GUID. Which (is why I cheated) I don't blame him for, as it's a pita. I figured I could get away with feeding the machine specific part to the prog via the command line.

At this point, I'm just waiting for SB to see if there is any type of GUI (tray icon etc.) he wants this wrapped in. Then I could just chain the loop to that and be done with it.
-Stoic Joker (January 25, 2011, 05:43 AM)
--- End quote ---
It doesn't need a GUI at all.  It should just be a shortcut icon that you can double click and it will open the window.  It's basically a launcher for the window.  That way, I can take the file and put it in my launcher or start menu or whatever.  It's just a file.[/quote]

True(ish) ... The GUID can (has to) be added to the launch string, but it still has to be dredged out of the registry at some point. I can add a (first run) UI that lets the user pick their NIC from a drop down list and then saves it to an .ini (or in the registry [your choice]). Or we can stick with the (current) command line only option, but I think the UI would be nicer.

It's up to you, let me know.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version