1. Dynamically changing the border of a window

I feel sure that there is a simple answer to this but I can't see anything on it on the forum. I create a window but, at some point, I want to interrogate the border style and/or change it (particularly the latter). How do we do this using Win32Lib?

Any help gratefully received!

new topic     » topic index » view message » categorize

2. Re: Dynamically changing the border of a window

cran0g said...

I feel sure that there is a simple answer to this but I can't see anything on it on the forum. I create a window but, at some point, I want to interrogate the border style and/or change it (particularly the latter). How do we do this using Win32Lib?

Any help gratefully received!

The first and easiest method is to use the getstyles and setstyles functions. That's not their real name but I don't have access to the library docs right now. Look around in the docs for names like that.

However, not every style can be modified once a window is created - this is a Microsoft restriction on their pre-packaged window formats. I can't remember which ones, but certain style settings are not able to be changed.

What specifically are you trying to do?

A second method, but more complex, is to actually create a new window with the style you want, and rebuild the UI elements in that, then display the new window over the top of the old then destroy the old one.

A third method, but very much more complex, is to do all the UI rendering yourself and have Windows(tm) leave it alone. This is what a lot of player type application do. This involves creating a border-less window and then your application is responsible for drawing any borders and other UI elements required, plus capturing appropriate events that the user can interact with. Not simple ... but can be fun, kinda.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Dynamically changing the border of a window

Thanks Derek. I'll have a go at those - well, the first one, at least! Many thanks.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu