2009-09-19 Enable/Disable 3G Connection 2939 0 C/C++ 摘要:Enable/Disable 3G Connection 本程式沒有驗證過,請勿胡亂服用。HANDLE g_hConn; int Connect3G(DWORD& pdwStatus) { CONNMGR_CONNECTIONINFO tConnInfo; tConnInfo.cbSize = sizeof(tConnInfo); tConnInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET; tConnInfo.dwFlags = 0; tConnInfo.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE; tConnInfo.bExclusive = true; tConnInfo.bDisabled = false; tConnInfo.guidDestNet = IID_DestNetInternet; tConnInfo.hWnd = NULL; //tConnInfo.uMsg = WM_APP_CONNMGR; tConnInfo.lParam = (LPARAM)0; // Make the connection // ConnMgrEstablishConnection(&tConnInfo , &g_hConn;); // DWORD pdwStatus ; ConnMgrEstablishConnectionSync(&tConnInfo , &g_hConn, 60000, &pdwStatus); return 0; } void Disconnect3G() { ConnMgrReleaseConnection(g_hConn,0); } 回首頁