#define MEMSIZE 1024*80 //===================================================// // // // LIB // // // //===================================================// #include "../lib/gui.h" #include "../lib/list_box.h" #include "../lib/collection.h" #include "../lib/patterns/restart_process.h" #include "../lib/mem.h" #include "../lib/obj/libini.h" //===================================================// // // // DATA // // // //===================================================// int current_process_id = 0; int proc_list[256]; collection attached=0; llist list; _ini ini = { "/sys/settings/appicons.ini", "icons"}; proc_info Form; proc_info Process; enum { ATTACHEMENT_BOTTOM, ATTACHEMENT_LEFT, ATTACHEMENT_TOP, ATTACHEMENT_RIGHT }; int attachement = ATTACHEMENT_BOTTOM; #define CELLW 40 #define CELLH 40 dword COLOR_BG = 0x3B3B3B; dword COLOR_MENU_BG = 0x323232; dword COLOR_OPENED = 0x999999; dword COLOR_ACTIVE = 0x0099FF; dword COLOR_TEXT = 0xFFFfff; //===================================================// // // // CODE // // // //===================================================// void main() { int btn; load_dll(libini, #lib_init,1); ini_get_int stdcall ("/sys/appicons.ini", "taskbar", "attachement", ATTACHEMENT_BOTTOM); attachement = EAX; SetAttachement(); GetAttachedItems(); GetProcessInfo(#Form, SelfInfo); SetWindowLayerBehaviour(-1, ZPOS_DESKTOP); SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); loop() switch(@WaitEventTimeout(50)) { case evMouse: if (!CheckActiveProcess(Form.ID)) break; mouse.get(); if (mouse.down) {} //if (list.ProcessMouse()) DrawProcessList(); break; case evKey: GetKeys(); if (key_scancode == SCAN_CODE_ESC) { RunProgram(#program_path, NULL); ExitProcess(); } break; case evButton: btn = @GetButtonID(); btn -= 100; if (btn < attached.count) RunProgram(attached.get(btn), NULL); else EventSetActiveProcess(btn); break; case evReDraw: DefineUnDragableWindow(NULL, NULL, NULL, NULL); list.SetSizes(0, 0, Form.width+1, Form.height+2, CELLH); default: DrawProcessList(); } } void GetProcessList() { int i, j; list.count=0; for (i=0; i