-
Window Borders
I was wondering if it is possible to change the border style of a window at run-time.
Ie: I want to change a borderless window to a fixed single border window and vica versa.
VB doesn't seem to allow this...is it possible with API? Or do I have to make a new window everytime?
My reason for asking is that I have a fullscreen OpenGL app that I want to window...but I want it to have a title bar. Many VC++ apps do it, so I hoped there would be a VB way.
-
You call SetWindowLong(hwnd, index, value).
Since you want to do several things (border styles can be a couple of changes) look up SetWindowLong at MSDN.
the index is one of the following:
Code:
GWL_EXSTYLE Sets a new extended window style.
GWL_STYLE Sets a new window style.
GWL_WNDPROC Sets a new address for the window procedure.
GWL_HINSTANCE Sets a new application instance handle.
GWL_ID Sets a new identifier of the window.
GWL_USERDATA Sets the 32-bit value associated with the window. Each window has a corresponding 32-bit value intended for use by the application that created the window.
There are a LOT of constants that you can place in the value argument, and they depend on what the window currently is,
what the index is.
Go to MSDN or www.allapi.net for more information.
-
Thanks for your help...I'll look into it (I'll probably come running back for more help though :rolleyes:;))
-
There's a thread here with all the code for changing a form borderstyle at runtime - look at the code down near the bottom of the thread..
HTH,
Duncan
-
Thanks....that's exactly what I needed