Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Is it possible to prevent escape key in console?

 [1/6] from: semseddinm:bircom at: 9-Jan-2009 14:06


Is it possible to prevent user to press escape key to stop the program in console? For example my program gives some debug output to console window, but user is able to break the program by pressing ecs key. Another question, is it possible to change console window title in pro version of command/view? Sorry if those are stupid questions :)

 [2/6] from: sqlab:gmx at: 9-Jan-2009 13:29


That's possible, the second at least under Windows, I had never the need to do it under Linux. Şemseddin Moldibi [ Bircom ] wrote:
> Is it possible to prevent user to press escape key to stop the program > in console? >
system/console/break: false
> For example my program gives some debug output to console window, but > user is able to break the program by pressing ecs key. > > Another question, is it possible to change console window title in pro > version of command/view? >
win-lib: make object! [ user-lib: load/library %user32.dll SetWindowText: make routine! [ handle [integer!] Title [string!] return: [integer!] ] user-lib "SetWindowTextA" ] WindowTitle: func [ Title [string!] ] [ win-lib/SetWindowText get-modes system/ports/system 'window Title free win-lib/user-lib unset 'win-lib unset 'WindowTitle ]

 [3/6] from: semseddinm::bircom::com at: 9-Jan-2009 15:00


Thank you, I know this way but I actualy wanted to ask is there a way more legally , I mean an option or config parameter etc. Thank you fort he reply.

 [4/6] from: moliad::gmail::com at: 14-Jan-2009 13:34


the title part of the rebol header is used by default for window titles. rebol [ title: "hello" ] also, if you look at the options of the view command, http://www.rebol.com/docs/words/wview.html, you will see that you can set the window's title when you open it. but a (severe) limitation is that you cannot change the title of a window once it is open, (unless you use the library trick posted earlier). another limitation, is that "REBOL - " is always added to the title (unless you use the library trick posted earlier). ciao! -MAx

 [5/6] from: semseddinm::bircom::com at: 15-Jan-2009 10:44


Thank you, I actually asked to remove the "REBOL -" from title, the only way is to use library trick I guess.

 [6/6] from: santilli::gabriele::gmail::com at: 15-Jan-2009 16:44


[Please forward to the ML if this arrives encoded there] On Wed, Jan 14, 2009 at 7:34 PM, Maxim Olivier-Adlhoch <moliad-gmail.com> wrote:
> but a (severe) limitation is that you cannot change the title of a window > once it is open,
You can: win: layout [...] view/new win ; ... win/text: "New title" win/changes: 'text show win Regards, Gabriele.