static char hdrs[] = "Content-Type: application/x-www-form-urlencoded";
static char frmdata[] = "username=username&password=password&loginButton=Login&autoScroll=&loginForm_SUBMIT=1&loginForm%3A_idcl=&loginForm%3A_link_hidden_=&javax.faces.ViewState=rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAdfaWQxNDc4cHQACi9sb2dpbi5qc3A%3D";
static LPSTR accept = ("*/*", NULL);
string m_strURL, tempstr;
HINTERNET hSession, hDownload, hRequest;
hSession = InternetOpen("DFBAC", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
hDownload = InternetConnect(hSession, "localhost", INTERNET_DEFAULT_HTTPS_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
hRequest = HttpOpenRequest(hDownload, "POST", "/homepage/login.jsf", "HTTP/1.1", NULL, NULL, INTERNET_FLAG_SECURE, 0);
HttpSendRequest(hRequest, hdrs, strlen(hdrs), frmdata, strlen(frmdata));