tareas quitar programas permanentemente pantalla ocultar iconos dela completa como cambiar barra c++ windows winapi

c++ - quitar - Win32: Cómo ocultar ventanas de terceros en la barra de tareas por hWnd



ocultar barra de tareas windows 10 permanentemente (2)

Tengo que ocultar ventanas emergentes en la biblioteca de terceros.

He implementado Windows Hook Stuff con SetWindowsHookEx y conozco todos los hWnd (s) recién creados. HSHELL_WINDOWCREATED devolución de llamada de HSHELL_WINDOWCREATED y hago lo siguiente:

long style= GetWindowLong(hWnd, GWL_STYLE); style &= ~(WS_VISIBLE); // this works - window become invisible style |= WS_EX_TOOLWINDOW; // flags don''t work - windows remains in taskbar style &= ~(WS_EX_APPWINDOW); SetWindowLong(hWnd, GWL_STYLE, style);

¿Qué hago mal aquí para ocultar ventanas recién creadas en la barra de tareas?


Antes de usar SetWindowLong , llame a ShowWindow(hWnd, SW_HIDE) , luego llame a SetWindowLong , luego llame a ShowWindow nuevamente como ShowWindow(hWnd, SW_SHOW) . Entonces tu código se verá así:

long style= GetWindowLong(hWnd, GWL_STYLE); style &= ~(WS_VISIBLE); // this works - window become invisible style |= WS_EX_TOOLWINDOW; // flags don''t work - windows remains in taskbar style &= ~(WS_EX_APPWINDOW); ShowWindow(hWnd, SW_HIDE); // hide the window SetWindowLong(hWnd, GWL_STYLE, style); // set the style ShowWindow(hWnd, SW_SHOW); // show the window for the new style to come into effect ShowWindow(hWnd, SW_HIDE); // hide the window so we can''t see it

Aquí hay una cita relevante del sitio web de Microsoft :

Para evitar que el botón de la ventana se coloque en la barra de tareas, cree la ventana sin dueño con el estilo extendido WS_EX_TOOLWINDOW. Como alternativa, puede crear una ventana oculta y hacer de esta ventana oculta el propietario de su ventana visible.

El Shell eliminará el botón de una ventana de la barra de tareas solo si el estilo de la ventana admite botones visibles de la barra de tareas. Si desea cambiar dinámicamente el estilo de una ventana a uno que no admita los botones visibles de la barra de tareas, primero debe ocultar la ventana (llamando a ShowWindow con SW_HIDE), cambiar el estilo de la ventana y luego mostrar la ventana.


Debe usar GWL_EXSTYLE para obtener / configurar los indicadores EX, GWL_STYLE no funcionará para los indicadores EX.