diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-07-16 20:08:30 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-07-16 20:08:30 +0000 |
commit | 74e738f374f759723daf8920677158712d0ca5c1 (patch) | |
tree | 89a93d70f87e950e28d23466d3c84120ead0e770 /plugins/Actman30/tasks/i_service.inc | |
parent | e5c9c0077f7b50bbfe90201154c31c13e1a6fc63 (diff) |
- Actman 3 added (not adopted)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5391 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Actman30/tasks/i_service.inc')
-rw-r--r-- | plugins/Actman30/tasks/i_service.inc | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/plugins/Actman30/tasks/i_service.inc b/plugins/Actman30/tasks/i_service.inc new file mode 100644 index 0000000000..376e75cba0 --- /dev/null +++ b/plugins/Actman30/tasks/i_service.inc @@ -0,0 +1,87 @@ +{}
+// wParam: 1/0 (enable/disable), lParam = task name
+// works for all tasks with same started name
+function TaskEnable(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ i,j:integer;
+begin
+ result:=0;
+ if lParam=0 then exit;
+ j:=StrLenW(pWideChar(lParam));
+
+ for i:=0 to MaxTasks-1 do
+ begin
+ if (TaskList[i].flags and ACF_ASSIGNED)<>0 then
+ begin
+ if StrCmpW(TaskList[i].name,pWideChar(lParam),j)=0 then
+ begin
+ if wParam=0 then // disable
+ begin
+ if (TaskList[i].flags and ACF_DISABLED)=0 then
+ begin
+ inc(result);
+ TaskList[i].flags:=TaskList[i].flags or ACF_DISABLED;
+ if TaskList[i].timer<>0 then
+ begin
+ KillTimer(0,TaskList[i].timer);
+ TaskList[i].timer:=0;
+ end;
+ end;
+ end
+ else
+ begin
+ if (TaskList[i].flags and ACF_DISABLED)<>0 then
+ begin
+ inc(result);
+ TaskList[i].flags:=TaskList[i].flags and not ACF_DISABLED;
+ SetTask(TaskList[i]);
+ end;
+ end;
+ end;
+ end;
+ end;
+end;
+
+function TaskDelete(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ i,j:integer;
+begin
+ result:=0;
+ if lParam=0 then exit;
+ j:=StrLenW(pWideChar(lParam));
+
+ for i:=0 to MaxTasks-1 do
+ begin
+ if (TaskList[i].flags and ACF_ASSIGNED)<>0 then
+ begin
+ if StrCmpW(TaskList[i].name,pWideChar(lParam),j)=0 then
+ begin
+ TaskList[i].flags:=TaskList[i].flags and not ACF_ASSIGNED;
+ end;
+ end;
+ end;
+end;
+
+function TaskCount(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ i,j:integer;
+begin
+ result:=0;
+ if lParam=0 then exit;
+ j:=StrLenW(pWideChar(lParam));
+
+ for i:=0 to MaxTasks-1 do
+ begin
+ with TaskList[i] do
+ begin
+ if (flags and ACF_ASSIGNED)<>0 then
+ begin
+ if StrCmpW(name,pWideChar(lParam),j)=0 then
+ begin
+ result:=count;
+ count:=wParam;
+ end;
+ end;
+ end;
+ end;
+end;
|