diff --git a/DDrawCompat/Gdi/GuiThread.cpp b/DDrawCompat/Gdi/GuiThread.cpp index ef42928..e17aff8 100644 --- a/DDrawCompat/Gdi/GuiThread.cpp +++ b/DDrawCompat/Gdi/GuiThread.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -61,6 +62,7 @@ namespace unsigned WINAPI messageWindowThreadProc(LPVOID /*lpParameter*/) { ImmDisableIME(0); + CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); WNDCLASS wc = {}; wc.lpfnWndProc = &messageWindowProc; @@ -126,6 +128,21 @@ namespace Gdi return hwnd; } + void deleteTaskbarTab(HWND hwnd) + { + execute([&]() + { + ITaskbarList* taskbarList = nullptr; + if (SUCCEEDED(CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, IID_ITaskbarList, + reinterpret_cast(&taskbarList)))) + { + taskbarList->lpVtbl->HrInit(taskbarList); + taskbarList->lpVtbl->DeleteTab(taskbarList, hwnd); + taskbarList->lpVtbl->Release(taskbarList); + } + }); + } + void destroyWindow(HWND hwnd) { execute([&]() { DestroyWindow(hwnd); }); diff --git a/DDrawCompat/Gdi/GuiThread.h b/DDrawCompat/Gdi/GuiThread.h index cd9c02a..1d33c02 100644 --- a/DDrawCompat/Gdi/GuiThread.h +++ b/DDrawCompat/Gdi/GuiThread.h @@ -17,6 +17,7 @@ namespace Gdi { HWND createWindow(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam); + void deleteTaskbarTab(HWND hwnd); void destroyWindow(HWND hwnd); void setWindowRgn(HWND hwnd, Gdi::Region rgn); diff --git a/DDrawCompat/Gdi/WinProc.cpp b/DDrawCompat/Gdi/WinProc.cpp index 2a084e8..1626b60 100644 --- a/DDrawCompat/Gdi/WinProc.cpp +++ b/DDrawCompat/Gdi/WinProc.cpp @@ -297,6 +297,7 @@ namespace if (Gdi::Window::isTopLevelWindow(hwnd)) { Gdi::Window::updateAll(); + Gdi::GuiThread::deleteTaskbarTab(hwnd); return; }