Created
May 28, 2023 10:46
-
-
Save puppis42/8839bdaea935d9f3db73d5f93c38380c to your computer and use it in GitHub Desktop.
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
// dllmain.cpp : Defines the entry point for the DLL application. | |
#include "pch.h" | |
#include <shellapi.h> | |
void Test() { | |
LPWSTR pwszCommandLine = GetCommandLine(); | |
LPWSTR* argv = NULL; | |
LPWSTR g_pwszGuid = NULL; | |
HANDLE hEvent = NULL; | |
int argc = 0; | |
int i = 0; | |
WCHAR wszEventName[MAX_PATH] = { 0 }; | |
argv = CommandLineToArgvW(pwszCommandLine, &argc); | |
g_pwszGuid = argv[1]; | |
MessageBox(NULL, g_pwszGuid, L"caption", 0); | |
} | |
BOOL APIENTRY DllMain( HMODULE hModule, | |
DWORD ul_reason_for_call, | |
LPVOID lpReserved | |
) | |
{ | |
switch (ul_reason_for_call) | |
{ | |
case DLL_PROCESS_ATTACH: | |
Test(); | |
case DLL_THREAD_ATTACH: | |
case DLL_THREAD_DETACH: | |
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