mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Fixed stuck taskbar buttons
This commit is contained in:
parent
5ce5ea0668
commit
d39a4ab0fc
@ -1,3 +1,4 @@
|
||||
#include <ShObjIdl.h>
|
||||
#include <Windows.h>
|
||||
|
||||
#include <Common/Log.h>
|
||||
@ -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<void**>(&taskbarList))))
|
||||
{
|
||||
taskbarList->lpVtbl->HrInit(taskbarList);
|
||||
taskbarList->lpVtbl->DeleteTab(taskbarList, hwnd);
|
||||
taskbarList->lpVtbl->Release(taskbarList);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void destroyWindow(HWND hwnd)
|
||||
{
|
||||
execute([&]() { DestroyWindow(hwnd); });
|
||||
|
@ -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);
|
||||
|
||||
|
@ -297,6 +297,7 @@ namespace
|
||||
if (Gdi::Window::isTopLevelWindow(hwnd))
|
||||
{
|
||||
Gdi::Window::updateAll();
|
||||
Gdi::GuiThread::deleteTaskbarTab(hwnd);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user