forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Disable close Button

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Tue Jul 08, 2003 4:26 pm    Post subject: Disable close Button Reply with quote

window with its close button as well as Alt+F4 disabled

You may sometimes need that the user closes the window from a button or Menu-->Exit as specified by you. you can do it by sending the app back to the loop at :close label but the user wonders why the window is not closing, If u add a warning/info it can be even more irritating. Your end user reflexly goes to that button. Here is a solution for that in VDS 5.

A window with its close button as well as Alt+F4 disabled.

You may download as a zip file here:
http://www.vdsworld.com/download.php?id=305

Please note that this script uses calling a non vds dll.
Errors done may cuse VDS/system to crash.
Use at your own risk.
Code:
#-----------------------------------------------------------------------------#
#-Calling a Non-VDs dll Disable close button by CodeScript--------------------#
#-Author: CodeScript----------------------------------------------------------#
#-Copyright: You can remove this info while Using this code in your app.------#
#------------but may be kind enough to add a word to documentation------------#
REM USE AT YOUR OWN RISK !!
REM MISTAKES MADE WHILE USING A NON VDS DLL MAY INVITE A VDS/SYSTEM CRASH.
REM SAVE YOUR WORK BEFORE RUNNING/DEBUGGING THIS SCRIPT.
  Title Close Disabled Window by CodeScript
  DIALOG CREATE, Close Disabled Window by CodeScript,-1,0,356,120,CLASS MYWIN,RESIZABLE
  DIALOG ADD,BUTTON,OK,70,112,130,24,Close !
  DIALOG ADD,TEXT,TEXT1,36,86,,,Can U close me without this button ?
  DIALOG SHOW
  LOADLIB USER32
%H = @strdel(@WINEXISTS(#MYWIN),1,1)
 IF %H
      %I = @lib(user32,GetSystemMenu,INT:,%H, 0)
      %J = @lib(user32,GetMenuItemCount,INT:,%I)
      %K = @DIFF(%J,1)
      %L = @DIFF(%J,2)
      %M = @lib(user32,RemoveMenu,BOOL:,%I,%K,$400)
      %M = @lib(user32,RemoveMenu,BOOL:,%I,%L,$400)
      %M = @lib(user32,DrawMenuBar,BOOL:,%H)
          ELSE
   ERROR -1
  end
  FREELIB USER32
 
:RESIZE
 goto evloop

:Evloop
  wait event
  goto @event()

:OKBUTTON
exit

:Close
REM HERE DON'T PUT EXIT IF U WANT THE USER NOT TO CLOSE THE WINDOW WITH ALT+F4.
REM BUT CAN GIVE A EVENT OF uR CHOICE/BE SILENT BY SENDING BACK TO LOOP AS
REM DONE BELOW.
  goto evloop ____________________________________________________________________________________

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group