Acer Annoyance Fix

One of the things that have annoyed me since I started working with an Acer laptop was that when working in Windows the GraviSense application appeared in the Alt-Tab list even if it had no window to show. To save that extra Tab key press I asked Raymond Chen for a tip on how to make it go away. The solution was to set the WS_EX_TOOLWINDOW extended style bit. Taking this and the good old LCC-Win32 compiler I put together the following little snippet and the window disappears from the Alt-Tab list but stays alert (I shook the laptop gentry to trigger it).

#include <windows.h>

int APIENTRY WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR lpCmdLine, int nCmdShow)
HWND acerWin = FindWindow( NULL, "ACER_GraviSense" );

if( !acerWin )
return -1;

SetWindowLong( acerWin, GWL_EXSTYLE, GetWindowLong( acerWin, GWL_EXSTYLE ) | WS_EX_TOOLWINDOW );

return 0;

And they say that Linux is for those who wants to hack the system... :-)


Post a Comment

<< Home