|
The graphics library I am using provides basic window functionality, painting, moving etc, but for anything more complex it provides the HWND to each window so we can call Win32 stuff.
My Win32 knowledge is limited, how can I alter the window style using the HWND? I've done some searching but haven't found anything - probably because I'm looking for the wrong thing.
Any help would be great!
Steve
|
|
|
|
|
You may change the window style at runtime using SetWindowLong function [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks,
I have made the following call:
SetWindowLong(window.getHWND(), GWL_EXSTYLE, WS_EX_CLIENTEDGE);
I also call SetWindowPos as stated in the documentation to cause the changes to appear. The window visibly changes. How would I specify that I want to remove or hide the window border and title bar? I have looked at the documentation for Window Styles and CreateWindowEx but am unsure how to achieve this.
I'm looking to achieve something similar to the result of the following .NET code:
myForm.BorderStyle = FormBorderStyle.None;
Thanks again!
Steve
|
|
|
|
|
Try something similar to:
SetWindowLong(window.getHWND(), GWL_STYLE, GetWindowLong(window.getHWND(), GWL_STYLE) & ~WS_BORDER);
IF this doesn't work, try instead of WS_BORDER the other, border related styles like WS_DLGFRAME (see here[^] for window styles.)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Something like this should remove any borders, unless I missed a border style...
::SetWindowLong(window.getHWND(), GWL_STYLE, ::GetWindowLong(window.getHWND(), GWL_STYLE) & ~(WS_BORDER | WS_DLGFRAME | WS_THICKFRAME));
::SetWindowLong(window.getHWND(), GWL_EXSTYLE, ::GetWindowLong(window.getHWND(), GWL_EXSTYLE) & ~WS_EX_DLGMODALFRAME);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey thanks to both of you, the above code works perfectly!
Steve
|
|
|
|
|
Thank you,
But it runs just fine in aero interface
|
|
|
|