• Advertisement

Archived

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

Howw to make custom windows look

This topic is 6383 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

I''m trying to make an non standanrd window, like those from the players. I can''t figure out how to do it. Could any one give me a clue, or an exaple in Vb or VC? Thanks in advance, ChMar.

Share this post


Link to post
Share on other sites
Advertisement
Have you tried using the _OWNERDRAW styles in combination with WM_MEASUREITEM and WM_DRAWITEM? This is mainly used for buttons, editboxes and other standard Win32 controls.

You also could simply catching the WM_PAINT and WM_ERASEBKGND, after registering your new custom window...

Share this post


Link to post
Share on other sites
In order to give the window any shape you want you use SetWindowRgn() and its related funcions. Basically what you do is you create a bitmap wich is nothing more than a siloute of the shape you want. You then load that bitmap and read through it. As you come across a stripe of black you create a windows region that is on pixel wide. You then read the next line of the bitmap and create another window region. you then combine the two regions with the windows API. you just repeat this process over and over untile you''ve completely read the bitmap image. lastly you set the window''s region to the one you''ve created.

I believe I have an example of this at my web page Useless Code. Look at the style button source code. If for some reason the code is not there or you have any questions just email me.

Share this post


Link to post
Share on other sites
God, I looked for ages to understand how to do non GDIshaped windows ... so that''s how you do it !
But isn''t that slow as fu*k ?

AS well, I got a window with round corners, but the non painted areas wouldn''t refresh correctly (that is, they wouldn''t really be transparent, but rather they would keep whatever was underneath if you tried to move them). Mmmm, I don''t remember if I defined a region though... I am gonna have to check that.

youpla :-P

Share this post


Link to post
Share on other sites

  • Advertisement