2018-09-14 20:07:55 +02:00
|
|
|
|
/*
|
|
|
|
|
* System Monitor
|
2020-05-10 03:44:40 +02:00
|
|
|
|
* version 1.0
|
2018-09-14 20:07:55 +02:00
|
|
|
|
* Author: Leency
|
|
|
|
|
*/
|
|
|
|
|
|
2019-03-18 23:31:13 +01:00
|
|
|
|
#define MEMSIZE 4096*30
|
|
|
|
|
|
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// LIB //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
2018-09-14 20:07:55 +02:00
|
|
|
|
|
|
|
|
|
#include "../lib/io.h"
|
|
|
|
|
#include "../lib/gui.h"
|
2018-09-15 12:48:42 +02:00
|
|
|
|
#include "../lib/fs.h"
|
2019-03-18 23:31:13 +01:00
|
|
|
|
#include "../lib/list_box.h"
|
2018-09-14 20:07:55 +02:00
|
|
|
|
|
|
|
|
|
#include "../lib/obj/libio.h"
|
|
|
|
|
#include "../lib/obj/libimg.h"
|
|
|
|
|
#include "../lib/obj/libini.h"
|
2019-03-18 23:31:13 +01:00
|
|
|
|
#include "../lib/obj/box_lib.h"
|
|
|
|
|
|
|
|
|
|
#include "../lib/patterns/select_list.h"
|
|
|
|
|
#include "../lib/patterns/restart_process.h"
|
2018-09-14 20:07:55 +02:00
|
|
|
|
|
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// DATA //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
|
|
|
|
|
2019-03-18 23:31:13 +01:00
|
|
|
|
#define WIN_PAD 20 //Window padding
|
|
|
|
|
#define WIN_CONTENT_X WIN_PAD
|
2020-05-10 03:44:40 +02:00
|
|
|
|
#define WIN_CONTENT_Y TAB_HEIGHT+WIN_PAD+20
|
2019-03-18 23:31:13 +01:00
|
|
|
|
#define WIN_CONTENT_W 400
|
|
|
|
|
#define WIN_CONTENT_H 465
|
2020-05-10 03:44:40 +02:00
|
|
|
|
#define ICONGAP 26
|
2020-05-10 14:49:02 +02:00
|
|
|
|
#define BASE_TAB_BUTTON_ID 10
|
2019-03-18 23:31:13 +01:00
|
|
|
|
proc_info Form;
|
2018-09-14 20:07:55 +02:00
|
|
|
|
|
2020-05-10 03:44:40 +02:00
|
|
|
|
#ifdef LANG_RUS
|
|
|
|
|
#define T_CPU_AND_RAM "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>"
|
|
|
|
|
#define T_DRIVES "<22><>᪨"
|
|
|
|
|
#define T_PROCESSES "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
#define T_APP_TITLE "System Monitor"
|
|
|
|
|
#else
|
|
|
|
|
#define T_CPU_AND_RAM "CPU & RAM"
|
|
|
|
|
#define T_DRIVES "Drives"
|
2019-03-18 23:31:13 +01:00
|
|
|
|
#define T_PROCESSES "Processes"
|
2020-05-10 03:44:40 +02:00
|
|
|
|
#define T_APP_TITLE "System Monitor"
|
|
|
|
|
#endif
|
2018-09-15 12:48:42 +02:00
|
|
|
|
|
2020-05-10 14:49:02 +02:00
|
|
|
|
_tabs tabs = { 4, 10, WIN_CONTENT_W+WIN_PAD+WIN_PAD-4-4, BASE_TAB_BUTTON_ID };
|
2020-05-10 03:44:40 +02:00
|
|
|
|
|
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// GENERAL EVENTS //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
2018-09-14 20:07:55 +02:00
|
|
|
|
|
2019-03-18 23:31:13 +01:00
|
|
|
|
int Sysmon__DefineAndDrawWindow()
|
2018-09-15 12:48:42 +02:00
|
|
|
|
{
|
2020-05-10 03:44:40 +02:00
|
|
|
|
dword butx;
|
2020-04-18 01:52:24 +02:00
|
|
|
|
sc.get();
|
2019-03-18 23:31:13 +01:00
|
|
|
|
DefineAndDrawWindow(screen.width - WIN_CONTENT_H - 200, 100, WIN_CONTENT_W + WIN_PAD + WIN_PAD +9,
|
2020-05-10 03:44:40 +02:00
|
|
|
|
WIN_CONTENT_H + TAB_HEIGHT + skin_height + 4, 0x34, sc.work, T_APP_TITLE,0);
|
2019-03-18 23:31:13 +01:00
|
|
|
|
GetProcessInfo(#Form, SelfInfo);
|
|
|
|
|
if (Form.status_window>2) return false;
|
|
|
|
|
//if (Form.width < 300) { MoveSize(OLD,OLD,300,OLD); break; }
|
|
|
|
|
//if (Form.height < 200) { MoveSize(OLD,OLD,OLD,200); break; }
|
2020-05-10 14:49:02 +02:00
|
|
|
|
tabs.draw();
|
2019-03-18 23:31:13 +01:00
|
|
|
|
return true;
|
2018-09-15 12:48:42 +02:00
|
|
|
|
}
|
|
|
|
|
|
2020-05-10 03:44:40 +02:00
|
|
|
|
int Sysmon__ButtonEvent()
|
2018-09-14 20:07:55 +02:00
|
|
|
|
{
|
2020-05-10 03:44:40 +02:00
|
|
|
|
int bid = GetButtonID();
|
|
|
|
|
if (1==bid) ExitProcess();
|
2020-05-10 14:49:02 +02:00
|
|
|
|
tabs.click();
|
2020-05-10 03:44:40 +02:00
|
|
|
|
return bid;
|
2018-09-14 20:07:55 +02:00
|
|
|
|
}
|
2019-03-18 23:31:13 +01:00
|
|
|
|
|
2020-05-10 03:44:40 +02:00
|
|
|
|
void Sysmon__KeyEvent()
|
|
|
|
|
{
|
|
|
|
|
GetKeys();
|
|
|
|
|
if (key_scancode == SCAN_CODE_ESC) ExitProcess();
|
|
|
|
|
}
|
2019-03-18 23:31:13 +01:00
|
|
|
|
|
2020-05-10 03:44:40 +02:00
|
|
|
|
#include "cpu_ram.h"
|
|
|
|
|
#include "drives.h"
|
|
|
|
|
#include "process.h"
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
load_dll(libio, #libio_init,1);
|
|
|
|
|
load_dll(libimg, #libimg_init,1);
|
|
|
|
|
load_dll(libini, #lib_init,1);
|
|
|
|
|
load_dll(boxlib, #box_lib_init,0);
|
2020-05-10 14:49:02 +02:00
|
|
|
|
|
|
|
|
|
tabs.add(T_CPU_AND_RAM, #CPUnRAM__Main);
|
|
|
|
|
tabs.add(T_DRIVES, #Drives__Main);
|
|
|
|
|
tabs.add(T_PROCESSES, #Processes__Main);
|
|
|
|
|
|
2020-05-10 03:44:40 +02:00
|
|
|
|
CPUnRAM__Main();
|
|
|
|
|
}
|