Archived

This topic is now archived and is closed to further replies.

Windowed but not....

This topic is 6031 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This may be an easy subject, but...: Windows media player does it, Real JukeBox too. Skin mode, ya know, without a title bar and more than just a 4 sided Window (any shape really). What kinda window mode is that and how do I create one with Visual C++ 6.

Share this post


Link to post
Share on other sites
I am pretty sure the code is the same as a regular window. The program is just drawing ALL the parts itself instead of offloading to the OS - and it looks for clicks more activley and anything that does not map to the bitmap of its funky window gets handed right back to the OS.

Not sure if thats it - just how I see to do it.

Landsknecht

Share this post


Link to post
Share on other sites
To get a non-rectangluar shaped window, use the function SetWindowRgn() under Win 95, 98, ME and NT <= 4.0. In Windows 2000, there''s a new (faster) way, and that''s to use Layered Windows (See SetLayeredWindowAttributes())

To use SetWindowRgn() you first need to define a HRGN - a handle to a region. This is quite simple to do: use one of CreatePolygonRgn(), CreateEllipticalRgn(), CreateRectRgn() etc (there''s a few of them) If your shape is very irregular, you can use a series of CreateRectRgn() and combine them with CombineRgn(). One way is to take a bitmap, and for each pixel of your window, do a CreateRectRgn() with a rect that is 1x1 pixel, and CombineRgn() it with the other pixels. It''s quite slow, but you usually only do it at application startup anyway.

SetLayeredWindowAttributes() is a bit simpler to use (but only supported on Win2k and XP) You just give it a colour that you want to be the transparent colour, and that''s about it You can also do semi-transparent windows with this one.


War Worlds - A 3D Real-Time Strategy game in development.

Share this post


Link to post
Share on other sites
To create a window without title-bar, borders, etc. Just specify WS_POPUP as the style when creating the window (and '|' it with other styles you want, but not WS_OVERLAPPED, WS_OVERLAPPEDWINDOW or similar)

If you have Visual C++ there is a tool included called Spy++ (spyxx.exe) that you can use to look at different properties of a window in a running program (such as seeing what window-styles were specified for that window etc).

Edited by - Dactylos on June 10, 2001 4:55:50 AM

Share this post


Link to post
Share on other sites