From: ········@lapa.cic.itcr.ac.cr
Subject: Some questions
Date: 
Message-ID: <9408012142.AA12135@lapa.cic.itcr.ac.cr>
Hello everybody.
I have a couple of questions.  I am using Allegro CL/PC 1.0.

1) How do I execute another windows application from CL?  For example,
I would like to call the Window-Help.

2) How do I create a directory and how can I check if a directory already exists?

3) How do I change the Icon that is displyed while a window that I have
created is minimized?

Thank you, Federico


-------------
Federico Zoufaly
Centro de Investigaciones en Computacion
Instituto Tecnologico de Costa Rica
e-mail|: ········@cic.itcr.ac.cr
From: R.Coimbras J.Sil N.Castela J.Armando
Subject: Re: Some questions
Date: 
Message-ID: <31n1t4$d28@gnu.mat.uc.pt>
········@lapa.cic.itcr.ac.cr wrote:
: Hello everybody.
: I have a couple of questions.  I am using Allegro CL/PC 1.0.

: 1) How do I execute another windows application from CL?  For example,
: I would like to call the Window-Help.

   To call another Windows Application you could use:

   (WIN:WINEXEC "executable.exe" WIN:SW_SHOWMAXIMIZED)

   The 2.nd parameter could have many other values. To know all the values, you
may select the option 'Apropos' of the CL 'HELP' menu, putting the word 'SW_'
under the cursor. That parameter tell the way the window should be opened.

: 2) How do I create a directory and how can I check if a directory already 
: exists?
   
    To create a directory, you use

      (WIN:MKDIR "\\directory")

    or you may call "OPEN-STREAM" to create a file, whose pathname contains the
directory you want to create. Ex:

      (open-stream ... "\\directory\\dummy.txt" ... )

   creates the file dummy.txt and creates the directory "\\directory", if does
not exist.

   To check if a directory already exists, you could do

       (WIN:CHDIR "\\directory\\dir1\\dir2") and test the returning value.

  If the value is 0, the direct. exists, but you are 'moved' to anoother direct.

  So, before, you must do:

       (setf old-dir (make-string 256)) 
       (WIN:GETCWD old-dir 255) ;; 255 = max. number of chars to put in old-dir

   Another way to change dir. is:

       (PC:SET-DOS-CURRENT-DIRECTORY (pathname "c:\\direc\\"))

: 3) How do I change the Icon that is displyed while a window that I have
: created is minimized?

   There are 3 functions to handle that:

        load-icon, draw-icon and window-icon.

   I think load-icon can do all the job.


   The package WIN contains many functions belonging to the Windows API. These
functions are also available in 'C' compilers for Windows. So, you may use the
Help from those compilers to know about Windows functions. The functions in WIN
package have the same name as the counterpart 'C' functions.
   I use Borland 3.1 for Windows. The package PC is also interesting, and so the
command 'Apropos'.


                                          Ricardo Coimbras

                                     (······@labredes.dee.uc.pt)
                                     (······@labredes2.dee.uc.pt)
                                     (······@labredes10.dee.uc.pt)


   PS: Sorry for my English.