home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 October A / Pcwk10a98.iso / Corel / Ventura8 / Ventura / Scripts / vlred8.csc < prev    next >
Encoding:
Text File  |  1998-07-08  |  897 b   |  32 lines

  1. REM Launches the VLR Editor with Windows DLLs
  2. REM vlred8.csc August 12, 1998
  3. DECLARE FUNCTION FindWindow LIB "user32" (BYVAL classname AS LONG, BYVAL title AS STRING) AS LONG ALIAS "FindWindowA"
  4. DECLARE FUNCTION WinExec LIB "kernel32" (BYVAL path AS STRING, BYVAL shw AS LONG) AS LONG ALIAS "WinExec"
  5.  
  6. #addfol "..\..\Scripts"
  7. #include "VPConst.csi"
  8.  
  9. window$ = "VLR Editor"
  10. exeName$ = "VLRED8.EXE"
  11.  
  12. REM Get path of Ventura Destination from registry
  13. exePath$ = REGISTRYQUERY(2, VENTURA_REGQUERY_CONST, "Destination")
  14. exePath$ = exePath$ + "\Programs"
  15. exeName$ = exePath$ + "\" + exeName$
  16.  
  17. errmsg$ = "Couldn't run " + exeName$
  18.  
  19. REM Load the application if not loaded already
  20. win = FindWindow(0, window$)
  21. IF win = 0 THEN
  22.     err = WinExec(exeName$, 1)
  23.     IF err < 0 THEN err = err * -1
  24.     IF err < 33 THEN
  25.         MESSAGE(errmsg$)
  26.         STOP
  27.     ENDIF
  28.     win = FindWindow(0, window$)
  29. ENDIF
  30.  
  31.  
  32.