Created
October 11, 2023 09:04
-
-
Save caueb/5be3d374cdf11081e02dcb208de2cd78 to your computer and use it in GitHub Desktop.
DLL/CPL Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the project as DLL, compile it, and just rename it file.cpl | |
// Simply double click in the file to run | |
#include <Windows.h> | |
__declspec(dllexport) LONG CALLBACK CPlApplet(HWND hwndCpl, UINT msg, LPARAM lParam1, LPARAM lParam2) { | |
MessageBoxA(NULL, "Test", "Caption", MB_OK); | |
return 1; | |
} | |
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { | |
switch (ul_reason_for_call) { | |
case DLL_PROCESS_ATTACH: | |
CPlApplet(NULL, NULL, NULL, NULL); | |
break; | |
case DLL_THREAD_ATTACH: | |
break; | |
case DLL_THREAD_DETACH: | |
break; | |
case DLL_PROCESS_DETACH: | |
break; | |
} | |
return TRUE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment