newLISP Fan Club

Forum => newLISP newS => Topic started by: Lutz on August 16, 2004, 01:38:38 PM

Title: code snippets collected from this board
Post by: Lutz on August 16, 2004, 01:38:38 PM
This is a file I am keeping for some time now, collecting useful little functions from the board: http://www.newlisp.org/index.cgi?page=Code_Snippets



Lutz
Title:
Post by: HPW on August 16, 2004, 11:57:01 PM
Good start and nice that you link it under 'Tips and Tricks'.

(BTW: Why no navigation footer on this page?)
Title:
Post by: Fanda on November 10, 2005, 12:04:38 PM
There is an error in the last example:  Run a Win32 shell and hide window



I believe that function should be:
(define (winexec)
  (import "shell32.dll" "ShellExecuteA")
  (apply ShellExecuteA (args)))


(Maybe we don't even need to import the ShellExecuteA every time...)



This make this function... -> makes



--------



Would anybody know how to hide window of newlisp.exe right from the start? (So it is completely invisible.)

Any possible way - using batch file, some parameters for newlisp.exe, ... ???



Thank you, Fanda
Title:
Post by: Lutz on November 10, 2005, 03:01:54 PM
The code snippet in http://newlisp.org/index.cgi?page=Code_Snippets (last item) defines the function 'winexec' correctly. The construct with 'args' is not necessary. The defined 'winexec' can be used directly after importing it when using as shown in the header of the code snippets. This is not a lambda function definition, but 'define' here is used as a 'setq'

(define winexec
   (import "shell32.dll" "ShellExecuteA"))

;; is equivalent to

(set 'winexec (import "shell32.dll" "ShellExecuteA"))


but the first form of the assignment documents better the itention of creating a function. See the documentation for 'define' in the manual.



Lutz
Title:
Post by: Fanda on November 10, 2005, 10:48:51 PM
Thanks for explaining. Somehow it didn't work for me the first time. I have tried to recreate the situation when it didn't work, but now it is OK every time :-)))



----------



So, does anybody know how to hide the window of newlisp.exe right from the start?



Thank you, Fanda



PS: Lutz, you forgot to change the date of "last updated 2005-08-18".

And, please excuse me for posting mostly errors, or what I think are the errors.
Title:
Post by: pjot on November 11, 2005, 12:28:34 AM
Hi Fanda,



You can hide the DOSBOX in which newLisp starts with my 'run'-tool:



http://www.turtle.dds.nl/run/index.html





Or, you could recompile newLisp with MinGW, after editing the file 'makefile_mingw'. You have to add '-mwindows' to the link flags.



Peter
Title:
Post by: Fanda on November 11, 2005, 07:22:54 AM
Thanks Peter, it works!



I don't usually deal with the system-level stuff, so it would take me ages to figure that out :-)))



Fanda