Sign in to follow this  
darklordsatan

Transparent/skinned windows perhaps? (plain win32)

Recommended Posts

darklordsatan    258
Hello, I was wondering how applications like these (280 kb - scroll down an press the free button to download) can be made? I mean, from what I see, probably they are just transparent windows with no title bar using images with an alpha channel, Am i right? But the thing is, in the basket game, when you click anywhere on the screen but the basket or the ball themselves, you are returned back to the window you can see on the background, which means that probably this game is not just a single window? Am I right? I mean, if it was a transparent window, probably clicking anywhere on the screen wouldnt bring me to the background, but would do nothing, since I would be clicking that window, right? but it doesnt work that way... And about the goat animation? how can this be done? is this like a big window, or basically its a small window that contains the goat and moves itself around the desktop? Im just intrigued on how can you make applications like these, they are really cool, any advice, suggestions, links, really appreciated Thanks for taking the time to read this plus downloading the file just to help me out

Share this post


Link to post
Share on other sites
Chris81    196
It's been a while since I've done this programming, but I do know the following:

- From Win2000 and on it supported transparency for a window. However this is basically an alpha for the entire window, not like an alpha channel to make part of the window invisible.

- There are win32 api calls to set window regions. There is a SetWindowRgn or something like that that takes a n-set polygon data structure, so you can pass in any shape and it will make the window that shape. Thus if you click outside of the shape, you are not clicking the window - you are clicking what's behind the window.

Hope this helps.

Share this post


Link to post
Share on other sites
Chris81    196
Oh, and I forgot one other thing that speeds up the operation tremendously.

Say you want the window to match the shape of a gif file that has transparency. You can use an algorithm on the image to generate the polygon structure, then Use SetWindowRgn then use GetWindowRgnData (or something like that) and save it to a file.

The next time you run the program, you can load the rgn data from the file, and use SetWindowRgnData or something like that, and it only takes a split second.

Share this post


Link to post
Share on other sites
darklordsatan    258
Mmm that seems nice, however, lets say I create the polygonomial (is this an english word? hehe) region, as you can see from the basketball game, you click on the mouse, let pressed, and then release to "throw" it... so, can a window be moved automatically, since -perhaps- the ball would be a window (or a region) itself

Share this post


Link to post
Share on other sites
Chris81    196
yup, the window sure can be moved using SetWindowPos, however because it involves animated, moving, and interactive graphics, they may be using a different method to overlay graphics on top of the desktop.

I can't click the link you posted because it's blocked by my work's servers for the category "Personal Network Storage and Backup".

Share this post


Link to post
Share on other sites
darklordsatan    258
Ok, I just found the direct link to the basketball game, its right here

ApochPiQ, thanks for the suggestion. If the link you mention is the one at flipcode, I have to say I read it before and its very good. However, Im more into the animation part; I want it to be optimized.

Now I know that what I wanted could be done through skinning which was my first guess.

Im gonna look into the SetWindowPos function, although I guess it might have some painting problems, or maybe Im wrong.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this