LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2001, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 11 Jun 2001 10:15:10 +0100
Reply-To:     DavidJohnson@HALIFAX.CO.UK
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         David Johnson <DavidJohnson@HALIFAX.CO.UK>
Subject:      Re: AF 6.12 TS065 Preventing user exit
Content-Type: text/plain; charset=us-ascii

SAS-L Digest - 9 Jun 2001 to 10 Jun 2001 (#2001-723)

Thanks for translating Larry's VB into SAS Richard. It is what was needed. I'll browse his site at a later time for any other interesting ideas he has published.

I browsed M$ and found the API definitions, and have tracked down the AppendMenu and InsertMenuItem APIs which I will tuck away against the need to restore the functionality while the application is running.

The application becomes the SAS session, since it is initiated from an initstmt in the config, and the SAS session is closed when the AF application closes.

If you have a maximised AWS, then the control buttons merge and the Window control is subsumed by the SAS session control. Consequently, unless you 'zoom off' the AF window, clicking the 'X' button will cause SAS to initiate the equivalent of an Endsas command, and not initiate the TERM block of the application. You intimated as much in your later email.

At least now I can stop my user from leaving locks in place on parts of the application.

** ##*

David Johnson * 07080 81 8399 * sasuser@dkvj-cons.com * http://www.dkvj-cons.com This message is attributable to the sender and does not necessarily reflect the view of Halifax Group plc or its subsidiaries.

Date: Sat, 9 Jun 2001 04:47:50 -0400 From: Richard DeVenezia <radevenz@IX.NETCOM.COM> Subject: Re: AF 6.12 TS065 Preventing user exit

David: Here is sample moduleN code to remove the SAS system menu Close, which disables the X icon. As long as you can prevent the user from issuing an endsas command you should be ok for always running the frame application TERM

*put this in autoexec; *if you do equivalent in the frame INIT: it works but the SAS window is not redrawn showing inactive state of X (greyed X);

filename SASCBTBL catalog 'WORK.WINAPI.NOXICON.SOURCE';

data _null_;

file SASCBTBL;

input ; put _infile_; cards4;

routine FindWindowA module = user32 minarg = 2 maxarg = 2 stackpop = called returns = ulong ; arg 1 char input byaddr format=$cstr200.; * LPCTSTR lpClassName; arg 2 char input byaddr format=$cstr200.; * LPCTSTR lpWindowName;

ROUTINE GetSystemMenu module = user32 minarg = 2 maxarg = 2 stackpop = called returns = long ; arg 1 num input byvalue format=ib4.; * HWND hwnd; arg 2 num input byvalue format=ib4.; * BOOL bRevert;

ROUTINE RemoveMenu module = user32 minarg = 3 maxarg = 3 stackpop = called returns = long ; arg 1 num input byvalue format=pib4.; * HMENU hMenu; arg 2 num input byvalue format=ib4.; * UINT uPosition; arg 3 num input byvalue format=ib4.; * UINT uFlags; ;;;;

data _null_; WinClass = 'SAS aws'; WinTitle = 'SAS'; hWndSas = modulen ('FindWindowA', WinClass, WinTitle); hMenuSas = modulen ('GetSystemMenu', hWndSas, 0);

* assume the standard window menu, * (that drop down menu shown when upper left icon clicked or * when icon in task bar right clicked) * is Restore:Move:Size:Minimize:Maximize:Separator:Close *;

mf_bypos = 0400X;

rc = modulen ('RemoveMenu', hMenuSas, 6, mf_bypos); * remove Close; rc = modulen ('RemoveMenu', hMenuSas, 5, mf_bypos); * remove Separator; run;

-- Richard DeVenezia - SAS Macros and AF Tools http://www.devenezia.com

------------------------------------------------------------------------------ Part of the Halifax Group, Halifax plc, Registered in England No. 2367076. Registered Office: Trinity Road, Halifax, West Yorkshire HX1 2RG. Represents only the Halifax Financial Services Marketing Group for the purposes of advising on and selling life assurance, pensions and unit trust business. The Marketing Group is regulated by the Personal Investment Authority. Switchboard 01422 333333.

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


Back to: Top of message | Previous page | Main SAS-L page