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 0000000..aebc4b8 Binary files /dev/null and b/Resources/HandCur.cur differ diff --git a/Resources/MainIcon.ico b/Resources/MainIcon.ico new file mode 100644 index 0000000..448699c Binary files /dev/null and b/Resources/MainIcon.ico differ diff --git a/Resources/SystemInfo.rc b/Resources/SystemInfo.rc new file mode 100644 index 0000000..ac9bf4f --- /dev/null +++ b/Resources/SystemInfo.rc @@ -0,0 +1,255 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Neutral resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_MAIN DIALOGEX 309, 7, 395, 255 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "System Info" +MENU IDR_MAINMENU +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + LISTBOX IDC_OPTLIST,328,8,59,200,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "Refresh",IDC_REFRESH,328,211,59,14,BS_CENTER + PUSHBUTTON "Close",IDC_CLOSE,328,230,59,14,BS_CENTER + LISTBOX IDC_INFOLIST,4,4,315,244,LBS_SORT | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | LBS_NOSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP + CONTROL "",0,"Static",SS_ETCHEDFRAME,324,4,67,244 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_MAIN, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 391 + TOPMARGIN, 4 + BOTTOMMARGIN, 248 + END +END +#endif // APSTUDIO_INVOKED + +#endif // Neutral resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_NETLOGO DIALOGEX 0, 0, 273, 87 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "IDD_NETLOGO" +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + ICON "",IDC_ABOUTICON,9,7,21,20 + LTEXT "IDC_APPNAME",IDC_APPNAME,84,7,159,8 + LTEXT "IDC_APPVERSION",IDC_APPVERSION,84,17,159,8 + LTEXT "IDC_APPCOPYRIGHT",IDC_APPCOPYRIGHT,44,53,192,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,40,63,234,1 + DEFPUSHBUTTON "OK",IDC_OKBUTTON,220,69,50,14 + LTEXT "IDC_BUILDTIMEDATE",IDC_BUILDTIMEDATE,84,27,159,8 + LTEXT "www.NetworkDLS.com",IDC_NETLINK,84,37,159,8 + LTEXT "Web site:",IDC_STATIC,44,37,31,8 + LTEXT "Application:",IDC_STATIC,44,7,38,8 + LTEXT "Version:",IDC_STATIC,44,17,26,8 + LTEXT "Build:",IDC_STATIC,44,27,18,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_NETLOGO, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + VERTGUIDE, 248 + TOPMARGIN, 7 + BOTTOMMARGIN, 65 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAIN ICON "MainIcon.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MAINMENU MENU +BEGIN + POPUP "File" + BEGIN + MENUITEM "Save As...", ID_FILE_SAVE_INFO + MENUITEM "Print", ID_FILE_PRINT_INFO, GRAYED + MENUITEM SEPARATOR + MENUITEM "Close", ID_FILE_CLOSE_APP + END + MENUITEM "Advanced", ID_ADVANCED, GRAYED + POPUP "Help" + BEGIN + MENUITEM "About", ID_HELP_ABOUT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,1,9 + PRODUCTVERSION 1,0,1,9 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "NetworkDLS" + VALUE "FileDescription", "System information utility" + VALUE "FileVersion", "1.0.1.9" + VALUE "InternalName", "SystemInfo" + VALUE "LegalCopyright", "Copyright © 2009 NeteorkDLS." + VALUE "OriginalFilename", "SystemInfo.exe" + VALUE "ProductName", " SystemInfo" + VALUE "ProductVersion", "1.0.1.9" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Cursor +// + +IDC_HANDCURSOR CURSOR "HandCur.cur" + +///////////////////////////////////////////////////////////////////////////// +// +// RT_MANIFEST +// + +1 RT_MANIFEST "XPTheme.bin" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_TITLECAPTION "SystemInfo" + IDS_FILEVERSION "1.0.1.9" + IDS_APPCOPYRIGHT "Copyright © 2009 NetworkDLS. All rights reserved." +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Resources/XPTheme.bin b/Resources/XPTheme.bin new file mode 100644 index 0000000..9150e66 --- /dev/null +++ b/Resources/XPTheme.bin @@ -0,0 +1,22 @@ + + + + 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