I have made 2 main changes to the code:
1) I have changes the https "CONNECT xxxx" string to include a host header as the proxy I was testing it with (within a top 200 company within the UK) would sliently drop the TCP connection if this wasnt present.
2) I have changed the GetIEProxySettings so it now uses InternetQueryOption rather than looking at the registry directly, also I have added a new funtcion GetIEAutoSettings which will pull out the proxy if IE is set to auto detect the proxy (or to use a configuration script). Lastly I have changed the ConnectViaProxy function so if the SetLocalProxyInfo has been called, but no proxy specified, it will attempt to pull out the proxy info from IE (i.e. so InstantVNC / etc. will pull out the settings automatically), also this function has been improved so it'll drop down and attempt the other proxy settings detection methods, and it'll pass the login/password specified with SetLocalProxyInfo into the connect methods.
Thanks.
the modified files