diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index f7bb944a8..a55b80017 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -4,6 +4,7 @@ #include "wx/calctrl.h" #include "wx/colordlg.h" #include "wx/confbase.h" +#include "wx/dialup.h" #include "wx/fileconf.h" #include "wx/fontdlg.h" #include "wx/fs_zip.h" @@ -4355,6 +4356,27 @@ BOOLEAN xvt_chr_is_alnum(int c) return (c <= 255) && wxIsalnum(c); } +int xvt_net_get_status() +{ + int nStatus = 0; + wxDialUpManager* dum = wxDialUpManager::Create(); + if (dum != NULL) + { + if (dum->IsOk() && dum->IsOnline()) + { + nStatus = 0x1; // 1 = Online + + if (dum->IsAlwaysOnline()) + nStatus |= 0x2; // 2 = Always Online + + wxArrayString isp; + if (dum->GetISPNames(isp) > 0) + nStatus |= 0x4; // 4 = Internet enabled + } + delete dum; + } + return nStatus; +} /////////////////////////////////////////////////////////// // XVT system calls (added by Guy) diff --git a/xvaga/xvt.h b/xvaga/xvt.h index b0a75ba3a..6feec3903 100755 --- a/xvaga/xvt.h +++ b/xvaga/xvt.h @@ -370,6 +370,8 @@ XVTDLL ULONG xvt_odbc_execute(XVT_ODBC handle, const char* sql, ODBC_CALLBACK cb XVTDLL BOOLEAN xvt_mail_send(const char* to, const char* cc, const char* ccn, const char* subject, const char* msg, const char* attach, BOOLEAN ui); +XVTDLL int xvt_net_get_status(); + #ifdef __cplusplus } #endif