summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/miranda.cpp17
3 files changed, 7 insertions, 12 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 2820883800..b44be34fa0 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -3,6 +3,7 @@ LIBRARY mir_app.mir
EXPORTS
Miranda_Close @1 NONAME
CallProtoService @2
+Miranda_SetIdleCallback @3 NONAME
Skin_LoadProtoIcon @4
Skin_LoadIcon @5
Button_FreeIcon_IcoLib @6
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 6ed7f2a46a..a41e448502 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -3,6 +3,7 @@ LIBRARY mir_app.mir
EXPORTS
Miranda_Close @1 NONAME
CallProtoService @2
+Miranda_SetIdleCallback @3 NONAME
Skin_LoadProtoIcon @4
Skin_LoadIcon @5
Button_FreeIcon_IcoLib @6
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp
index 214a196012..8441e0ceea 100644
--- a/src/mir_app/src/miranda.cpp
+++ b/src/mir_app/src/miranda.cpp
@@ -173,15 +173,11 @@ static void __cdecl compactHeapsThread(void*)
}
}
-void(*SetIdleCallback) (void) = nullptr;
+void (*SetIdleCallback)(void) = nullptr;
-static INT_PTR SystemSetIdleCallback(WPARAM, LPARAM lParam)
+MIR_APP_DLL(void) Miranda_SetIdleCallback(void(__cdecl *pfnCallback)(void))
{
- if (lParam && SetIdleCallback == nullptr) {
- SetIdleCallback = (void(*)(void))lParam;
- return 1;
- }
- return 0;
+ SetIdleCallback = pfnCallback;
}
static DWORD dwEventTime = 0;
@@ -195,10 +191,9 @@ void checkIdle(MSG * msg)
}
}
-static INT_PTR SystemGetIdle(WPARAM, LPARAM lParam)
+MIR_APP_DLL(DWORD) Miranda_GetIdle()
{
- if (lParam) *(DWORD*)lParam = dwEventTime;
- return 0;
+ return dwEventTime;
}
static int SystemShutdownProc(WPARAM, LPARAM)
@@ -346,8 +341,6 @@ int WINAPI mir_main(LPTSTR cmdLine)
HookEvent(ME_SYSTEM_SHUTDOWN, SystemShutdownProc);
mir_forkthread(compactHeapsThread);
- CreateServiceFunction(MS_SYSTEM_SETIDLECALLBACK, SystemSetIdleCallback);
- CreateServiceFunction(MS_SYSTEM_GETIDLE, SystemGetIdle);
dwEventTime = GetTickCount();
DWORD myPid = GetCurrentProcessId();