From 579dd75d27c3837f724cd382536660e9f85251ce Mon Sep 17 00:00:00 2001 From: NTDLS Date: Mon, 9 Apr 2018 21:17:01 -0400 Subject: [PATCH] Add files via upload --- CleanUp.Bat | 26 + Dialogs/MainDlg.Cpp | 240 ++++++++ Dialogs/MainDlg.H | 30 + Dialogs/NetLogoDlg.Cpp | 193 +++++++ Dialogs/NetLogoDlg.H | 28 + Resources/HandCur.cur | Bin 0 -> 766 bytes Resources/MainIcon.ico | Bin 0 -> 23566 bytes Resources/SystemInfo.rc | 255 +++++++++ Resources/XPTheme.bin | 22 + Resources/resource.h | 54 ++ Setup Files/AutoUpdate.xml | 5 + Setup Files/Setup.Iss | 45 ++ Source/Entry.Cpp | 60 ++ Source/Entry.H | 13 + Source/GetInfo.Cpp | 1055 ++++++++++++++++++++++++++++++++++++ Source/GetInfo.H | 31 ++ Source/Init.Cpp | 40 ++ Source/Init.H | 10 + SystemInfo.sln | 19 + SystemInfo.vcxproj | 207 +++++++ SystemInfo.vcxproj.filters | 165 ++++++ 21 files changed, 2498 insertions(+) create mode 100644 CleanUp.Bat create mode 100644 Dialogs/MainDlg.Cpp create mode 100644 Dialogs/MainDlg.H create mode 100644 Dialogs/NetLogoDlg.Cpp create mode 100644 Dialogs/NetLogoDlg.H create mode 100644 Resources/HandCur.cur create mode 100644 Resources/MainIcon.ico create mode 100644 Resources/SystemInfo.rc create mode 100644 Resources/XPTheme.bin create mode 100644 Resources/resource.h create mode 100644 Setup Files/AutoUpdate.xml create mode 100644 Setup Files/Setup.Iss create mode 100644 Source/Entry.Cpp create mode 100644 Source/Entry.H create mode 100644 Source/GetInfo.Cpp create mode 100644 Source/GetInfo.H create mode 100644 Source/Init.Cpp create mode 100644 Source/Init.H create mode 100644 SystemInfo.sln create mode 100644 SystemInfo.vcxproj create mode 100644 SystemInfo.vcxproj.filters diff --git a/CleanUp.Bat b/CleanUp.Bat new file mode 100644 index 0000000..d87614a --- /dev/null +++ b/CleanUp.Bat @@ -0,0 +1,26 @@ +@Echo Off + +attrib -s -h -r + +Del *.Ncb +Del *.Opt +Del *.Plg +Del *.Aps +Del *.Scc +Del *.suo +Del *.xml +Del *.old +Del *.user +Del *.sdf + +rd IPCH /S /Q +rd Release /S /Q +rd Debug /S /Q +rd Win32 /S /Q +rd x64 /S /Q + +RD Setup\Output /S /Q + +Del Resources\*.aps + +Cls diff --git a/Dialogs/MainDlg.Cpp b/Dialogs/MainDlg.Cpp new file mode 100644 index 0000000..3e45b5b --- /dev/null +++ b/Dialogs/MainDlg.Cpp @@ -0,0 +1,240 @@ +#ifndef _MAINDLG_CPP +#define _MAINDLG_CPP +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#include "../Resources/Resource.H" + +#include "../../@Libraries/NSWFL/NSWFL.H" + +#include "../Source/Entry.H" +#include "../Source/GetInfo.H" + +#include "../Dialogs/MainDlg.H" +#include "../Dialogs/NetLogoDlg.H" + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +using namespace NSWFL::Windows; +using namespace NSWFL::ListBox; +using namespace NSWFL::File; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +//---------------------(Variable Declarations) +MAINDIALOGINFO MDI; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool PopOptionList(HWND OptionList_hWnd) +{ + for(int iOpt = 0; sOptions[iOpt]; iOpt++) + { + InsertListBoxItem(OptionList_hWnd, (char *)sOptions[iOpt], -1); + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +LRESULT CALLBACK OptionListProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + LRESULT lResult = CallWindowProc(MDI.gpOldOptionListProc, hWnd, uMsg, wParam, lParam); + + if(uMsg == WM_LBUTTONDOWN) + { + char sOption[255]; + memset(sOption, 0, sizeof(sOption)); + + if(GetListBoxItemText(sOption, sizeof(sOption), hWnd) > 0) + { + if(_strcmpi(sOption, MDI.sLastOption) != 0) + { + PopInfoList(false, MDI.InfoList_hWnd, sOption); + + strcpy_s(MDI.sLastOption, sizeof(MDI.sLastOption), sOption); + } + } + } + + return lResult; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +BOOL CALLBACK MainDialog(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + static int iLastSelection = -1; + + //-------------------------------------------------------------------------- + + if(uMsg == WM_INITDIALOG) // Received A Initilize Dialog Message + { + memset(&MDI, 0, sizeof(MDI)); + + MDI.hWnd = hWnd; + + MDI.SystemMenu_hMenu = GetSystemMenu(hWnd, FALSE); + AppendMenu(MDI.SystemMenu_hMenu, MF_SEPARATOR, 0, 0); + AppendMenu(MDI.SystemMenu_hMenu, MF_STRING, MAINDIALOG_MENU_ABOUT, "About"); + + SendMessage(hWnd, (UINT)WM_SETTEXT, (WPARAM)0, (LPARAM)gsTitleCaption); + SendMessage(hWnd, WM_SETICON, TRUE, (LPARAM) LoadIcon(ghAppInstance, MAKEINTRESOURCE(IDI_MAIN))); + + MDI.OptionList_hWnd = GetDlgItem(hWnd, IDC_OPTLIST); + MDI.InfoList_hWnd = GetDlgItem(hWnd, IDC_INFOLIST); + + PopOptionList(MDI.OptionList_hWnd); + + MDI.gpOldOptionListProc = (WNDPROC) SetWindowLong(MDI.OptionList_hWnd, GWL_WNDPROC, (long) &OptionListProc); + + SelectListBoxItem(MDI.OptionList_hWnd, 0); + + SendMessage(MDI.OptionList_hWnd, WM_LBUTTONDOWN, MK_LBUTTON, 0); + SendMessage(MDI.InfoList_hWnd, LB_SETHORIZONTALEXTENT, (WPARAM)2500, (LPARAM)0); + + CenterWindow(hWnd); + + return TRUE; // Return TRUE to set the keyboard focus, Otherwise return FALSE. + } + + //-------------------------------------------------------------------------- + + else if(uMsg == WM_COMMAND) + { + if(wParam == IDC_REFRESH) + { + PopInfoList(false, MDI.InfoList_hWnd , MDI.sLastOption); + return TRUE; + } + + if(wParam == ID_FILE_SAVE_INFO) + { + char sTarget[MAX_PATH]; + char sStartPath[MAX_PATH]; + + char *sFilters = "Text-Files\0*.txt\0All-Files\0\0"; + + DWORD dwFlags = OFN_EXPLORER + OFN_LONGNAMES + OFN_PATHMUSTEXIST; + + if(Get_CurrentDirectory(sStartPath, sizeof(sStartPath))) + { + strcpy_s(sTarget, sizeof(sTarget), ""); + + if(OSFileDialog(hWnd, sTarget, sizeof(sTarget), + "txt", "Save file as?", sFilters, sStartPath, SFD, dwFlags)) + { + if(FileAccess(sTarget, FExist)) + { + if(MessageBox(hWnd, "File already exist. Overwrite?", gsTitleCaption, MB_YESNO | MB_ICONQUESTION) != IDYES) + { + return TRUE; + } + } + if(SaveAllInfoToFile(sTarget)) + { + MessageBox(hWnd, "Information saved!", gsTitleCaption, MB_ICONINFORMATION); + } + else{ + MessageBox(hWnd, "Failed to open file for write access!", gsTitleCaption, MB_ICONERROR); + } + } + } + return TRUE; + } + + if(wParam == ID_FILE_PRINT_INFO) + { + return TRUE; + } + + if(wParam == IDC_CLOSE || wParam == ID_FILE_CLOSE_APP) + { + EndDialog(hWnd, 0); + DestroyWindow(hWnd); + + memset(&MDI, 0, sizeof(MDI)); + + return TRUE; + } + + if(wParam == ID_HELP_ABOUT) + { + _AboutDialogInfo ADI; + + ADI.DisplayIcon = LoadIcon(ghAppInstance, MAKEINTRESOURCE(IDI_MAIN)); + ADI.TitleCaption = gsTitleCaption; + ADI.FileVersion = gsFileVersion; + ADI.BuildDate = __DATE__; + ADI.BuildTime = __TIME__; + ADI.CopyRight = gsAppCopyRight; + ADI.OwnerHandle = hWnd; + + NetLogo(&ADI); + return TRUE; + } + return FALSE; + } + + //-------------------------------------------------------------------------- + + else if(uMsg == WM_PAINT) + { + HDC ThisHDC; + PAINTSTRUCT ThisPS; + + ThisHDC = BeginPaint(hWnd, &ThisPS); + + //- Any painting should be done here. + + EndPaint(hWnd, &ThisPS); + return TRUE; + } + + //-------------------------------------------------------------------------- + + else if(uMsg == WM_SYSCOMMAND) //- Received a system menu message. + { + if(LOWORD(wParam) == MAINDIALOG_MENU_ABOUT) //- About. + { + _AboutDialogInfo ADI; + + ADI.DisplayIcon = LoadIcon(ghAppInstance, MAKEINTRESOURCE(IDI_MAIN)); + ADI.TitleCaption = gsTitleCaption; + ADI.FileVersion = gsFileVersion; + ADI.BuildDate = __DATE__; + ADI.BuildTime = __TIME__; + ADI.CopyRight = gsAppCopyRight; + ADI.OwnerHandle = hWnd; + + NetLogo(&ADI); + return TRUE; + } + + return FALSE; + } + + //-------------------------------------------------------------------------- + + else if(uMsg == WM_CLOSE) //- Received close message. + { + EndDialog(hWnd,0); + DestroyWindow(hWnd); + + memset(&MDI, 0, sizeof(MDI)); + + return TRUE; + } + + //-------------------------------------------------------------------------- + + return FALSE; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif + diff --git a/Dialogs/MainDlg.H b/Dialogs/MainDlg.H new file mode 100644 index 0000000..404f3fc --- /dev/null +++ b/Dialogs/MainDlg.H @@ -0,0 +1,30 @@ +#ifndef _MAINDLG_H +#define _MAINDLG_H +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//---------------------(Constant Definitions) +#define MAINDIALOG_MENU_ABOUT 1000 + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//---------------------(Variable Declarations) + +typedef struct _TAG_MAIN_DIALOG_INFO{ + HMENU SystemMenu_hMenu; + + HWND hWnd; + HWND OptionList_hWnd; + HWND InfoList_hWnd; + + WNDPROC gpOldOptionListProc; + + char sLastOption[255]; + +}MAINDIALOGINFO, *LPMAINDIALOGINFO; + +extern MAINDIALOGINFO MDI; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//---------------------(Function Prototypes) +BOOL CALLBACK MainDialog(HWND hHwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif diff --git a/Dialogs/NetLogoDlg.Cpp b/Dialogs/NetLogoDlg.Cpp new file mode 100644 index 0000000..8a95cfb --- /dev/null +++ b/Dialogs/NetLogoDlg.Cpp @@ -0,0 +1,193 @@ +#ifndef _NETLOGODLG_CPP +#define _NETLOGODLG_CPP +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include "../Source/Entry.H" +#include "../Resources/Resource.H" + +#include "../../@Libraries/NSWFL/NSWFL.H" + +#include "NetLogoDlg.H" + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +using namespace NSWFL::Windows; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +HWND NetLogoDialog_hWnd = NULL; +HINSTANCE hModuleHandle = NULL; +LPABOUTDLGINFO glpADI; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool NetLogo(LPABOUTDLGINFO lpADI) +{ + HWND OwnerHandle = NULL; + + glpADI = lpADI; + + if(glpADI->OwnerHandle == NULL) + OwnerHandle = GetActiveWindow(); + else OwnerHandle = glpADI->OwnerHandle; + + hModuleHandle = GetModuleHandle(NULL); + + DialogBox(hModuleHandle, MAKEINTRESOURCE(IDD_NETLOGO), OwnerHandle, (DLGPROC)NetLogoDialog); + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +HWND NetLogoHandle(void) +{ + return NetLogoDialog_hWnd; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool IsNetLogoActive(void) +{ + return (NetLogoDialog_hWnd != NULL); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void EndNetLogo(void) +{ + EndDialog(NetLogoDialog_hWnd, 0); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +BOOL CALLBACK NetLogoDialog(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + //-------------------------------------------------------------------------- + + static HWND AppName_hWnd = NULL; + static HWND AppVersion_hWnd = NULL; + static HWND AppCopyRight_hWnd = NULL; + static HWND DisplayIcon_hWnd = NULL; + static HWND BuildTimeDate_hWnd = NULL; + static HWND NetLink_hWnd = NULL; + + static HCURSOR HandCursor = NULL; + + static DWORD BGColorRef = 0; + + //-------------------------------------------------------------------------- + + if(uMsg == WM_INITDIALOG) // Received A Initilize Dialog Message + { + char sTempText[255]; + + NetLogoDialog_hWnd = hWnd; + + HandCursor = LoadCursor(hModuleHandle, MAKEINTRESOURCE(IDC_HANDCURSOR)); + BGColorRef = GetSysColor(COLOR_3DFACE); + + sprintf_s(sTempText, sizeof(sTempText), "NetworkDLS :: %s", glpADI->TitleCaption); + SendMessage(hWnd, (UINT)WM_SETTEXT, (WPARAM)0, (LPARAM)sTempText); + + AppName_hWnd = GetDlgItem(hWnd, IDC_APPNAME); + AppVersion_hWnd = GetDlgItem(hWnd, IDC_APPVERSION); + BuildTimeDate_hWnd = GetDlgItem(hWnd, IDC_BUILDTIMEDATE); + AppCopyRight_hWnd = GetDlgItem(hWnd, IDC_APPCOPYRIGHT); + DisplayIcon_hWnd = GetDlgItem(hWnd, IDC_ABOUTICON); + NetLink_hWnd = GetDlgItem(hWnd, IDC_NETLINK); + + SendMessage(DisplayIcon_hWnd, (UINT)STM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)glpADI->DisplayIcon); + + Set_Text(AppName_hWnd, glpADI->TitleCaption); + + Set_Text(AppVersion_hWnd, glpADI->FileVersion); + + sprintf_s(sTempText, sizeof(sTempText), "%s - %s", glpADI->BuildDate, glpADI->BuildTime); + Set_Text(BuildTimeDate_hWnd, sTempText); + + Set_Text(AppCopyRight_hWnd, glpADI->CopyRight); + + CenterOverOwner(hWnd); + + return TRUE; // Return TRUE to set the keyboard focus, Otherwise return FALSE + } + + //-------------------------------------------------------------------------- + + if(IsMouseOverHwnd(NetLink_hWnd)) + { + SetCursor(HandCursor); + + if(uMsg == WM_LBUTTONUP) + { + ShellExecute(0, "Open", "Http://www.NetworkDLS.com/", NULL, NULL, SW_SHOWNORMAL); + } + } + + //-------------------------------------------------------------------------- + + if(uMsg == WM_CTLCOLORSTATIC) + { + if((HANDLE)lParam == NetLink_hWnd) + return Set_Color(RGB(0, 0, 255), BGColorRef, wParam); + + return FALSE; + } + + //-------------------------------------------------------------------------- + + if(uMsg == WM_COMMAND) + { + if(wParam == IDC_OKBUTTON) + { + EndDialog(hWnd, 0); + DestroyWindow(hWnd); + return TRUE; + } + return FALSE; + } + + //-------------------------------------------------------------------------- + + if(uMsg == WM_PAINT) + { + HDC ThisHDC; + PAINTSTRUCT ThisPS; + + ThisHDC = BeginPaint(hWnd, &ThisPS); + + // Any painting should be done here + + EndPaint(hWnd, &ThisPS); + return TRUE; + } + + //-------------------------------------------------------------------------- + + if(uMsg == WM_DESTROY) + { + FreeLibrary(hModuleHandle); + hModuleHandle = NULL; + NetLogoDialog_hWnd = NULL; + return TRUE; + } + + //-------------------------------------------------------------------------- + + if(uMsg == WM_CLOSE) // Received Close Message + { + EndDialog(hWnd,0); + DestroyWindow(hWnd); + return TRUE; + } + + //-------------------------------------------------------------------------- + + return FALSE; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif diff --git a/Dialogs/NetLogoDlg.H b/Dialogs/NetLogoDlg.H new file mode 100644 index 0000000..f741851 --- /dev/null +++ b/Dialogs/NetLogoDlg.H @@ -0,0 +1,28 @@ +#ifndef _NETLOGODLG_H +#define _NETLOGODLG_H +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +typedef struct _AboutDialogInfo{ + char *BuildDate; + char *BuildTime; + char *CopyRight; + char *FileVersion; + char *TitleCaption; + HICON DisplayIcon; + HWND OwnerHandle; +} ABOUTDLGINFO, *LPABOUTDLGINFO; + +extern LPABOUTDLGINFO glpADI; + +extern HWND NetLogoDialog_hWnd; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +BOOL CALLBACK NetLogoDialog(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); +bool IsNetLogoActive(void); +bool NetLogo(LPABOUTDLGINFO lpADI); +HWND NetLogoHandle(void); +void EndNetLogo(void); + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif diff --git a/Resources/HandCur.cur b/Resources/HandCur.cur new file mode 100644 index 0000000000000000000000000000000000000000..aebc4b89add5ca7d877306d1ba0ebdce8f54981f GIT binary patch literal 766 zcmb`FF>=B%5JkU1Gb-JswM%XR1to`}OR1fq;22y*1to__nUXH5viz07l4d+fgY3WF zw|~8sJqA|jFpkLUdj)(j+fXC5qdGW7Kt(wC(5>s q{;7dH=r6W>k*(hO=X_BSL51Q|8(Gb~n0t6@N3AJ-8%~^cVg3N&4AFo9 literal 0 HcmV?d00001 diff --git a/Resources/MainIcon.ico b/Resources/MainIcon.ico new file mode 100644 index 0000000000000000000000000000000000000000..448699ceb63458a3ebd890ac53cadb5db07193f2 GIT binary patch literal 23566 zcmeHvcVLvo*7rfADF}8{yg{xg3MeY-6$K(9RZvk8kuJR>Ez~4HAOu1SBqR_BNhpC( z5=id}>Am-4)5~Vl+a{Ym-*2AXg&=sZ-uL>x_m6MjmwC#Rb7tn5nRCvZCF(*wY2d(q zh##l&$B6b5;r=n)ccBqoh}L!`8Zm-!*ORV1MRe|Q@m_o1lW4-TME&|{?w5BXs(wY6 zejr^LOf>T~U3%OjoqB>U{XkldvM&8dG(^-1=mUZd5sW~~?*=2hF)|`4!e3lcU|=9( z@r0%S#4N4={1cDx=V@K&Z>+o0#HJ74_v`uKecuP~`|$(!{rf&}Z)%ErQ&U|9rbc8a z?zIp4Qx8zGo=mk>;-v^Jcp!50)7;`gPbooP>85<`pbg%of-c-uY9HV(sd+***dT{?a4Er>9&h(C;|IsN$cCVeG&lGEg24MX z(v?2`25KqN#(fbRwo(^Xi(zHdSH*#Pt%fpzu_~?|i&iyMajOP~t%mBct%jv~tz$#_ z)(Ysw_m$~Y>&b8zDDsPPM0q62MF0)ja2~N9+6z!=0e%Euf4evsS-|t4&pY);=qn@IjA3Q}iW1pdepY)@(@Af0d zDX-G?nM3LD#J^ME;*V(dh*!vb`a6_rFq!6!97u~k8BAs7^J&SLx2fHB9jzGmF0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YwO)Z-bBr$A9_Z8;-jdPfa~-xU3ZZv9C@N4&5W^ypR)G7CW2o(!@nK&N_F+Y9)&i?ds9$RozxLqU-r_eMogu1$4isT{u33_ogyKQ%X0SJao}rrz*(z4$pY ziEr~>V0<+ypcYbVU>71Iq9=`Lz(jmXp7> + + + Test Application + + + + + + diff --git a/Resources/resource.h b/Resources/resource.h new file mode 100644 index 0000000..f949764 --- /dev/null +++ b/Resources/resource.h @@ -0,0 +1,54 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by SystemInfo.rc +// +#define IDS_TITLECAPTION 1 +#define IDS_FILEVERSION 2 +#define IDS_APPCOPYRIGHT 3 +#define IDD_MAIN 100 +#define ID_ABOUT 100 +#define IDC_ABOUT 100 +#define IDI_MAINICON 101 +#define IDI_MAIN 101 +#define ID_CLOSE 101 +#define IDC_CLOSE 101 +#define ID_REFRESH 102 +#define IDC_REFRESH 102 +#define ID_SAVE 103 +#define IDC_SAVE 103 +#define ID_PRINT 104 +#define IDC_PRINT 104 +#define IDR_MENU1 104 +#define IDR_MAINMENU 104 +#define IDC_HANDCURSOR 110 +#define IDD_NETLOGO 146 +#define IDC_TEXTBOX 1000 +#define ID_INFOLIST 1000 +#define IDC_INFOLIST 1000 +#define IDC_NETLINK 1000 +#define IDC_OK 1001 +#define IDC_CANCEL 1002 +#define IDC_STATICTEXT 1003 +#define IDC_OPTLIST 1004 +#define IDC_ABOUTICON 1004 +#define IDC_APPNAME 1005 +#define IDC_APPVERSION 1006 +#define IDC_APPCOPYRIGHT 1007 +#define IDC_OKBUTTON 1008 +#define IDC_BUILDTIMEDATE 1009 +#define ID_HELP_ABOUT 40004 +#define ID_ADVANCED 40005 +#define ID_FILE_CLOSE_APP 40006 +#define ID_FILE_SAVE_INFO 40007 +#define ID_FILE_PRINT_INFO 40008 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 105 +#define _APS_NEXT_COMMAND_VALUE 40009 +#define _APS_NEXT_CONTROL_VALUE 1005 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/Setup Files/AutoUpdate.xml b/Setup Files/AutoUpdate.xml new file mode 100644 index 0000000..3966cb6 --- /dev/null +++ b/Setup Files/AutoUpdate.xml @@ -0,0 +1,5 @@ + + http://www.NetworkDLS.com/Updates + 1.0.1.9 + 5 + diff --git a/Setup Files/Setup.Iss b/Setup Files/Setup.Iss new file mode 100644 index 0000000..65f6f56 --- /dev/null +++ b/Setup Files/Setup.Iss @@ -0,0 +1,45 @@ +[Setup] +;-- Main Setup Information + AppName = SystemInfo + AppVerName = SystemInfo 1.0.1.9 + AppCopyright = Copyright © 1995-2009 NetworkDLS + DefaultDirName = {pf}\NetworkDLS\SystemInfo + DefaultGroupName = NetworkDLS\SystemInfo + UninstallDisplayIcon = {app}\SystemInfo.Exe + PrivilegesRequired = PowerUser + Uninstallable = Yes + AppMutex = SystemInfo + Compression = BZIP/9 + OutputBaseFilename = Setup + DisableStartupPrompt = Yes + DirExistsWarning = No + WizardImageFile = \..\..\@Resources\Setup\LgSetup.bmp + WizardSmallImageFile = \..\..\@Resources\Setup\SmSetup.bmp + LicenseFile = \..\..\@Resources\Setup\EULA.txt + VersionInfoVersion = 1.0.1.8 + MinVersion = 0.0,5.0 + +;-- Windows 2000 & XP (Support Dialog) + AppPublisher = NetworkDLS + AppPublisherURL = http://www.NetworkDLS.com/ + AppUpdatesURL = http://www.NetworkDLS.com/ + AppVersion = 1.0.1.9 + +[Files] + Source: "..\Release\SystemInfo.Exe"; DestDir: "{app}"; Flags: IgnoreVersion; + Source: "..\..\@AutoUpdate\Win32\AutoUpdate.Exe"; DestDir: "{app}"; Flags: RestartReplace; + Source: "AutoUpdate.xml"; DestDir: "{app}"; Flags: IgnoreVersion; + +[Icons] + Name: "{group}\SystemInfo"; Filename: "{app}\SystemInfo.Exe"; + Name: "{group}\AutoUpdate"; Filename: "{app}\AutoUpdate.Exe"; + Name: "{group}\Uninstall"; Filename: "{uninstallexe}"; + +[InstallDelete] + Type: files; Name: "{app}\InfoCmd.Exe" + Type: files; Name: "{app}\AutoUpdate.Exe" + Type: files; Name: "{group}\AutoUpdate.Lnk" + +[RUN] +Filename: "{app}\SystemInfo.Exe"; Description: "Start SystemInfo now?"; Flags: PostInstall NoWait; + diff --git a/Source/Entry.Cpp b/Source/Entry.Cpp new file mode 100644 index 0000000..b886d61 --- /dev/null +++ b/Source/Entry.Cpp @@ -0,0 +1,60 @@ +#ifndef _ENTRY_CPP +#define _ENTRY_CPP +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "../Resources/Resource.H" + +#include "../../@Libraries/NSWFL/NSWFL.H" + +#include "Entry.H" +#include "Init.H" +#include "GetInfo.H" + +#include "../Dialogs/MainDlg.H" + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +HINSTANCE ghAppInstance = NULL; + +char gsAppCopyRight[64]; +char gsFileVersion[32]; +char gsTitleCaption[64]; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevious, LPSTR sCmdLine, int iCmdShow) +{ + ghAppInstance = hInstance; + + int iResult = 0; + + if(!InitializeApp()) + { + return 1; + } + + if(strlen(sCmdLine) > 0) + { + iResult = !SaveAllInfoToFile(sCmdLine); + } + else{ + DialogBox(ghAppInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, MainDialog); + } + + if(!UninitializeApp()) + { + return 1; + } + + return iResult; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif + diff --git a/Source/Entry.H b/Source/Entry.H new file mode 100644 index 0000000..21b10f4 --- /dev/null +++ b/Source/Entry.H @@ -0,0 +1,13 @@ +#ifndef _ENTRY_H +#define _ENTRY_H +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +extern HINSTANCE ghAppInstance; + +extern char gsAppCopyRight[64]; +extern char gsFileVersion[32]; +extern char gsTitleCaption[64]; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif + diff --git a/Source/GetInfo.Cpp b/Source/GetInfo.Cpp new file mode 100644 index 0000000..0edc9f9 --- /dev/null +++ b/Source/GetInfo.Cpp @@ -0,0 +1,1055 @@ +#ifndef _GetInfo_CPP +#define _GetInfo_CPP +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#define WIN32_LEAN_AND_MEAN +#define _WIN32_WINNT 0x0500 + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "../Resources/Resource.H" + +#include "../../@Libraries/NSWFL/NSWFL.H" + +#include "Entry.H" +#include "Init.H" +#include "GetInfo.H" + +#include "../Dialogs/MainDlg.H" + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +using namespace NSWFL::Windows; +using namespace NSWFL::ListBox; +using namespace NSWFL::File; +using namespace NSWFL::Registry; +using namespace NSWFL::System; +using namespace NSWFL::String; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#define MMX_SUPPORTED 0x00800000 +#define SSE_SUPPORTED 0x02000000 +#define SSE2_SUPPORTED 0x04000000 +#define AMD_3DNOW_SUPPORTED 0x80000000 + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +FILE *hTarget = NULL; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +const char *sOptions[] = { + "General", + "BIOS", + "Socket", + "Environment", + "Disk", + "Miscellaneous", + NULL +}; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void WriteText(HWND hWnd, char *sText, bool bWriteToFile) +{ + if(bWriteToFile) + { + fprintf(hTarget, "%s\r\n", sText); + } + else{ + InsertListBoxItem(hWnd, sText, -1); + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool SaveAllInfoToFile(char *sTarget) +{ + if(fopen_s(&hTarget, sTarget, "wb") != 0) + { + return false; + } + + strcpy_s(MDI.sLastOption, sizeof(MDI.sLastOption), ""); + + fprintf(hTarget, SEPERATOR); + + for(int iOpt = 0; sOptions[iOpt]; iOpt++) + { + PopInfoList(true, MDI.InfoList_hWnd, (char *)sOptions[iOpt]); + fprintf(hTarget, SEPERATOR); + } + + fclose(hTarget); + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool PopInfoList(bool bWriteToFile, HWND hWnd, char *sOption) +{ + char sText[255]; + + if(!bWriteToFile) + { + ClearListBox(hWnd); + } + else{ + sprintf_s(sText, sizeof(sText), "[%s Information]", sOption); + WriteText(hWnd, sText, bWriteToFile); + WriteText(hWnd, "", bWriteToFile); + } + + if(_strcmpi(sOption, "General") == 0) + { + WriteOsVersion(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + + WriteProcessorInformation(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + + WriteNetWorkInformation(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + + WriteMemoryStatus(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + } + else if(_strcmpi(sOption, "BIOS") == 0) + { + WriteBIOSInfo(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + } + else if(_strcmpi(sOption, "Socket") == 0) + { + PrintWSAData(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + } + else if(_strcmpi(sOption, "Environment") == 0) + { + WriteBootType(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + WriteEnvironmentInfo(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + } + else if(_strcmpi(sOption, "Disk") == 0) + { + Write_DiskInformation(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + } + else if(_strcmpi(sOption, "Miscellaneous") == 0) + { + WriteDisplayInformation(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + WriteMouseInformation(bWriteToFile, hWnd); + WriteText(hWnd, "", bWriteToFile); + } + + if(!bWriteToFile) + { + SendMessage(hWnd, (UINT) LB_SETANCHORINDEX , 0, TRUE); + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool WriteMouseInformation(bool bWriteToFile, HWND hWnd) +{ + char sTemp[255]; + char *sOption = NULL; + + //-------------------------------------------------------------------- + + WriteText(hWnd, "- Mouse Information : ", bWriteToFile); + if(GetSystemMetrics(SM_MOUSEPRESENT) == 0) + sOption = "False"; + else sOption = "True"; + + sprintf_s(sTemp, sizeof(sTemp), "\t Mouse Present : %s",sOption); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp), "\t Number Of Mouse Buttons: %d ",GetSystemMetrics(SM_CMOUSEBUTTONS)); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + if(GetSystemMetrics(SM_SWAPBUTTON) == 0) + sOption = "False"; + else sOption = "True"; + + sprintf_s(sTemp, sizeof(sTemp), "\t Mouse Buttons Swapped : %s", sOption); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + if(GetSystemMetrics(SM_MOUSEWHEELPRESENT) == 0) + sOption = "False"; + else sOption = "True"; + + sprintf_s(sTemp, sizeof(sTemp), "\t Mouse Wheel Present : %s", sOption); + WriteText(hWnd, sTemp, bWriteToFile); + + WriteText(hWnd, "", bWriteToFile); + + WriteText(hWnd, "- Mouse Metrics : ", bWriteToFile); + //-------------------------------------------------------------------- + sprintf_s(sTemp, sizeof(sTemp), "\t Double Click Square : %d X %d ", + GetSystemMetrics(SM_CXDOUBLECLK), GetSystemMetrics(SM_CYDOUBLECLK)); + + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + sprintf_s(sTemp, sizeof(sTemp), "\t Begin Drag Square : %d X %d ", + GetSystemMetrics(SM_CXDRAG), GetSystemMetrics(SM_CYDRAG)); + + WriteText(hWnd, sTemp, bWriteToFile); + //-------------------------------------------------------------------- + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool WriteDisplayInformation(bool bWriteToFile, HWND hWnd) +{ + char sTemp[255]; + + //-------------------------------------------------------------------- + + WriteText(hWnd, "- Display Information : ", bWriteToFile); + + //-------------------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp),"\t Full Screen Size : %d X %d ", + GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp),"\t Viewable Desktop Size : %d X %d ", + GetSystemMetrics(SM_CXFULLSCREEN), GetSystemMetrics(SM_CYFULLSCREEN)); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp),"\t Minimum Window Size : %d X %d ", + GetSystemMetrics(SM_CXMIN), GetSystemMetrics(SM_CYMIN)); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp),"\t Icon Spacing Grid : %d X %d ", + GetSystemMetrics(SM_CXICONSPACING),GetSystemMetrics(SM_CYICONSPACING)); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool Write_DiskInformation(bool bWriteToFile, HWND hWnd) +{ + int iPos = 65; //Drive S + int iDriveType = 0; + char sDrive[5]; + char sText[1024]; + + while(iPos <= 90) + { + sprintf_s(sDrive, sizeof(sDrive), "%c:\\", iPos); + + if((iDriveType = GetDriveType(sDrive)) != DRIVE_NO_ROOT_DIR) + { + sprintf_s(sText, sizeof(sText), "-Drive: %s", sDrive); + + if(iDriveType == DRIVE_UNKNOWN) { + strcat_s(sText, sizeof(sText), " (The drive type cannot be determined)"); + } + else if(iDriveType == DRIVE_REMOVABLE) { + strcat_s(sText, sizeof(sText), " (Removable Media)"); + } + else if(iDriveType == DRIVE_FIXED) { + strcat_s(sText, sizeof(sText), " (Fixed Disk)"); + } + else if(iDriveType == DRIVE_REMOTE) { + strcat_s(sText, sizeof(sText), " (Network Drive)"); + } + else if(iDriveType == DRIVE_CDROM) { + strcat_s(sText, sizeof(sText), " (CD-ROM Drive)"); + } + else if(iDriveType == DRIVE_RAMDISK) { + strcat_s(sText, sizeof(sText), " (RAM disk)"); + } + + WriteText(hWnd, sText, bWriteToFile); + + if(iDriveType != DRIVE_UNKNOWN && iDriveType != DRIVE_REMOVABLE && iDriveType != DRIVE_CDROM) + { + WriteDriveInfo(bWriteToFile, hWnd, sDrive); + } + } + + iPos++; + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool WriteDriveInfo(bool bWriteToFile, HWND hWnd, char *sDrive) +{ + char sTemp[1024]; + char sSize[64]; + char sSerial[240]; + LARGE_INTEGER a, b, c; + + char sVolumeNameBuffer[1024]; + DWORD dwVolumeNameSize = sizeof(sVolumeNameBuffer); + DWORD dwVolumeSerialNumber; + DWORD dwMaximumComponentLength; + DWORD dwFileSystemFlags; + char sFileSystemNameBuffer[1024]; + DWORD dwFileSystemNameSize = sizeof(sFileSystemNameBuffer); + + if(GetVolumeInformation(sDrive, + sVolumeNameBuffer, + dwVolumeNameSize, + &dwVolumeSerialNumber, + &dwMaximumComponentLength, + &dwFileSystemFlags, + sFileSystemNameBuffer, + dwFileSystemNameSize)) + { + WriteText(hWnd, "\t Misc Volume Info:", bWriteToFile); + sprintf_s(sTemp, sizeof(sTemp),"\t\t Volume Name: %s",sVolumeNameBuffer); + WriteText(hWnd, sTemp, bWriteToFile); + sprintf_s(sTemp, sizeof(sTemp),"\t\t File System: %s",sFileSystemNameBuffer); + WriteText(hWnd, sTemp, bWriteToFile); + + sprintf_s(sSerial, sizeof(sSerial), "%X",dwVolumeSerialNumber); + + sprintf_s(sTemp, sizeof(sTemp),"\t\t Serial Number : %c%c%c%c-%c%c%c%c ", + sSerial[0],sSerial[1],sSerial[2],sSerial[3], + sSerial[4],sSerial[5],sSerial[6],sSerial[7]); + + WriteText(hWnd, sTemp, bWriteToFile); + + sprintf_s(sTemp, sizeof(sTemp),"\t\t Max File Name Length: %d",dwMaximumComponentLength); + WriteText(hWnd, sTemp, bWriteToFile); + + WriteText(hWnd, "", bWriteToFile); + + WriteText(hWnd, "\t Volume Flags:", bWriteToFile); + if(dwFileSystemFlags & FS_CASE_IS_PRESERVED) + WriteText(hWnd, "\t\t File Case Is Preserved.", bWriteToFile); + if(dwFileSystemFlags & FS_CASE_SENSITIVE) + WriteText(hWnd, "\t\t Supports Case Sensitive Names.", bWriteToFile); + if(dwFileSystemFlags & FS_UNICODE_STORED_ON_DISK) + WriteText(hWnd, "\t\t Supports Unicode In Filenames.", bWriteToFile); + if(dwFileSystemFlags & FS_PERSISTENT_ACLS) + WriteText(hWnd, "\t\t Security Is Preserved And Enforced.", bWriteToFile); + if(dwFileSystemFlags & FS_FILE_COMPRESSION) + WriteText(hWnd, "\t\t Supports File-Based Compression.", bWriteToFile); + if(dwFileSystemFlags & FS_VOL_IS_COMPRESSED) + WriteText(hWnd, "\t\t Volume Is Compressed.", bWriteToFile); + } + else WriteText(hWnd, "Volume Information Error", bWriteToFile); + + WriteText(hWnd, "", bWriteToFile); + + if(GetDiskFreeSpaceEx(sDrive,(ULARGE_INTEGER *)&a,(ULARGE_INTEGER *)&b,(ULARGE_INTEGER *)&c)) + { + WriteText(hWnd, "\t Volume Size Info:", bWriteToFile); + + FileSizeFriendly(b.QuadPart, sSize, sizeof(sSize)); + sprintf_s(sTemp, sizeof(sTemp),"\t\t Bytes Total %s", sSize); + WriteText(hWnd, sTemp, bWriteToFile); + + FileSizeFriendly(b.QuadPart - c.QuadPart, sSize, sizeof(sSize)); + sprintf_s(sTemp, sizeof(sTemp),"\t\t Bytes Used %s", sSize); + WriteText(hWnd, sTemp, bWriteToFile); + + FileSizeFriendly(c.QuadPart, sSize, sizeof(sSize)); + sprintf_s(sTemp, sizeof(sTemp),"\t\t Bytes Free %s", sSize); + WriteText(hWnd, sTemp, bWriteToFile); + + FileSizeFriendly(a.QuadPart, sSize, sizeof(sSize)); + sprintf_s(sTemp, sizeof(sTemp),"\t\t Bytes Quota %s", sSize); + WriteText(hWnd, sTemp, bWriteToFile); + } + else WriteText(hWnd, "Disk Free Space Error", bWriteToFile); + + WriteText(hWnd, "", bWriteToFile); + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool WriteEnvironmentInfo(bool bWriteToFile, HWND hWnd) +{ + char sVar[1024]; + char sTemp[1024]; + + DWORD dwVersion; + dwVersion = GetVersion(); + + WriteText(hWnd, "- Command :", bWriteToFile); + + GetEnvironmentVariable("COMSPEC", sVar, sizeof(sVar)); + if(strlen(sVar) > 3) + { + sprintf_s(sTemp, sizeof(sTemp), "\t Interpreter: %s ", sVar); + WriteText(hWnd, sTemp, bWriteToFile); + } + + if(dwVersion != 0) + { + sprintf_s(sTemp, sizeof(sTemp), "\t Version: %d.%d ", HIBYTE(HIWORD(dwVersion)), LOBYTE(HIWORD(dwVersion))); + WriteText(hWnd, sTemp, bWriteToFile); + } + + WriteText(hWnd, "", bWriteToFile); + + WriteText(hWnd, "- Directory :", bWriteToFile); + + if(Get_WindowsDirectory(sVar, sizeof(sVar))) + { + sprintf_s(sTemp, sizeof(sTemp), "\t Windows: %s ", sVar); + WriteText(hWnd, sTemp, bWriteToFile); + } + + if(Get_SystemDirectory(sVar, sizeof(sVar))) + { + sprintf_s(sTemp, sizeof(sTemp), "\t System: %s ", sVar); + WriteText(hWnd, sTemp, bWriteToFile); + } + + if(Get_TempDirectory(sVar, sizeof(sVar))) + { + sprintf_s(sTemp, sizeof(sTemp), "\t Temporary: %s", sVar); + WriteText(hWnd, sTemp, bWriteToFile); + } + + if(Get_CurrentDirectory(sVar, sizeof(sVar))) + { + sprintf_s(sTemp, sizeof(sTemp), "\t Current: %s", sVar); + WriteText(hWnd, sTemp, bWriteToFile); + } + + GetEnvironmentVariable("path", sVar, sizeof(sVar)); + if(strlen(sVar) > 3) + { + sprintf_s(sTemp, sizeof(sTemp), "\t Path: %s ", sVar); + WriteText(hWnd, sTemp, bWriteToFile); + } + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool WriteBootType(bool bWriteToFile, HWND hWnd) +{ + int iType = GetSystemMetrics(SM_CLEANBOOT); + WriteText(hWnd, "- Boot Type : ", bWriteToFile); + if(iType == 0) WriteText(hWnd, "\t Normal", bWriteToFile); + if(iType == 1) WriteText(hWnd, "\t Fail-Safe", bWriteToFile); + if(iType == 2) WriteText(hWnd, "\t Fail-Safe With Network", bWriteToFile); + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void WriteHostInformation(bool bWriteToFile, HWND hWnd, struct hostent *lpHost) +{ + char sTemp[1024]; + struct in_addr MyAddr; + int iPos = 0; + + WriteText(hWnd, "\t Address List", bWriteToFile); + + while((*lpHost).h_addr_list[iPos]) + { + memcpy(&MyAddr.s_addr, (*lpHost).h_addr_list[iPos], (*lpHost).h_length ); + + sprintf_s(sTemp, sizeof(sTemp), "\t\t (# %d) %s", iPos, inet_ntoa(MyAddr)); + + WriteText(hWnd, sTemp, bWriteToFile); + iPos++; + } + +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool PrintWSAData(bool bWriteToFile, HWND hWnd) +{ + int iLO = 0; + int iHI = 0; + + char sTemp[1024]; + + int iResult = 0; + char sHostName[1024]; + struct hostent *MyHost; + + WORD WSARequiredVersion; // Windows Socket Required Version + WSADATA WSAData; // Windows Socket Required Version + WSADATA *WSAPointerData; // Windows Socket Required Version + + //--------------------------------------------------------- + + WriteText(hWnd, "- Windows Socket Information : ", bWriteToFile); + + // -------- WINSOCK STARTUP -------- + WSARequiredVersion = 0x0101; // Version 1.1 + WSAPointerData = &WSAData; + if(WSAStartup(WSARequiredVersion, WSAPointerData)!= 0) + { + WriteText(hWnd, "\t Winsock is out of date or not installed.", bWriteToFile); + return false; + } + + //--------------------------------------------------------- + + iLO = LOBYTE(WSAData.wVersion); + iHI = HIBYTE(WSAData.wVersion); + sprintf_s(sTemp, sizeof(sTemp), "\t Winsock Version : %d.%d ", iLO, iHI); + WriteText(hWnd, sTemp, bWriteToFile); + + //--------------------------------------------------------- + + iLO = LOBYTE(WSAData.wHighVersion); + iHI = HIBYTE(WSAData.wHighVersion); + sprintf_s(sTemp, sizeof(sTemp), "\t Winsock HIGH Version : %d.%d ", iLO, iHI); + WriteText(hWnd, sTemp, bWriteToFile); + + //--------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp), "\t Winsock Description : %s ", WSAData.szDescription); + WriteText(hWnd, sTemp, bWriteToFile); + + //--------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp), "\t Max Sockets : %d ", WSAData.iMaxSockets); + WriteText(hWnd, sTemp, bWriteToFile); + + //--------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp), "\t Max UDP Datagram Size : %d ", WSAData.iMaxUdpDg); + WriteText(hWnd, sTemp, bWriteToFile); + + //--------------------------------------------------------- + + if((MyHost = gethostbyname("localhost")) == NULL) + { + WriteText(hWnd, "GetHostByName() failed.", bWriteToFile); + return false; + } + + WriteText(hWnd, "", bWriteToFile); + + sprintf_s(sTemp, sizeof(sTemp), "-Local Host %s Info :", (*MyHost).h_name); + WriteText(hWnd, sTemp, bWriteToFile); + WriteHostInformation(bWriteToFile, hWnd, MyHost); + + if( gethostname(sHostName, sizeof(sHostName)) == SOCKET_ERROR ) + { + WriteText(hWnd, "GetHostName() failed.", bWriteToFile); + return false; + } + + if((MyHost = gethostbyname(sHostName)) == NULL) + { + WriteText(hWnd, "- GetHostByName() failed.", bWriteToFile); + return false; + } + + WriteText(hWnd, "", bWriteToFile); + + sprintf_s(sTemp, sizeof(sTemp), "-Local Machine %s Info :", (*MyHost).h_name); + WriteText(hWnd, sTemp, bWriteToFile); + + WriteHostInformation(bWriteToFile, hWnd, MyHost); + + //--------------------------------------------------------- + + if(WSACleanup() == SOCKET_ERROR) + { + return false; + } + + //--------------------------------------------------------- + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void WriteBIOSInfo(bool bWriteToFile, HWND hWnd) +{ + char sTemp[1024]; + + char sBuf[1024]; + DWORD dwBufSz = sizeof(sBuf); + + WriteText(hWnd, "- System BIOS : ", bWriteToFile); + + memset(sBuf, 0, sizeof(sBuf)); + dwBufSz = sizeof(sBuf); + if(Get_StringRegistryValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System", "SystemBIOSVersion", sBuf, dwBufSz)) + { + sprintf_s(sTemp, sizeof(sTemp), "\t BIOS Version : %s", sBuf); + WriteText(hWnd, sTemp, bWriteToFile); + }else{ + sprintf_s(sTemp, sizeof(sTemp), "\t BIOS Version : %s", "N/A"); + WriteText(hWnd, sTemp, bWriteToFile); + } + + memset(sBuf, 0, sizeof(sBuf)); + dwBufSz = sizeof(sBuf); + if(Get_StringRegistryValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System", "SystemBIOSDate", sBuf, dwBufSz)) + { + sprintf_s(sTemp, sizeof(sTemp), "\t BIOS Date : %s", sBuf); + WriteText(hWnd, sTemp, bWriteToFile); + }else{ + sprintf_s(sTemp, sizeof(sTemp), "\t BIOS Date : %s", "N/A"); + WriteText(hWnd, sTemp, bWriteToFile); + } + + memset(sBuf, 0, sizeof(sBuf)); + dwBufSz = sizeof(sBuf); + if(Get_StringRegistryValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System", "Identifier", sBuf, dwBufSz)) + { + sprintf_s(sTemp, sizeof(sTemp), "\t Identifier : %s ", sBuf); + WriteText(hWnd, sTemp, bWriteToFile); + }else{ + sprintf_s(sTemp, sizeof(sTemp), "\t Identifier : %s", "N/A"); + WriteText(hWnd, sTemp, bWriteToFile); + } + + WriteText(hWnd, "", bWriteToFile); + + WriteText(hWnd, "- Video BIOS :", bWriteToFile); + + memset(sBuf, 0, sizeof(sBuf)); + dwBufSz = sizeof(sBuf); + if(Get_StringRegistryValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System", "VideoBIOSVersion", sBuf, dwBufSz)) + { + sprintf_s(sTemp, sizeof(sTemp), "\t BIOS Version : %s", sBuf); + WriteText(hWnd, sTemp, bWriteToFile); + }else{ + sprintf_s(sTemp, sizeof(sTemp), "\t BIOS Version : %s", "N/A"); + WriteText(hWnd, sTemp, bWriteToFile); + } + + memset(sBuf, 0, sizeof(sBuf)); + dwBufSz = sizeof(sBuf); + if(Get_StringRegistryValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System", "VideoBIOSDate", sBuf, dwBufSz)) + { + sprintf_s(sTemp, sizeof(sTemp), "\t BIOS Date : %s", sBuf); + WriteText(hWnd, sTemp, bWriteToFile); + }else{ + sprintf_s(sTemp, sizeof(sTemp), "\t BIOS Date : %s", "N/A"); + WriteText(hWnd, sTemp, bWriteToFile); + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void WriteOsVersion(bool bWriteToFile, HWND hWnd) +{ + char sTemp[255]; + char sOSInfo[255]; + + char *sOption = NULL; + + //-------------------------------------------------------------------- + WriteText(hWnd, "- OS Version :", bWriteToFile); + //-------------------------------------------------------------------- + + Get_OsVersion(sOSInfo, sizeof(sOSInfo)); + sprintf_s(sTemp, sizeof(sTemp), "\t %s", sOSInfo); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + if(IsWinNT()) + sOption = "True"; + else sOption = "False"; + sprintf_s(sTemp, sizeof(sTemp), "\t Is System NT based? : %s", sOption); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + if(GetSystemMetrics(SM_DBCSENABLED) == 0) + sOption = "False"; + else sOption = "True"; + sprintf_s(sTemp, sizeof(sTemp), "\t (DBCS) User.Exe Version : %s", sOption); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + if(GetSystemMetrics(SM_DEBUG) == 0) + sOption = "False"; + else sOption = "True"; + sprintf_s(sTemp, sizeof(sTemp), "\t Debugging User.Exe Version : %s", sOption); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +int GetLastCharPosv(char *sInBuf, int iInBufSz) +{ + int iRPos = iInBufSz; + while(iRPos != 0) + { + if(!IsWhiteSpace(sInBuf[iRPos])) + return iRPos + 1; + iRPos--; + } + return -1; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void GetCycleCount(unsigned __int64 *i64Cycles) +{ + __asm { + push edx + rdtsc + push edi + mov edi, dword ptr i64Cycles + mov dword ptr [edi], eax + mov dword ptr [edi+4], edx + pop edi + pop edx + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +DWORD GetCPUSpeedAlt(void) +{ + unsigned __int64 iBefore = 0; + unsigned __int64 iAfter = 0; + + GetCycleCount(&iBefore); + Sleep(1000); + GetCycleCount(&iAfter); + + return((DWORD)(iAfter - iBefore) / 1000000); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool IsCPUID() +{ + __try + { + _asm + { + xor eax, eax + cpuid + } + } + __except (EXCEPTION_EXECUTE_HANDLER) + { + return false; + } + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool WriteProcessorFeatures(bool bWriteToFile, HWND hWnd) +{ + if (!IsCPUID()) + { + return false; + } + + DWORD dwStandard = 0; + DWORD dwFeature = 0; + DWORD dwMax = 0; + DWORD dwExt = 0; + int feature = 0; + int os_support = 0; + + union { + char cBuffer[12+1]; + struct { + DWORD dw0; + DWORD dw1; + DWORD dw2; + } stc; + } Vendor; + + memset(&Vendor, 0, sizeof(Vendor)); + + _asm { + push ebx + push ecx + push edx + + // get the vendor string + xor eax, eax + cpuid + mov dwMax, eax + mov Vendor.stc.dw0, ebx + mov Vendor.stc.dw1, edx + mov Vendor.stc.dw2, ecx + + // get the Standard bits + mov eax, 1 + cpuid + mov dwStandard, eax + mov dwFeature, edx + + // get AMD-specials + mov eax, 80000000h + cpuid + cmp eax, 80000000h + jc notamd + mov eax, 80000001h + cpuid + mov dwExt, edx + + notamd: + pop ecx + pop ebx + pop edx + }; + + char sFeatures[255]; + strcpy_s(sFeatures, sizeof(sFeatures), ""); + + if (dwFeature & MMX_SUPPORTED) + strcat_s(sFeatures, sizeof(sFeatures), "MMX "); + if (dwExt & AMD_3DNOW_SUPPORTED) + strcat_s(sFeatures, sizeof(sFeatures), "3DNow! "); + if (dwFeature & SSE_SUPPORTED) + strcat_s(sFeatures, sizeof(sFeatures), "SSE "); + if (dwFeature & SSE2_SUPPORTED) + strcat_s(sFeatures, sizeof(sFeatures), "SSE2 "); + + if(strlen(sFeatures) > 0) + { + char sTemp[1024]; + sprintf_s(sTemp, sizeof(sTemp), "\t Features : %s", sFeatures); + WriteText(hWnd, sTemp, bWriteToFile); + } + + /* + int iFamily = (short int)((dwStandard >> 8) & 0xF); // retrieve family + int iFamilyEx = 0; + if (iFamily == 15) // retrieve extended family + iFamilyEx = (dwStandard >> 16) & 0xFF0; + + int iModel = (short int)((dwStandard >> 4) & 0xF); // retrieve model + int iModelEx = 0; + if (iModel == 15) // retrieve extended model + iModelEx = (dwStandard >> 12) & 0xF; + + int iStepping = (short int)((dwStandard) & 0xF); // retrieve stepping + */ + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void WriteProcessorInformation(bool bWriteToFile, HWND hWnd) +{ + char *sOption = NULL; + char sBuf[1024]; + char sTemp[1024]; + + DWORD dwBuf = 0; + DWORD dwBufSz = sizeof(sBuf); + + SYSTEM_INFO SI; + + memset(&SI, 0, sizeof(SI)); + + GetSystemInfo(&SI); + + //-------------------------------------------------------------------- + + WriteText(hWnd, "- Processor :", bWriteToFile); + + //-------------------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp), "\t Number of Processors : %d", SI.dwNumberOfProcessors); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + memset(sBuf, 0, sizeof(sBuf)); + dwBufSz = sizeof(sBuf); + if(Get_StringRegistryValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", "VendorIdentifier", sBuf, dwBufSz)) + sprintf_s(sTemp, sizeof(sTemp), "\t Processor Type : %s", sBuf); + else sprintf_s(sTemp, sizeof(sTemp), "\t Processor Type : %s", "N/A"); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + memset(sBuf, 0, sizeof(sBuf)); + dwBufSz = sizeof(sBuf); + if(Get_StringRegistryValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", "ProcessorNameString", sBuf, dwBufSz)) + { + LTrim(sBuf); + sprintf_s(sTemp, sizeof(sTemp), "\t Processor Name : %s", sBuf); + } + else sprintf_s(sTemp, sizeof(sTemp), "\t Processor Name : %s", "N/A"); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + WriteProcessorFeatures(bWriteToFile, hWnd); + + //-------------------------------------------------------------------- + + memset(sBuf, 0, sizeof(sBuf)); + dwBufSz = sizeof(sBuf); + if(Get_StringRegistryValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", "Identifier", sBuf, dwBufSz)) + sprintf_s(sTemp, sizeof(sTemp), "\t Identifier : %s", sBuf); + else sprintf_s(sTemp, sizeof(sTemp), "\t Identifier : %s", "N/A"); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + if(!Get_DWORDRegistryValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", "~MHz", dwBuf)) + { + dwBuf = GetCPUSpeedAlt(); + } + + float fHz = (float)dwBuf; + char *sDivisor = "MHz"; + + if(fHz >= 1000) + { + fHz /= 1000.0f; + sDivisor = "GHz"; + } + + sprintf_s(sTemp, sizeof(sTemp), "\t Speed : %.2f%s", fHz, sDivisor); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp), "\t Level : %d ", SI.dwProcessorType); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp), "\t Granularity : %dK", SI.dwAllocationGranularity/1024); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + sprintf_s(sTemp, sizeof(sTemp), "\t Revision : %d", SI.wProcessorRevision); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + if(GetSystemMetrics(SM_SLOWMACHINE) == 1) + sOption = "False"; + else sOption = "True"; + sprintf_s(sTemp, sizeof(sTemp), "\t High-End Processor : %s", sOption); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void WriteMemoryStatus(bool bWriteToFile, HWND hWnd) +{ + char sTemp[255]; + char sSize[64]; + + MEMORYSTATUSEX MS; + memset(&MS, 0, sizeof(MS)); + MS.dwLength = sizeof(MS); + GlobalMemoryStatusEx(&MS); + + //-------------------------------------------------------------------- + + WriteText(hWnd, "- Memory Information :", bWriteToFile); + + //-------------------------------------------------------------------- + + FileSizeFriendly(MS.ullTotalPhys, 2, sSize, sizeof(sSize)); + sprintf_s(sTemp, sizeof(sTemp), "\t Total Physical Memory: %s", sSize); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + FileSizeFriendly(MS.ullTotalPhys - MS.ullAvailPhys, sSize, sizeof(sSize)); + sprintf_s(sTemp, sizeof(sTemp), "\t Used Memory: %s", sSize); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- + + FileSizeFriendly(MS.ullAvailPhys, sSize, sizeof(sSize)); + sprintf_s(sTemp, sizeof(sTemp), "\t Free Memory: %s", sSize); + WriteText(hWnd, sTemp, bWriteToFile); + + //-------------------------------------------------------------------- +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void WriteNetWorkInformation(bool bWriteToFile, HWND hWnd) +{ + char *sOption = NULL; + char sBuf[255]; + char sTemp[255]; + + WriteText(hWnd, "- Windows Network :", bWriteToFile); + + if(Get_MachineName(sBuf, sizeof(sBuf))) + { + sprintf_s(sTemp, sizeof(sTemp), "\t Machine Name : %s", sBuf); + WriteText(hWnd, sTemp, bWriteToFile); + } + + if(Get_UserName(sBuf, sizeof(sBuf))) + { + sprintf_s(sTemp, sizeof(sTemp), "\t User Name : %s", sBuf); + WriteText(hWnd, sTemp, bWriteToFile); + } + + if(GetSystemMetrics(SM_SECURE) == 0) + sOption = "False"; + else sOption = "True"; + sprintf_s(sTemp, sizeof(sTemp), "\t Security Present : %s", sOption); + WriteText(hWnd, sTemp, bWriteToFile); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif + diff --git a/Source/GetInfo.H b/Source/GetInfo.H new file mode 100644 index 0000000..1d448d3 --- /dev/null +++ b/Source/GetInfo.H @@ -0,0 +1,31 @@ +#ifndef _GetInfo_H +#define _GetInfo_H +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#define SEPERATOR "---------------------------------------------------------------------\r\n" + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +extern const char *sOptions[]; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool PopInfoList(bool bWriteToFile, HWND hWnd, char *sOption); +void WriteOsVersion(bool bWriteToFile, HWND hWnd); +void WriteProcessorInformation(bool bWriteToFile, HWND hWnd); +void WriteMemoryStatus(bool bWriteToFile, HWND hWnd); +void WriteNetWorkInformation(bool bWriteToFile, HWND hWnd); +void WriteBIOSInfo(bool bWriteToFile, HWND hWnd); +bool PrintWSAData(bool bWriteToFile, HWND hWnd); +void WriteHostInformation(bool bWriteToFile, HWND hWnd, struct hostent *lpHost); +bool WriteBootType(bool bWriteToFile, HWND hWnd); +bool WriteEnvironmentInfo(bool bWriteToFile, HWND hWnd); +bool Write_DiskInformation(bool bWriteToFile, HWND hWnd); +bool WriteDriveInfo(bool bWriteToFile, HWND hWnd, char *sDrive); +bool WriteDisplayInformation(bool bWriteToFile, HWND hWnd); +bool WriteMouseInformation(bool bWriteToFile, HWND hWnd); +bool SaveAllInfoToFile(char *sTarget); + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif + diff --git a/Source/Init.Cpp b/Source/Init.Cpp new file mode 100644 index 0000000..195585a --- /dev/null +++ b/Source/Init.Cpp @@ -0,0 +1,40 @@ +#ifndef _INIT_CPP +#define _INIT_CPP +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include "../Resources/Resource.H" + +#include "../../@Libraries/NSWFL/NSWFL.H" + +#include "Init.H" +#include "Entry.H" + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool InitializeApp(void) +{ + LoadString(ghAppInstance, IDS_APPCOPYRIGHT, gsAppCopyRight, sizeof(gsAppCopyRight)); + LoadString(ghAppInstance, IDS_FILEVERSION, gsFileVersion, sizeof(gsFileVersion)); + LoadString(ghAppInstance, IDS_TITLECAPTION, gsTitleCaption, sizeof(gsTitleCaption)); + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool UninitializeApp(void) +{ + return true; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif + diff --git a/Source/Init.H b/Source/Init.H new file mode 100644 index 0000000..43b99f7 --- /dev/null +++ b/Source/Init.H @@ -0,0 +1,10 @@ +#ifndef _INIT_H +#define _INIT_H +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +bool InitializeApp(void); +bool UninitializeApp(void); + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#endif + diff --git a/SystemInfo.sln b/SystemInfo.sln new file mode 100644 index 0000000..70d6075 --- /dev/null +++ b/SystemInfo.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SystemInfo", "SystemInfo.vcxproj", "{E1627A40-B36D-4EF3-AD74-4949479BB10B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E1627A40-B36D-4EF3-AD74-4949479BB10B}.Debug|Win32.ActiveCfg = Debug|Win32 + {E1627A40-B36D-4EF3-AD74-4949479BB10B}.Debug|Win32.Build.0 = Debug|Win32 + {E1627A40-B36D-4EF3-AD74-4949479BB10B}.Release|Win32.ActiveCfg = Release|Win32 + {E1627A40-B36D-4EF3-AD74-4949479BB10B}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/SystemInfo.vcxproj b/SystemInfo.vcxproj new file mode 100644 index 0000000..fc6dd1d --- /dev/null +++ b/SystemInfo.vcxproj @@ -0,0 +1,207 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {E1627A40-B36D-4EF3-AD74-4949479BB10B} + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\Debug\ + .\Debug\ + true + false + false + .\Release\ + .\Release\ + false + false + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + .\Debug/SystemInfo.tlb + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + .\Debug/SystemInfo.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + Ws2_32.lib;%(AdditionalDependencies) + .\Debug/SystemInfo.exe + true + true + .\Debug/SystemInfo.pdb + Windows + false + + + MachineX86 + + + + + .\Release/SystemInfo.tlb + + + + + MinSpace + OnlyExplicitInline + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + .\Release/SystemInfo.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + Ws2_32.lib;%(AdditionalDependencies) + .\Release/SystemInfo.exe + true + .\Release/SystemInfo.pdb + Windows + false + + + MachineX86 + + + + + + + + + + + + + + + + + + + Disabled + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(PreprocessorDefinitions) + + + + + Disabled + %(PreprocessorDefinitions) + EnableFastChecks + MaxSpeed + %(PreprocessorDefinitions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %(PreprocessorDefinitions) + Resources;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + Resources;%(AdditionalIncludeDirectories) + + + + + + \ No newline at end of file diff --git a/SystemInfo.vcxproj.filters b/SystemInfo.vcxproj.filters new file mode 100644 index 0000000..e22d015 --- /dev/null +++ b/SystemInfo.vcxproj.filters @@ -0,0 +1,165 @@ + + + + + {5659f843-7970-4590-b357-944ca2d99567} + c;cpp;lib + + + {d45e18f4-697e-4017-8af5-c40f4bf069d1} + + + {ca61a520-8c42-48df-b332-9924b6da1a57} + res;rc;ico;bmp + + + {8f4e9250-3d3d-40da-8ff1-825a8d45a886} + + + {29c7420d-7fb0-42d4-8a3a-5199672f260a} + + + + + SourceFiles + + + SourceFiles + + + SourceFiles + + + Dialogs + + + Dialogs + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + + + SourceFiles + + + SourceFiles + + + Dialogs + + + Dialogs + + + Resources + + + Resources + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + Classes & Libraries\NSWFL + + + + + Resources + + + Resources + + + Resources + + + Resources + + + + + Resources + + + \ No newline at end of file