code snippets collected from this board

Started by Lutz, August 16, 2004, 01:38:38 PM

Previous topic - Next topic

Lutz

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">http://www.newlisp.org/index.cgi?page=Code_Snippets



Lutz

HPW

#1
Good start and nice that you link it under 'Tips and Tricks'.

(BTW: Why no navigation footer on this page?)
Hans-Peter

Fanda

#2
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

Lutz

#3
The code snippet in http://newlisp.org/index.cgi?page=Code_Snippets">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

Fanda

#4
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.

pjot

#5
Hi Fanda,



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



http://www.turtle.dds.nl/run/index.html">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

Fanda

#6
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