Newer
Older
JumpListUtil / InjectAppUserModelId / dllmain.cpp
// dllmain.cpp : Defines the entry point for the DLL application.
#include "pch.h"
#include <Windows.h>
#include <Shobjidl.h>

HMODULE us;

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    us = hModule;
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

extern "C"
{
    __declspec(dllexport) DWORD DoWork(void* arg)
    {
        MessageBoxA(NULL, (char*)arg, "Injected Process", MB_OK);
        SetCurrentProcessExplicitAppUserModelID(L"TEST");
        FreeLibraryAndExitThread(us, 0);
        return 0;
    }
}