,,,
( )
2010 .
21 , 3 , 1 , 7 .
.
- , , , , ip , , , .
, .
, Microsoft Visual C++.
: , , , , , .
1.
1.1
2. Sysinfo
, . - - . , , ?
, , . , . , , N . .
++. . , .
++ - , , , . ++ . ++ . , ++, , .
, , , , ip , , , .
. Windows API. WIN32 ( WIN32s).
1.1
.
: GetWindowsDirectory - , GetSystemDirectory - GetCurrentDirectory - . - .
.
GetComputerName. - PChar, , . :
if (GetComputerName (temp, &cchBuff))
{
strcat (lpszSystemInfo, " : \t\t");
strcat (lpszSystemInfo, temp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
GetUserName:
if (GetUserName (temp, &cchBuff))
{
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, temp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
.
ExpandEnvironmentStrings, :
dwResult = ExpandEnvironmentStrings (
" OS: \t\t\t%OS%",
temp,
BUFSIZE);
.
API GlobalMemoryStatus. MEMORYSTATUS.
MemoryStatus , , , , :
void MemStat ()
{
MEMORYSTATUS stat;
GlobalMemoryStatus (&stat);
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0'; // .
char *tmp = new char [32];
strcat (lpszSystemInfo, " MemoryStatus \t\t\t");
itoa (stat. dwLength, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " ,% \t\t\t");
itoa (stat. dwMemoryLoad, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-3] = 13;
lpszSystemInfo [n_long-2] = 10;
strcat (lpszSystemInfo, " , Kb \t\t\t");
itoa (stat. dwTotalPhys/DIV, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " , Kb \t\t\t");
itoa (stat. dwAvailPhys/DIV, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " , Kb \t\t\t");
itoa (stat. dwTotalVirtual/DIV, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " , Kb \t");
itoa (stat. dwAvailVirtual/DIV, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
n_long = strlen (lpszSystemInfo);
for (a=0; a<n_long; a++)
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
.
GetSystemInfo SYSTEM_INFO . , TSystemInfo - wProcessorLevel. (), , , , revision , :
void CPUInfo ()
{
SYSTEM_INFO siSysInfo;
GetSystemInfo (&siSysInfo);
LPTSTR lpszSystemInfo = new char [4000]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0'; // .
char *tmp = new char [32];
strcat (lpszSystemInfo, " () \t");
itoa (siSysInfo. dwNumberOfProcessors, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " \t\t\t");
itoa (siSysInfo. dwProcessorType, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " \t\t");
itoa (siSysInfo. wProcessorArchitecture, tmp, 20);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, "Level \t\t\t");
itoa (siSysInfo. wProcessorLevel, tmp, 20);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, "Revision \t\t");
itoa (siSysInfo. wProcessorRevision, tmp, 20);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " \t\t");
itoa (siSysInfo. dwActiveProcessorMask, tmp, 20);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
n_long = strlen (lpszSystemInfo);
for (a=0; a<n_long; a++)
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
ip .
, , ip , GetCurentIP ().
void GetCurentIP ()
{
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0'; // .
char *tmp = new char [32];
WSADATA wsaData;
WORD WINSOCK_VERSION;
if (! WSAStartup (WINSOCK_VERSION, &wsaData))
{
char chInfo [64];
if (! gethostname (chInfo,sizeof (chInfo)))
{
strcat (lpszSystemInfo, " : \t\t");
strcat (lpszSystemInfo, chInfo);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
hostent *sh;
sh=gethostbyname ( (char*) &chInfo);
if (sh! =NULL)
{
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, sh->h_name);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
int nAdapter = 0;
while (sh->h_addr_list [nAdapter])
{
struct sockaddr_in adr;
memcpy (&adr. sin_addr,sh->h_addr_list [nAdapter],sh->h_length);
strcat (lpszSystemInfo, "IP : \t");
strcat (lpszSystemInfo, inet_ntoa (adr. sin_addr));
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
nAdapter++;
}
}
WSACleanup (); }
}
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
.
, PrinterInfo ().
void PrinterInfo ()
{
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0';
PRINTER_INFO_2 printinfo;
char pname [100];
char strpPrinterName [100], strpPortName [100], strpDriverName [100], strpPrintProcessor [100];
printinfo. pPrinterName = strpPrinterName;
printinfo. pPortName = strpPortName;
printinfo. pDriverName = strpDriverName;
printinfo. pPrintProcessor = strpPrintProcessor;
PRINTER_INFO_2 *Pr;
DWORD byteNeed = 0,prCount=0; // - ,
// NULL,
EnumPrinters (PRINTER_ENUM_CONNECTIONS|PRINTER_ENUM_LOCAL,NULL,2,NULL,0,&byteNeed,&prCount);
//
Pr = new PRINTER_INFO_2 [byteNeed];
//
if (EnumPrinters (PRINTER_ENUM_CONNECTIONS|PRINTER_ENUM_LOCAL,NULL,2, (LPBYTE) Pr,byteNeed,&byteNeed,&prCount))
{
for (int i = 0; i < prCount; ++i)
{
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, Pr [i]. pPrinterName);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " : \t\t");
strcat (lpszSystemInfo, Pr [i]. pPortName);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, Pr [i]. pDriverName);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, Pr [i]. pPrintProcessor);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
}
delete Pr;
}
.
, DxInfo ().
void DxInfo ()
{
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0';
char *tmp = new char [20];
GUID *lpGUID;
LPDIRECTDRAW lplpDD;
DirectDrawCreate (0,&lplpDD,NULL);
DDSURFACEDESC pDDS;
ZeroMemory (&pDDS, sizeof (DDSURFACEDESC));
pDDS. dwSize = sizeof (DDSURFACEDESC);
lplpDD->GetDisplayMode (&pDDS);
strcat (lpszSystemInfo, " : ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
lpszSystemInfo [n_long+2] = 13;
lpszSystemInfo [n_long+3] = 10;
itoa (pDDS. dwHeight, tmp,
10);
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. dwWidth, tmp,
10);
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. dwRefreshRate, tmp,
10);
strcat (lpszSystemInfo, " , : \t\t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. dwAlphaBitDepth, tmp,
10);
strcat (lpszSystemInfo, " - (/): \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. ddpfPixelFormat. dwRGBBitCount, tmp,
10);
strcat (lpszSystemInfo, " RGB (/): \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. ddpfPixelFormat. dwZBufferBitDepth, tmp,
10);
strcat (lpszSystemInfo, " Z- (/): \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. ddpfPixelFormat. dwAlphaBitDepth, tmp,
10);
strcat (lpszSystemInfo, " - (/): \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
.
, DrivesInfo ().
void DrivesInfo ()
{
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0';
char cDevices [] = "A: \\";
DWORD dwDevices = GetLogicalDrives (); //
bool flag = false;
for (int i = 0; dwDevices; i++) //
{
if (dwDevices & 1)
{
cDevices [0] = 'A' + i;
flag = true;
}
if (flag)
{
flag = false;
strcat (lpszSystemInfo, " ");
strcat (lpszSystemInfo, cDevices);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
UINT type = GetDriveType (cDevices);
switch (type)
{
case DRIVE_UNKNOWN:
strcat (lpszSystemInfo, " ");
break;
case DRIVE_NO_ROOT_DIR:
strcat (lpszSystemInfo, " ");
break;
case DRIVE_REMOVABLE:
strcat (lpszSystemInfo, " ");
break;
case DRIVE_FIXED:
strcat (lpszSystemInfo, " ");
break;
case DRIVE_REMOTE:
strcat (lpszSystemInfo, " network . ");
break;
case DRIVE_CDROM:
strcat (lpszSystemInfo, "CD-ROM ");
break;
case DRIVE_RAMDISK:
strcat (lpszSystemInfo, "RAM ");
break;
}
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
char VolumeNameBuffer [100];
VolumeNameBuffer [0] = '\0';
char FileSystemNameBuffer [100];
FileSystemNameBuffer [0] = '\0';
unsigned long VolumeSerialNumber;
BOOL GetVolumeInformationFlag = GetVolumeInformation (
cDevices,
VolumeNameBuffer,
100,&VolumeSerialNumber,
NULL, // &MaximumComponentLength,
NULL, // &FileSystemFlags,
FileSystemNameBuffer,
100
);
strcat (lpszSystemInfo, " : ");
strcat (lpszSystemInfo, VolumeNameBuffer);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
char *serial = new char [20];
serial [0] = '\0';
itoa (VolumeSerialNumber, serial,
10);
strcat (lpszSystemInfo, " : ");
strcat (lpszSystemInfo, serial);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
strcat (lpszSystemInfo, " : ");
strcat (lpszSystemInfo, FileSystemNameBuffer);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
if (type! = DRIVE_FIXED)
{
dwDevices >>= 1;
continue;
}
DWORD FreeBytesAvailable;
DWORD TotalNumberOfBytes;
DWORD TotalNumberOfFreeBytes;
BOOL GetDiskFreeSpaceFlag = GetDiskFreeSpaceEx (
cDevices, // directory name
(PULARGE_INTEGER) &FreeBytesAvailable, // bytes available to caller
(PULARGE_INTEGER) &TotalNumberOfBytes, // bytes on disk
(PULARGE_INTEGER) &TotalNumberOfFreeBytes // free bytes on disk
);
if (GetDiskFreeSpaceFlag! = FALSE)
{
char * free = new char [20];
itoa ( (unsigned long int) FreeBytesAvailable, free,
10);
char * total = new char [20];
itoa ( (unsigned long int) TotalNumberOfBytes, total,
10);
char * avaliable = new char [20];
itoa ( (unsigned long int) TotalNumberOfFreeBytes, avaliable,
10);
strcat (lpszSystemInfo, ": ");
strcat (lpszSystemInfo, free);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " : ");
strcat (lpszSystemInfo, total);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " ");
strcat (lpszSystemInfo, avaliable);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
}
dwDevices >>= 1;
}
SysInfo. exe. 3.1, , :
;
;
;
IP ;
;
;
.
.
3.1 -
Windows.
, , , , , .
, , .
, .
:
;
;
.
1. .. /C++. . : "", 2001. - 464.
2. .., .., .. Visual C++: "", 2002. - 721. - ( ).
3. .., .., .. : "", 1997. - 368.
4. http://msdn. microsoft.com/
5. http://intuit.ru/
6. http://windxp.ru/
7. 3008-95 "² в Ͳ. ".
main. cpp
#include <windows. h> // API
#include "resource. h"
#include "Index. h"
#include <fstream. h>
#include <ddraw. h>
#define Id_List 4002
// :
HINSTANCE hInst; //
LPCTSTR szWindowClass = "SysInfo";
LPCTSTR szTitle = " ";
LPCTSTR lpText = " \n: 1.0\n2009";
LPCTSTR lpCaption = " ";
HWND Listbox;
HWND StaticText;
HWND hWnd;
const int n_Count = 7;
Info Info_list [n_Count];
void Create_List ();
void Save ();
//
ATOM MyRegisterClass (HINSTANCE hInstance);
BOOL InitInstance (HINSTANCE, int);
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
//
int APIENTRY WinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG msg;
//
MyRegisterClass (hInstance);
//
if (! InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
//
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return msg. wParam;
}
// FUNCTION: MyRegisterClass ()
//
ATOM MyRegisterClass (HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex. cbSize = sizeof (WNDCLASSEX);
wcex. style= CS_HREDRAW | CS_VREDRAW; //
wcex. lpfnWndProc= (WNDPROC) WndProc; //
wcex. cbClsExtra= 0;
wcex. cbWndExtra= 0;
wcex. hInstance= hInstance; //
wcex. hIcon= LoadIcon (hInstance, MAKEINTRESOURCE (IDI_ICON1)); // -
wcex. hCursor= LoadCursor (NULL, IDC_ARROW); // -
wcex. hbrBackground= GetSysColorBrush (COLOR_BTNFACE); // -
wcex. lpszMenuName= (LPSTR) IDR_MENU1; //
wcex. lpszClassName= szWindowClass; //
wcex. hIconSm= NULL;
return RegisterClassEx (&wcex); //
}
// FUNCTION: InitInstance (HANDLE, int)
// hInst
BOOL InitInstance (HINSTANCE hInstance, int nCmdShow)
{
hInst = hInstance; // hInst
hWnd=CreateWindow (szWindowClass, //
szTitle, //
WS_OVERLAPPEDWINDOW, //
CW_USEDEFAULT, //
CW_USEDEFAULT, // Y
CW_USEDEFAULT, //
CW_USEDEFAULT, // Y
NULL, //
NULL, //
hInstance, //
NULL); // .
if (! hWnd) // , FALSE
{
return FALSE;
}
StaticText = CreateWindow ("edit", "", WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | WS_BORDER | ES_LEFT | ES_MULTILINE | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_READONLY, 0,0,0,0, hWnd, (HMENU) 4001, hInst, NULL);
Listbox = CreateWindow ("listbox", "", LBS_NOTIFY|WS_VSCROLL|WS_BORDER|WS_CHILD|WS_VISIBLE|WS_TABSTOP|LBS_DISABLENOSCROLL, 0,0,0,0, hWnd, (HMENU) 4002, hInst, NULL);
Create_List ();
ShowWindow (hWnd, nCmdShow); //
UpdateWindow (hWnd); //
return TRUE; //
}
// FUNCTION: WndProc (HWND, unsigned, WORD, LONG)
// . , -
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
RECT rt;
switch (message)
{
case WM_CREATE: //
break;
case WM_SIZE:
{
GetClientRect (hWnd, &rt);
int w = (rt. right-rt. left) /4;
MoveWindow (Listbox, rt. left, rt. top, w, rt. bottom-rt. top, TRUE);
MoveWindow (StaticText, rt. left+w, rt. top, w*3, rt. bottom-rt. top, TRUE);
}
break;
case WM_COMMAND:
{
switch (LOWORD (wParam))
{
case Id_List:
{
int Count = SendMessage (Listbox, LB_GETCURSEL, 0, 0);
if ( ( (Count>=0) && (Count<=n_Count)) && (HIWORD (wParam) ==LBN_SELCHANGE))
{
Info_list [Count]. function ();
}
}
break;
case ID_MENUITEM40001:
Save ();
break;
case ID_ABOUT:
MessageBox (hWnd,lpText,lpCaption,MB_OK);
break;
default:
return DefWindowProc (hWnd, message, wParam, lParam);
break;
}
}
break;
case WM_PAINT: //
hdc = BeginPaint (hWnd, &ps); //
GetClientRect (hWnd, &rt); //
EndPaint (hWnd, &ps); //
break;
case WM_DESTROY: //
PostQuitMessage (0);
break;
default:
// ,
return DefWindowProc (hWnd, message, wParam, lParam);
}
return DefWindowProc (hWnd, message, wParam, lParam);;
}
void Create_List ()
{
Info_list [0]. CreateInfo (" ", 0, & (SysInf));
Info_list [1]. CreateInfo (" ", 1, & (MemStat));
Info_list [2]. CreateInfo (" ", 1, & (CPUInfo));
Info_list [3]. CreateInfo ("IP ", 1, & (GetCurentIP));
Info_list [4]. CreateInfo (" ", 1, & (PrinterInfo));
Info_list [5]. CreateInfo (" ", 1, & (DxInfo));
Info_list [6]. CreateInfo (" ", 1, & (DrivesInfo));
}
void Save ()
{
char *adress = new char [_MAX_PATH];
OPENFILENAME of;
//
strcpy (adress,"SysInfo");
of. lStructSize=sizeof (OPENFILENAME);
of. hwndOwner=hWnd;
of. hInstance=hInst;
of. lpstrFilter="txt Files (*. txt) \0*. txt\0\0";
of. lpstrCustomFilter=NULL;
of. nMaxCustFilter=0;
of. nFilterIndex=0;
of. lpstrFile=adress;
of. nMaxFile=_MAX_PATH;
of. lpstrFileTitle=NULL;
of. nMaxFileTitle=_MAX_FNAME + _MAX_EXT;
of. lpstrInitialDir=NULL;
of. lpstrTitle=NULL;
of. Flags=OFN_OVERWRITEPROMPT;
of. nFileOffset=0;
of. nFileExtension=0;
of. lpstrDefExt="info";
of. lCustData=0L;
of. lpfnHook=NULL;
of. lpTemplateName=NULL;
if (GetSaveFileName (&of) ==TRUE)
{
strcpy (adress, of. lpstrFile);
ofstream fout (adress);
char *text = new char [4000];
GetWindowText (StaticText, text, 4000);
fout<<text;
fout. close ();
delete [] text;
}
}
Index. cpp
#include "Index. h"
#include <windows. h>
#define DIV 1024
extern HWND Listbox;
extern HWND StaticText;
extern HWND hWnd;
Info:: Info ()
{
Index = 0;
value = new char [50];
}
void Info:: CreateInfo (char* value, int Index, void (*function) ())
{
this->value = value;
this->Index = Index;
this->function = function;
SendMessage (Listbox, LB_ADDSTRING, NULL, (LPARAM) value);
}
void SysInf ()
{
char * lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0';
// .
DWORD cchBuff = 256; //
// .
DWORD dwResult; // .
// .
LPTSTR temp = new TCHAR [256];
if (GetComputerName (temp, &cchBuff))
{
strcat (lpszSystemInfo, " : \t\t");
strcat (lpszSystemInfo, temp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
// .
if (GetUserName (temp, &cchBuff))
{
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, temp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
// .
if (GetSystemDirectory (temp, MAX_PATH+1))
{
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, temp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
// Windows.
if (GetWindowsDirectory (temp, MAX_PATH+1))
{
strcat (lpszSystemInfo, " Windows: \t");
strcat (lpszSystemInfo, temp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
// OS.
dwResult = ExpandEnvironmentStrings (
" OS: \t\t\t%OS%",
temp,
BUFSIZE);
if (dwResult <= BUFSIZE)
{
strcat (lpszSystemInfo, temp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
dwResult = ExpandEnvironmentStrings (
" TEMP: \t\t%TEMP%",
temp,
BUFSIZE);
if (dwResult <= BUFSIZE)
{
strcat (lpszSystemInfo, temp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
void MemStat ()
{
MEMORYSTATUS stat;
GlobalMemoryStatus (&stat);
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0'; // .
char *tmp = new char [32];
strcat (lpszSystemInfo, " MemoryStatus \t\t\t");
itoa (stat. dwLength, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " ,% \t\t\t");
itoa (stat. dwMemoryLoad, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-3] = 13;
lpszSystemInfo [n_long-2] = 10;
strcat (lpszSystemInfo, " , Kb \t\t\t");
itoa (stat. dwTotalPhys/DIV, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " , Kb \t\t\t");
itoa (stat. dwAvailPhys/DIV, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " , Kb \t\t\t");
itoa (stat. dwTotalVirtual/DIV, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " , Kb \t");
itoa (stat. dwAvailVirtual/DIV, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
n_long = strlen (lpszSystemInfo);
for (a=0; a<n_long; a++)
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
void CPUInfo ()
{
SYSTEM_INFO siSysInfo;
GetSystemInfo (&siSysInfo);
LPTSTR lpszSystemInfo = new char [4000]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0'; // .
char *tmp = new char [32];
strcat (lpszSystemInfo, " () \t");
itoa (siSysInfo. dwNumberOfProcessors, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " \t\t\t");
itoa (siSysInfo. dwProcessorType, tmp,
10);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " \t\t");
itoa (siSysInfo. wProcessorArchitecture, tmp, 20);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, "Level \t\t\t");
itoa (siSysInfo. wProcessorLevel, tmp, 20);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, "Revision \t\t");
itoa (siSysInfo. wProcessorRevision, tmp, 20);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " \t\t");
itoa (siSysInfo. dwActiveProcessorMask, tmp, 20);
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
n_long = strlen (lpszSystemInfo);
for (a=0; a<n_long; a++)
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
void GetCurentIP ()
{
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0'; // .
char *tmp = new char [32];
WSADATA wsaData;
WORD WINSOCK_VERSION;
if (! WSAStartup (WINSOCK_VERSION, &wsaData))
{
char chInfo [64];
if (! gethostname (chInfo,sizeof (chInfo)))
{
strcat (lpszSystemInfo, " : \t\t");
strcat (lpszSystemInfo, chInfo);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
hostent *sh;
sh=gethostbyname ( (char*) &chInfo);
if (sh! =NULL)
{
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, sh->h_name);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
int nAdapter = 0;
while (sh->h_addr_list [nAdapter])
{
struct sockaddr_in adr;
memcpy (&adr. sin_addr,sh->h_addr_list [nAdapter],sh->h_length);
strcat (lpszSystemInfo, "IP : \t");
strcat (lpszSystemInfo, inet_ntoa (adr. sin_addr));
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
nAdapter++;
}
}
WSACleanup (); }
}
/*NCB SNcb; // NetBios
CHAR rc = 0; //
CHAR Status [256]; //
CHAR HostName [] ="SomeHost"; //
CHAR MAC [20]; // MAC-.
memset (&SNcb, 0, sizeof (SNcb));
SNcb. ncb_command = NCBRESET;
SNcb. ncb_lana_num = 0;
rc=Netbios (&SNcb); // NetBios
memset (&SNcb, 0, sizeof (NCB));
SNcb. ncb_command = NCBASTAT;
SNcb. ncb_buffer = (unsigned char*) Status;
SNcb. ncb_length = 256;
lstrcpy ( (char*) SNcb. ncb_callname, HostName);
SNcb. ncb_lana_num = 0; //
rc = Netbios (&SNcb);
if (rc==NRC_GOODRET) //
memcpy (MAC, Status,
6);
// itoa (MAC, tmp, 20);
strcat (lpszSystemInfo, Status);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10; */
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
void PrinterInfo ()
{
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0';
PRINTER_INFO_2 printinfo;
char pname [100];
char strpPrinterName [100], strpPortName [100], strpDriverName [100], strpPrintProcessor [100];
printinfo. pPrinterName = strpPrinterName;
printinfo. pPortName = strpPortName;
printinfo. pDriverName = strpDriverName;
printinfo. pPrintProcessor = strpPrintProcessor;
PRINTER_INFO_2 *Pr;
DWORD byteNeed = 0,prCount=0; // - ,
// NULL,
EnumPrinters (PRINTER_ENUM_CONNECTIONS|PRINTER_ENUM_LOCAL,NULL,2,NULL,0,&byteNeed,&prCount);
//
Pr = new PRINTER_INFO_2 [byteNeed];
//
if (EnumPrinters (PRINTER_ENUM_CONNECTIONS|PRINTER_ENUM_LOCAL,NULL,2, (LPBYTE) Pr,byteNeed,&byteNeed,&prCount))
{
for (int i = 0; i < prCount; ++i)
{
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, Pr [i]. pPrinterName);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " : \t\t");
strcat (lpszSystemInfo, Pr [i]. pPortName);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, Pr [i]. pDriverName);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, Pr [i]. pPrintProcessor);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
}
delete Pr;
}
void DxInfo ()
{
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0';
char *tmp = new char [20];
GUID *lpGUID;
LPDIRECTDRAW lplpDD;
DirectDrawCreate (0,&lplpDD,NULL);
DDSURFACEDESC pDDS;
ZeroMemory (&pDDS, sizeof (DDSURFACEDESC));
pDDS. dwSize = sizeof (DDSURFACEDESC);
lplpDD->GetDisplayMode (&pDDS);
strcat (lpszSystemInfo, " : ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
lpszSystemInfo [n_long+2] = 13;
lpszSystemInfo [n_long+3] = 10;
itoa (pDDS. dwHeight, tmp,
10);
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. dwWidth, tmp,
10);
strcat (lpszSystemInfo, " : \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. dwRefreshRate, tmp,
10);
strcat (lpszSystemInfo, " , : \t\t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. dwAlphaBitDepth, tmp,
10);
strcat (lpszSystemInfo, " - (/): \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. ddpfPixelFormat. dwRGBBitCount, tmp,
10);
strcat (lpszSystemInfo, " RGB (/): \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. ddpfPixelFormat. dwZBufferBitDepth, tmp,
10);
strcat (lpszSystemInfo, " Z- (/): \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
itoa (pDDS. ddpfPixelFormat. dwAlphaBitDepth, tmp,
10);
strcat (lpszSystemInfo, " - (/): \t");
strcat (lpszSystemInfo, tmp);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
void DrivesInfo ()
{
LPTSTR lpszSystemInfo = new char [BUFSIZE]; // ,
for (int a=0; a<BUFSIZE; a++)
lpszSystemInfo [a] = '\0';
char cDevices [] = "A: \\";
DWORD dwDevices = GetLogicalDrives (); //
bool flag = false;
for (int i = 0; dwDevices; i++) //
{
if (dwDevices & 1)
{
cDevices [0] = 'A' + i;
flag = true;
}
if (flag)
{
flag = false;
strcat (lpszSystemInfo, " ");
strcat (lpszSystemInfo, cDevices);
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
UINT type = GetDriveType (cDevices);
switch (type)
{
case DRIVE_UNKNOWN:
strcat (lpszSystemInfo, " ");
break;
case DRIVE_NO_ROOT_DIR:
strcat (lpszSystemInfo, " ");
break;
case DRIVE_REMOVABLE:
strcat (lpszSystemInfo, " ");
break;
case DRIVE_FIXED:
strcat (lpszSystemInfo, " ");
break;
case DRIVE_REMOTE:
strcat (lpszSystemInfo, " network . ");
break;
case DRIVE_CDROM:
strcat (lpszSystemInfo, "CD-ROM ");
break;
case DRIVE_RAMDISK:
strcat (lpszSystemInfo, "RAM ");
break;
}
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
/***********************************************************/
char VolumeNameBuffer [100];
VolumeNameBuffer [0] = '\0';
char FileSystemNameBuffer [100];
FileSystemNameBuffer [0] = '\0';
unsigned long VolumeSerialNumber;
BOOL GetVolumeInformationFlag = GetVolumeInformation (
cDevices,
VolumeNameBuffer,
100,&VolumeSerialNumber,
NULL, // &MaximumComponentLength,
NULL, // &FileSystemFlags,
FileSystemNameBuffer,
100
);
strcat (lpszSystemInfo, " : ");
strcat (lpszSystemInfo, VolumeNameBuffer);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
char *serial = new char [20];
serial [0] = '\0';
itoa (VolumeSerialNumber, serial,
10);
strcat (lpszSystemInfo, " : ");
strcat (lpszSystemInfo, serial);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
strcat (lpszSystemInfo, " : ");
strcat (lpszSystemInfo, FileSystemNameBuffer);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long] = 13;
lpszSystemInfo [n_long+1] = 10;
/***********************************************************/
if (type! = DRIVE_FIXED)
{
dwDevices >>= 1;
continue;
}
DWORD FreeBytesAvailable;
DWORD TotalNumberOfBytes;
DWORD TotalNumberOfFreeBytes;
BOOL GetDiskFreeSpaceFlag = GetDiskFreeSpaceEx (
cDevices, // directory name
(PULARGE_INTEGER) &FreeBytesAvailable, // bytes available to caller
(PULARGE_INTEGER) &TotalNumberOfBytes, // bytes on disk
(PULARGE_INTEGER) &TotalNumberOfFreeBytes // free bytes on disk
);
if (GetDiskFreeSpaceFlag! = FALSE)
{
char * free = new char [20];
itoa ( (unsigned long int) FreeBytesAvailable, free,
10);
char * total = new char [20];
itoa ( (unsigned long int) TotalNumberOfBytes, total,
10);
char * avaliable = new char [20];
itoa ( (unsigned long int) TotalNumberOfFreeBytes, avaliable,
10);
strcat (lpszSystemInfo, ": ");
strcat (lpszSystemInfo, free);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " : ");
strcat (lpszSystemInfo, total);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
strcat (lpszSystemInfo, " ");
strcat (lpszSystemInfo, avaliable);
strcat (lpszSystemInfo, " ");
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
}
}
dwDevices >>= 1;
}
strcat (lpszSystemInfo, " ");
int n_long = strlen (lpszSystemInfo);
lpszSystemInfo [n_long-2] = 13;
lpszSystemInfo [n_long-1] = 10;
SendMessage (StaticText, WM_SETTEXT, 0, (LPARAM) lpszSystemInfo);
}
Index. h
#pragma once
#include <ddraw. h>
#define BUFSIZE 1024
void SysInf ();
void MemStat ();
void CPUInfo ();
void GetCurentIP ();
void PrinterInfo ();
void DxInfo ();
void DrivesInfo ();
class Info
{
public:
Info ();
void CreateInfo (char* value, int Index, void (*function) ());
void (*function) ();
private:
int Index;
char *value;
};
Copyright (c) 2024 Stud-Baza.ru , , , .