Connect to a wireless network programmatically - c++

I'm trying to write an application that connects to my company's wireless network automatically on windows XP.
I've found the Wireless LAN API but it requires me to have some hotfix installed on the machine, and you need to have sp2 or higher(There are machines with SP1, and I'm required to support any XP machine).
I've tried to find some samples about Wireless Zero Configuration on MSDN but with no luck, only samples I've found are for WinCE, I think Microsoft stopped supporting it. In addition I couldn't find where to download the dll and header file for working with the WZC.
There must be a way to do it and work on any service pack because I've found Zwlancfg by ENGL

Point out that any change you'll have to introduce to these old XP machines will be similar in magnitude to the SP2 update, except that (1) you don't have the insight into the network stack that Microsoft has, (2) you don't have the experience in Windows development that Microsoft collectively has and (3) you don't have the testing resources (including beta testers) that Microsoft has. So your change will be more risky and less stable than the SP2 update.

Couldn't you just setup the wireless password and tell XP to auto-join when it sees the network?
Maybe I'm missing something but it happens automatically, so I don't see why you need to code an app to do this.

I would encourage you to advocate for upgrading those XP machines at least to Service Pack 2 as it was a major upgrade in terms of functionality and security. It's also been at least 5 years since it was rolled out so I can't imagine you'd have compatibility issues with 3rd party software.
That being said.
Wireless for XP was seriously reworked with Service Pack 2 and the Wireless Network Policy was created that allows you to push out policy to all machines on your network via the Group Policy MMC.

You should try native wifi api but it will work with XP SP2
There is one WLANCONNECT() methos try that one
with that you will be able to connect to network with your program

Related

WTSGetActiveConsoleSessionId - Minimum supported client / server incorrect?

I've just come to use WTSGetActiveConsoleSessionId to get the active console session ID.
I need this to work on XP / Server 2003. I'm 99% sure I've used this before successfully on those OS's. I've just checked (with depends.exe) and kernel32.dll exports WTSGetActiveConsoleSessionId on those OS's.
However, the MSDN page says:
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
What's up with that? Am I missing something? Is it safe to use it on XP / Server 2003?
Windows XP and Windows Server 2003 are no longer supported, so the minimum supported client/server is Windows Vista and Windows Server 2008, respectively. A common mistake is, that developers read the information to mean "introduced in". This is not the case.
Is it safe to use it on XP / Server 2003?
No. Neither Windows XP nor Windows Server 2003 receive bug fixes, or security and feature updates. The documented contract in the MSDN may or may not apply to systems that are no longer supported.
WTSGetActiveConsoleSessionId is available on Windows XP and Windows Server 2003, and if you have established that it is good enough for you, you can use it. It's just not safe to do so. You should ask your customers to upgrade to one of the supported client/server OSs.
I think it worked for me too in XP SP3 more info

How to re-enable a disabled network connection in Windows XP using C++?

I found this article at SO that tells how to enable/disable a network adpter using the SetupAPI. This works fine so far. The problem is that I could not find a way to get the device index for network connections (adapters) that have been disabled in Windows XP.
I have:
The list of GUIDs (from HKLM\SOFTWARE\Microsoft\Windows NT\Netcards)
Everything from Win32_NetworkAadapter that is supported in Windows XP
I tried without success:
GetIfTable() - disabled adapters are not present in the table
Win32_NetworkAdapter::InterfaceIndex is not supported in XP
Win32_NetworkAdapter::Enable()/Disable() is not supported in XP
What else can I do to obtain the device index or to get a disabled network adapter re-eabled again?
Based on my experience building my Network Connection Guard tool the easiest way to do this is with the netsh command, not APIs. My example is C# so I used System.Diagnostics.Process but in your case I believe you could use ShellExecute().
Also see this answer on SO Programmatically disable/enable network interface

Free VM with management API that runs on windows?

Is anyone aware of a free (as in beer) VM that will run on a wide range of windows hosts (XP/Vista/7/etc), that comes with a full management API (at least the ability to create, monitor, start/stop and snapshot guest VMs) ?
I looked at VMPlayer, but its VIX API appears to be crippled for that product.
I looked at Xen, and it comes with a management API, but Xen only runs on Linux hosts.
thanks
Steve
Have a look at VirtualBox I have ran that succesfully on both XP and 7, have not tried Vista

Disabling Bluetooth support in Windows XP-7

I'm trying to write a program to disable the Bluetooth service on computers (so, forbid users from connecting to Internet via Bluetooth)
I've tried following methods:
Disable the "bthserv" service (Bluetooth Support Service). It works on Windows Vista and 7, but there is no such service in Windows XP (I haven't tested, but I think it only works with Microsoft Bluetooth Stack)
Use Devcon.exe tool; it shows Bluetooth devices, but cannot disable them (I'm Administrator)
I can list the devices via WMI, but how can I disable them? (I wanted to disable with netsh.exe, but it errors with "An interface with this name is not registered with the router." although the connection exists.
Any ideas ?
The API you're looking for is called the "Setup API". I seriously doubt that it's what you want, BTW. What is so special about Bluetooth networking that sets it apart from Wifi networking? Why don't you just ban adding any new network adaptor ?

Which Desktop Virtualization software runs most smoothly? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Background:
I'm running a full-time job and a part-time job in the weekends, and both my employers have supplied a laptop for me to work on. Of course I also have my powerful workstation at home to work from, and sometimes when I'm at the office at my weekend job (it's in another city) I'm working from yet another workstation.
Problem:
That makes a full 4 PC's I'm maintaining (software versions, licences and settings) just to do my work, and believe me, my list of prefered software is way too big.
I want to setup a Virtual Desktop on my VMware server, so I can work from the same installation and same session no matter which PC I'm working from.
Now I don't have the time and money to go through a full test of each setup, so I'd like to hear your experiences on the subject.
Question:
Should I use a VMware virtual workstation with some remote logon software (like realVNC, teamviewer, logmein, whatever...) or should I invest in a full VDI system like Sun or VMware provide?
Edit:
I'm programming in Adobe Dreamweaver on Windows XP - but I run my servers on Debian and sometimes do quick edits in VIM too. First I intend to virtualize a WinXP with base installation, to see how it runs.
I am a consultant and tend to work in a variety of environments. I carry a Thinkpad running VMWare Server over Ubuntu64 with 4GB of RAM. I've got a 320GB secondary hard drive that I use just for VM's and have 25 or so different virtual machines that I boot up as the circumstances demand.
They're a mix of Linux servers and workstations, Vista workstations and XP Workstations. I rarely use the VMWare server console. I access every one of them via one of the remote access methods.
For Linux, I usually install FreeNX or NXServer for desktop access and just SSH for commandline. On Windows, I always use Remote Desktop (RDP), but, on XP, that only works on the "Pro" versions, not the "Home" versions. If all else fails, I install VNC and use that. VNC is at the bottom of my list because it really is a last resort. The only thing it's better than is not actually being able to use the machine.
However, NX on Linux and RDP on Windows work WAY better than VNC. Other than little things like font smoothing and fancy desktop effects, the only big glitch would be if you are doing much with video or audio or DirectX-based stuff. Things like YouTube or other video do NOT like to work with any remote desktop protocol that I know of.
As far as performance, using Linux as a host for VMWare provides really good management of system resources. The Windows-based VM's aren't able to just gobble up memory, but still get it when they need to.
I do C# development all day in a virtual Vista workstation on Visual Studio 2008 and have absolutely no problems having 3-4 different solutions all open at once along with the normal stuff alongside over RDP on another machine, connected via wireless VPN.
I can flip over to the host OS and it won't even be touching swap space at all. As far as I'm concerned, it's a great way to work.
If you want to work with the same installation, you should seriously consider the Remote Desktop Server/Client solution, bundled into every windows OS from XP. Basically, this app displays the view from your remote desktop to your local one, using highly compressed images; this works even via low-bandwidth internet connections
While the XP version can only handle one user simultaneously, the one in Windows Server 2003 (and in Windows Server 2008, I presume) can handle multiple users (up to a certain limit).
Disadvantages, and side-effects include:
virtual pc via RDC is slow
anything using the 3d acceleration will be slow (at least using XP/2003)
Personally, I would go down the route of using a virtual workstation with some remote logon software. The network performance of VMWare has always been good in my experience, and depending on the OS, there may be a decent remote logon provided.
I guess you can live with Logmein Free. [Or Pro if u want those features]
Well, you don't say what OSs are involved, so.....
For windows, I find that Remote Desktop works as well or better than anything else, although if you pay for the RealVNC version with the mirror driver, that's supposed to be as good.
For off site access for windows, www.logmein.com (the free version) works very well.
If Unixes are involved, then VNC is definitely the way to go, there are various solutions for doing this remotely. Everything from redirection servers, to just forwarding a port in your firewall to an ssh server and setting up the various tunnels.
Performance of VMWare is very good, and I can run a SQL Server slice, a web server slice and develop on my laptop simultaneously. The VM slices reside on a USB 2 portable drive and make it easy to port between my laptop and desktop.
VM Console works well for accessing each environment, and depending on the configuration you set up with NAT vs. Bridging you can UNC to shares on slice.
The nice by-product of this is that should you host machine take a nose dive you can quickly recover your development environment.