Results 1 to 5 of 5

Thread: Window Borders

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280

    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.

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    Thanks for your help...I'll look into it (I'll probably come running back for more help though )

  4. #4
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148
    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

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    Thanks....that's exactly what I needed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width