does anyone know how to make a window always on top?
This is a discussion on always on top within the Windows Programming forums, part of the Platform Specific Boards category; does anyone know how to make a window always on top?...
does anyone know how to make a window always on top?
benforbes@optusnet.com.au
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
Maybe check for WM_FOCUSCHANGED and counter with a BringWindowToTop(hwnd)? Not sure, though...
Code:int main(void){srand(time(0));for(double l=rand(),l0=0,l00=0;;l0+=0.1){for(double l000=0;l000 <1;l000+=.001,l+=((double)rand()/RAND_MAX)/0x64,l00+=((sin(l*0x8*atan(l0)*l000-(l0*0x8*atan (l)))*0.5)+0.5)){l00-=floor(l00);for(size_t l0000=0,l00000=(size_t)(0x50*(l00));l0000<l00000;++l0000 )putchar(0x20);putchar(0x61+(int)((double)rand()/RAND_MAX*0x1a));putchar('\n');}}return 0;}
Call SetWindowPos(), specifying HWND_TOPMOST as the second parameter.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
Also, try ORing the WS_EX_TOPMOST style to the first param you pass to CreateWindowEx()
>>Also, try ORing the WS_EX_TOPMOST style to the first param you pass to CreateWindowEx()<<
I was going to suggest that until I read (msdn):So it seems that:WS_EX_TOPMOST Specifies that a window created with this style should be placed above all nontopmost windows and stay above them even when the window is deactivated. An application can use the SetWindowPos member function to add or remove this attribute.
>>Call SetWindowPos(), specifying HWND_TOPMOST as the second parameter.<<
Is probably the most complete/flexible answer.![]()
thanks, that works
benforbes@optusnet.com.au
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials