2019-09-05 00:26:26 +08:00
|
|
|
// dllmain.cpp : Defines the entry point for the DLL application.
|
|
|
|
#include "pch.h"
|
|
|
|
#include <mutex>
|
|
|
|
#include "shortcut_guide.h"
|
|
|
|
#include "overlay_window.h"
|
|
|
|
#include "trace.h"
|
|
|
|
|
2019-12-06 19:07:54 +08:00
|
|
|
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
|
|
|
{
|
|
|
|
switch (ul_reason_for_call)
|
|
|
|
{
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
Trace::RegisterProvider();
|
|
|
|
break;
|
|
|
|
case DLL_THREAD_ATTACH:
|
|
|
|
case DLL_THREAD_DETACH:
|
|
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
Trace::UnregisterProvider();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
2019-09-05 00:26:26 +08:00
|
|
|
}
|
|
|
|
|
2019-12-06 19:07:54 +08:00
|
|
|
extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create()
|
|
|
|
{
|
|
|
|
if (!instance)
|
|
|
|
{
|
|
|
|
instance = new OverlayWindow();
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
2019-09-05 00:26:26 +08:00
|
|
|
}
|