How to make the border and titlebar dissapear
-
I got a request to make a program that seamlessly writes out some generic info on the background on a Windows 2000 (or higher) machine. (info is such as quote of the hour, fre RAM, incoming mails, current song in Winamp, whaterver info that can be summarized in short strings, you get the idea) Well, such a program needs a few properties: Transparancy, Not able to be activated, not show up in the taskbar. More ofcourse, but for now these are the important ones. Trancaparency is easely fixed, just a layered window WS_EX_LAYERED with a call to the SetLayeredWindowAttributes function and selecting a COLORREF color to be treated as transparent. Also giving it the WS_EX_NOACTIVATE style unables the windows to be in the foreground. And making it not able to show up in the taskbar, well, a toolbar have that property, so giving it the WS_EX_TOOLWINDOW style solves that problem. Now the part that I cannot solve remains, how to make the border, and most importantly, the titlebar to dissapear? (no x-shutdown icon isn't a problem, just use the commandline and send a shutdown mesage or something) But for it to fit nicely onto the desktop background I need to remove the titlebar and border. Anyone who knows ? // Christoffer Sandberg , christoffer_sandberg@hotmail
-
I got a request to make a program that seamlessly writes out some generic info on the background on a Windows 2000 (or higher) machine. (info is such as quote of the hour, fre RAM, incoming mails, current song in Winamp, whaterver info that can be summarized in short strings, you get the idea) Well, such a program needs a few properties: Transparancy, Not able to be activated, not show up in the taskbar. More ofcourse, but for now these are the important ones. Trancaparency is easely fixed, just a layered window WS_EX_LAYERED with a call to the SetLayeredWindowAttributes function and selecting a COLORREF color to be treated as transparent. Also giving it the WS_EX_NOACTIVATE style unables the windows to be in the foreground. And making it not able to show up in the taskbar, well, a toolbar have that property, so giving it the WS_EX_TOOLWINDOW style solves that problem. Now the part that I cannot solve remains, how to make the border, and most importantly, the titlebar to dissapear? (no x-shutdown icon isn't a problem, just use the commandline and send a shutdown mesage or something) But for it to fit nicely onto the desktop background I need to remove the titlebar and border. Anyone who knows ? // Christoffer Sandberg , christoffer_sandberg@hotmail
Well, if you are using the dialog editor from vc++, just change the border style to 'none' using the dialog properties 'styles' tab.... or with c++ code, call the ModifyStyle(WS_OVERLAPPEDWINDOW, 0, SWP_FRAMECHANGED) of your window class, and you have a window without any frame! ---- Rui Lopes
-
Well, if you are using the dialog editor from vc++, just change the border style to 'none' using the dialog properties 'styles' tab.... or with c++ code, call the ModifyStyle(WS_OVERLAPPEDWINDOW, 0, SWP_FRAMECHANGED) of your window class, and you have a window without any frame! ---- Rui Lopes
Ahh, that is indeed a neat function, unfortenatly is is a member of the CWindow class (ATL) or the CWnd (MFC)(atleast what I was able to figure out). What I have is a standard Win32 program (none ATL, none MFC) application, so I use the RegisterClassEx and CreateWindowEx functions in the API to do my work, so all I have access to is the hInstance and hWnd of the program/window. Is there anyway to go from there and still being able to remove the the WS_OVERLAPPEDWINDOW style?
-
Ahh, that is indeed a neat function, unfortenatly is is a member of the CWindow class (ATL) or the CWnd (MFC)(atleast what I was able to figure out). What I have is a standard Win32 program (none ATL, none MFC) application, so I use the RegisterClassEx and CreateWindowEx functions in the API to do my work, so all I have access to is the hInstance and hWnd of the program/window. Is there anyway to go from there and still being able to remove the the WS_OVERLAPPEDWINDOW style?
Well, the ModifyStyle is a straitforward function to implement. Use this code instead of the ModifyWindow,
SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE)&~WS_OVERLAPPEDWINDOW); ::SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_FRAMECHANGED);
But since you are using the CreateWindowEx, you can create the window without the WS_OVERLAPPEDWINDOW style, so there is no need for this code.... ---- Rui Lopes