Skip to content

Instantly share code, notes, and snippets.

@caueb
Created October 11, 2023 09:04
Show Gist options
  • Save caueb/5be3d374cdf11081e02dcb208de2cd78 to your computer and use it in GitHub Desktop.
Save caueb/5be3d374cdf11081e02dcb208de2cd78 to your computer and use it in GitHub Desktop.
DLL/CPL Template
// 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