Window without maximize-, minimize- and close-button needed 
Author Message
 Window without maximize-, minimize- and close-button needed

Hi folks,

does anybody know, if it is possible to vanish the maximize-, the minimize
and  the close-button on a window (the ones in the top right corner of a
window)? I need to avoid that the user maximizes, minimizes or closes an
application by it.

Sorry if this has been asked before, but i lost all my old messages.

Thanks
Chris



Thu, 23 Jan 2003 03:00:00 GMT  
 Window without maximize-, minimize- and close-button needed
Christoph,

Quote:
>does anybody know, if it is possible to vanish the maximize-, the minimize
>and  the close-button on a window (the ones in the top right corner of a
>window)?

MinButton = False
MaxButton = False
ControlBox = False

Matt

============================================

  VB+ - http://hem.spray.se/mattias.sjogren/
  CodeHound - Free VB Search Engine
  http://www.codehound.com



Thu, 23 Jan 2003 03:00:00 GMT  
 Window without maximize-, minimize- and close-button needed
sorry, i think i was a little bit unspecific ... im not talking about a
Visual Basic form but about a word application-window
what i need is an api-function to alter the properties of this window.



Quote:
> Christoph,

> >does anybody know, if it is possible to vanish the maximize-, the
minimize
> >and  the close-button on a window (the ones in the top right corner of a
> >window)?

> MinButton = False
> MaxButton = False
> ControlBox = False

> Matt

> ============================================

>   VB+ - http://hem.spray.se/mattias.sjogren/
>   CodeHound - Free VB Search Engine
>   http://www.codehound.com



Thu, 23 Jan 2003 03:00:00 GMT  
 Window without maximize-, minimize- and close-button needed
Christoph,

Quote:
>what i need is an api-function to alter the properties of this window.

Ahh, OK...

Then use the GetWindowLong and SetWindowLong APIs with the GWL_STYLE
flag to remove the WS_SYSMENU, WS_MINIMIZEBOX and WS_MAXIMIZEBOX
styles from the window.

Matt

============================================



Thu, 23 Jan 2003 03:00:00 GMT  
 Window without maximize-, minimize- and close-button needed
Hi Matt,

first of all, thanks for your help ... i have looked into the functions that
you have mentioned, but im pretty new to the windows api and even appleman
doesnt give a good example in how to UNset those properties ... so i dont
get it working

can you help me again here??? how can i unset (remove) the styles?

Thanks
Chris



Quote:
> Christoph,

> >what i need is an api-function to alter the properties of this window.

> Ahh, OK...

> Then use the GetWindowLong and SetWindowLong APIs with the GWL_STYLE
> flag to remove the WS_SYSMENU, WS_MINIMIZEBOX and WS_MAXIMIZEBOX
> styles from the window.

> Matt

> ============================================




Thu, 23 Jan 2003 03:00:00 GMT  
 Window without maximize-, minimize- and close-button needed
Christoph,

Quote:
>can you help me again here??? how can i unset (remove) the styles?

The code below will remove the styles from a Calculator window. All
APIs and constants used can be foud in the API Viewer add-in.

Dim hwndCalc As Long
Dim nStyle As Long

hwndCalc = FindWindow("scicalc", "calculator")
nStyle = GetWindowLong(hwndCalc, GWL_STYLE)
nStyle = nStyle And (Not WS_SYSMENU) And (Not WS_MINIMIZEBOX) And (Not
WS_MAXIMIZEBOX)
Call SetWindowLong(hwndCalc, GWL_STYLE, nStyle)
Call SetWindowPos(hwndCalc, 0&, 0&, 0&, 0&, 0&, SWP_NOACTIVATE Or
SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER Or SWP_FRAMECHANGED)

Matt

============================================



Thu, 23 Jan 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Visual Basic - Trapping Minimize/Maximize/Close Events (from the window's buttons)

2. mdi for without minimize and maximize buttons

3. Word 2000 minimize, maximize, close buttons

4. How suppress minimize, maximize and close buttons

5. How suppress minimize, maximize and close buttons

6. Hide Close, Minimize and Maximize at top of access window

7. Using VBScript to minimize, restore/maximize, close window

8. Using VBScript to minimize, restore/maximize or close a window

9. API for hide the icons of maximize, minimize and close the window

10. disabling minimize, maximize, restore buttons of an html popup window

11. How to hide the minimize, restore and close button on a maximized form

12. minimize/maximize/close

 

 
Powered by phpBB® Forum Software