DECLARE INTEGER GetLastError IN Win32API DECLARE INTEGER InternetSetOption IN WinInet.dll ; LONG hInternet, ; INTEGER dwOption, ; STRING @lpBuffer, ; LONG lpdwBufferLength DECLARE INTEGER InternetOpen IN WinInet.DLL ; STRING, ; INTEGER, ; STRING, ; STRING, ; INTEGER INTERNET_OPTION_PROXY_USERNAME = 43 INTERNET_OPTION_PROXY_PASSWORD = 44 INTERNET_OPTION_USER_AGENT = 40 hInternet = InternetOpen("EKraft Web Application", 0, NULL, NULL, 0) lpBuffer = "esmoore" lpdwBufferLength = LEN(lpBuffer) ?InternetSetoption(hInternet, INTERNET_OPTION_PROXY_USERNAME, @lpBuffer, lpdwBufferLength) and here is the C function declaration: BOOL InternetSetOption( IN HINTERNET hInternet, IN DWORD dwOption, IN LPVOID lpBuffer, IN DWORD dwBufferLength );The error returned is 12018: "The supplied handle is the wrong type for the requested operation". The handle being returned by InternetOpen, and passed to InternetSetOption consistently looks like: 13369352. Declaring the hInternet parameter as LONG or INTEGER makes no difference.