I'm pretty new to this stuff, so please excuse me if anything I ask is kinda stupid.I'm trying to inject a DLL into a QT application and call some of the QT functions. I got the injection working with notepad.exe or explorer.exe, but everything else I tried (Spotify, some QT apps, skype, ...) wont show my messagebox, although the injection intself doesn't throw any errors.Here's the code of my injector program:#include stdafx.h#include windows.h#include <iostream>using namespace std;char const path[] = C:\\InjectedDll.dll;void setDebugPrivilege(){    HANDLE hToken;    TOKEN_PRIVILEGES privileges;    privileges.PrivilegeCount = 1;    privileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;    if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))    {        std::cout << Failed to open process. << std::endl;    }    if (!LookupPrivilegeValue(0, SE_DEBUG_NAME, &privileges.Privileges[0].Luid))    {        std::cout << Failed to look up privileges. << std::endl;    }    if (!AdjustTokenPrivileges(hToken, false, &privileges, sizeof(privileges), 0, 0))    {        std::cout << Failed to adjust token privileges. << std::endl;    }    CloseHandle(hToken);}int main(int argc, char* argv){    setDebugPrivilege();    HWND hWnd;    hWnd = FindWindowA(0, Spotify);    if (!hWnd) {        std::cout << Could not find editor window. << std::endl;    }    DWORD pId;    GetWindowThreadProcessId(hWnd, &pId);    if (!pId) {        std::cout << Could not find process id. << std::endl;    }    HANDLE hProcess;    hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pId);    if (!hProcess) {        std::cout << Failed to open process. << std::endl;    }    HANDLE allocatedAddress;    allocatedAddress = VirtualAllocEx(hProcess, 0, sizeof(path), MEM_COMMIT, PAGE_EXECUTE_READWRITE);    WriteProcessMemory(hProcess, (void*)allocatedAddress, (void*)path, sizeof(path), 0);    HANDLE hRemoteThread;    hRemoteThread = CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA(kernel32.dll), LoadLibraryA), allocatedAddress, 0, 0);    if (!hRemoteThread) {        std::cout << Failed to create remote thread:  << GetLastError() << std::endl;    }    WaitForSingleObject(hRemoteThread, INFINITE);    VirtualFreeEx(hProcess, allocatedAddress, sizeof(path), MEM_DECOMMIT);    CloseHandle(hProcess);    system(Pause);    return 0;}And here is my basic DLL.h:#pragma once#include windows.h#ifdef INJECTEDDLL_EXPORTS    #define INJECTED_DLL_API __declspec(dllexport)#else    #define INJECTED_DLL_API __declspec(dllimport)#endifINJECTED_DLL_API LRESULT CALLBACK newWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);INJECTED_DLL_API DWORD WINAPI creation();INJECTED_DLL_API int WINAPI DllMain(HINSTANCE hInstance, DWORD reason, LPVOID reserved);And DLL.cpp:#include injected_dll.hDWORD WINAPI creation(){    MessageBoxW(HWND_DESKTOP, LFailed to subclass window., LNoez!, MB_OK);    return TRUE;}int WINAPI DllMain(HINSTANCE hInstance, DWORD reason, LPVOID reserved){    if (reason == DLL_PROCESS_ATTACH)    {        CreateThread(0, 0, (LPTHREAD_START_ROUTINE)creation, 0, 0, 0);    }    return true;}So can anyone tell me why this isn't working? I tried both, using MessageBoxA(..) and MessageBoxW(..) and just MessageBox(..), they all worked on notepad.exe, but none worked on the other programs.
Dll Injection into QT application
dll injection;qt