2018-09-14 20:07:55 +02:00
|
|
|
/*
|
|
|
|
* System Monitor
|
2018-10-01 18:41:14 +02:00
|
|
|
* version 0.87
|
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
|
|
|
|
#define WIN_CONTENT_Y TAB_HEIGHT+WIN_PAD
|
|
|
|
#define WIN_CONTENT_W 400
|
|
|
|
#define WIN_CONTENT_H 465
|
|
|
|
proc_info Form;
|
2018-09-14 20:07:55 +02:00
|
|
|
|
2019-03-18 23:31:13 +01:00
|
|
|
#include "general.h"
|
|
|
|
#include "process.h"
|
2018-09-14 20:07:55 +02:00
|
|
|
|
2019-03-18 23:31:13 +01:00
|
|
|
#define T_GENERAL "General"
|
|
|
|
#define T_PROCESSES "Processes"
|
2018-09-15 12:48:42 +02:00
|
|
|
|
2019-03-18 23:31:13 +01:00
|
|
|
enum {
|
|
|
|
TAB_GENERAL=20,
|
|
|
|
TAB_PROCESSES
|
|
|
|
};
|
|
|
|
_tabs tabs = { TAB_GENERAL, 4, 0, WIN_CONTENT_W+WIN_PAD+WIN_PAD-4-4, TAB_HEIGHT };
|
2018-09-14 20:07:55 +02:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
load_dll(libio, #libio_init,1);
|
|
|
|
load_dll(libimg, #libimg_init,1);
|
|
|
|
load_dll(libini, #lib_init,1);
|
2019-03-18 23:31:13 +01:00
|
|
|
load_dll(boxlib, #box_lib_init,0);
|
|
|
|
General__Main();
|
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-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-04-18 01:52:24 +02:00
|
|
|
WIN_CONTENT_H + TAB_HEIGHT + skin_height + 4, 0x34, sc.work, "System Monitor",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; }
|
|
|
|
tabs.draw_wrapper();
|
|
|
|
tabs.draw_button(tabs.x+TAB_PADDING, TAB_GENERAL, T_GENERAL);
|
|
|
|
tabs.draw_button(strlen(T_GENERAL)*8+tabs.x+TAB_PADDING+TAB_PADDING, TAB_PROCESSES, T_PROCESSES);
|
|
|
|
return true;
|
2018-09-15 12:48:42 +02:00
|
|
|
}
|
|
|
|
|
2018-09-14 20:07:55 +02:00
|
|
|
//===================================================//
|
|
|
|
// //
|
2019-03-18 23:31:13 +01:00
|
|
|
// EVENTS //
|
2018-09-14 20:07:55 +02:00
|
|
|
// //
|
|
|
|
//===================================================//
|
|
|
|
|
2019-03-18 23:31:13 +01:00
|
|
|
void Sysmon__ButtonEvent(dword id)
|
2018-09-14 20:07:55 +02:00
|
|
|
{
|
2019-03-18 23:31:13 +01:00
|
|
|
if (1==id) ExitProcess();
|
|
|
|
if (TAB_GENERAL==id) {
|
|
|
|
tabs.active_tab = TAB_GENERAL;
|
|
|
|
General__Main();
|
2018-09-14 20:07:55 +02:00
|
|
|
}
|
2019-03-18 23:31:13 +01:00
|
|
|
if (TAB_PROCESSES==id) {
|
|
|
|
tabs.active_tab = TAB_PROCESSES;
|
|
|
|
Processes__Main();
|
2018-09-14 20:07:55 +02:00
|
|
|
}
|
|
|
|
}
|
2019-03-18 23:31:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
stop:
|