AnsweredAssumed Answered

vrf Disabling a program close

Question asked by antti.suhonen on Jan 16, 2008
Latest reply on Jan 20, 2008 by VRFuser
Hi all,

Here.

WS_MAXIMIZEBOX = #H10000;
WS_MINIMIZEBOX = #H20000;

long=User32.GetWindowLongA(hwnd,GWL_STYLE);
//get props

newLong=(minimize ? BitOr(long, WS_MINIMIZEBOX) :
//calc new props : minimize box and menu item?
   bitAnd(long, bitCmpl(WS_MINIMIZEBOX)));

newLong=(maximize ? BitOr(newLong, WS_MAXIMIZEBOX) :
//calc new props : maximize box and menu item?
   bitAnd(newLong, bitCmpl(WS_MAXIMIZEBOX)));

User32.SetWindowLongA(hwnd,GWL_STYLE,newLong)     //set new props


BR,
-Antti

-----Original Message-----
From: Kevin Nievaart [mailto:Kevin.Nievaart@eng.monash.edu.au]
Sent: 17. tammikuuta 2008 08:16
To: VRF
Subject: Re: [vrf] Disabling a program close

G'day John,
Unfortunately I'm not much of a programmer - more of a hack really.  So while I tried as best as I could to understand and follow your ideas, unfortunately I've got no clue how to go about this...

--
Kevin Nievaart
Materials Testing Officer

Dept. Civil Engineering
Monash University, Clayton Campus
Ph.  (03) 9905-1165
Fax  (03) 9905-1483


"It is known that there is an infinite number of worlds, simply because there is an infinite amount of space for them to be in. However, not every one of them is inhabited. Therefore, there must be a finite number of inhabited worlds. Any finite number divided by infinity is as near to nothing as makes no odds, so the average population of all the planets in the universe can be said to be zero. From this it follows that the population of the universe is also zero, and that any people you may meet from time to time are merely the product of a deranged
imagination."   -   Douglas Adams



DUMAIS,JOHN (A-Sonoma,ex1) wrote:
> If you look at the GWL_STYLE box in the ShowSystemMenu function,
> you'll see that it uses a constant to tell Windows which buttons to
> show/hide.  That constant is derived from the values associated with
> window style bits.  To remove (or, more correctly, disable -- Windows
> leave the buttons there & disables one or two unless you try to remove

> all of them) just one, you supply a bit value that include only the
> window style you want.  The manifest constant you want is
> WS_MAXIMIZEBOX.  You want the style bits to include all that are
> already there but exclude WS_MAXIMIZEBOX.  The manifest constant for
> WS_MAXIMIZEBOX is 0x00020000L;
>
> In C code, it would look something like this...
>
> #define STYLE_BITS WS_MAXIMIZEBOX
> SetWindowLong(aWindow, GWL_STYLE, GetWindowLong(aWindow, GWL_STYLE)
>                       & ~(STYLE_BITS));
>
>
>
> -----Original Message-----
> From: Kevin Nievaart [mailto:Kevin.Nievaart@eng.monash.edu.au]
> Sent: Wednesday, January 16, 2008 4:16 PM
> To: PDL-LISTS,VRF (A-Lists,unix1)
> Subject: [vrf] Disabling a program close
>
> G'day Vrf'ers,
> A while ago someone posted a little script that removed the minimise,
maximise and close buttons from the top right of the program.  (attached for your viewing pleasure).  A very nifty thing I thought.  However I'm currently writing a program that will need to run for potentially months at a time and other programs need to be constantly monitored and mucked about with on this same computer.  So ideally I'd like to be able to keep the minimise and maximise buttons available but remove the close program button.  Is this possible?  And if so does anyone have a pre-written script?
> Cheers,
>
> --
> --
> Kevin Nievaart
> Materials Testing Officer
>
> Dept. Civil Engineering
> Monash University, Clayton Campus
> Ph.  (03) 9905-1165
> Fax  (03) 9905-1483
>
>
> "It is known that there is an infinite number of worlds, simply
because there is an infinite amount of space for them to be in. However, not every one of them is inhabited. Therefore, there must be a finite number of inhabited worlds. Any finite number divided by infinity is as near to nothing as makes no odds, so the average population of all the planets in the universe can be said to be zero. From this it follows that the population of the universe is also zero, and that any people you may meet from time to time are merely the product of a deranged
imagination."   -   Douglas Adams
>
>


----------------------------------------------------------------
Please note: This e-mail may contain confidential information intended solely for the addressee. If you have received this e-mail in error, please do not disclose it to anyone, notify the sender promptly, and delete the message from your system.
Thank you.


---
You are currently subscribed to vrf as: ming_meng@agilent.com To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com".

Outcomes