Recent

Author Topic: Running Lazres from a window under Windows  (Read 5263 times)

Curt Carpenter

  • Sr. Member
  • ****
  • Posts: 402
Running Lazres from a window under Windows
« on: August 22, 2011, 06:07:32 am »
I want to write a simple program that will let me convert my icons from .png format to .lrs using Lazres.exe -- but I want to do it from a windows program using the GUI rather than from the lazres DOS program directly (too much chance for uncorrectable typing errors!). 

My plan is to use my windows program to get the necessary file names and paths, use that info. to create a .bat file on my hard drive, and then use a TProcess instance to execute the batch file.

Is there a better way?   

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Running Lazres from a window under Windows
« Reply #1 on: August 22, 2011, 06:53:26 am »
Quote
My plan is to use my windows program to get the necessary file names and paths, use that info. to create a .bat file on my hard drive, and then use a TProcess instance to execute the batch file.

Is there a better way?
Nope, just run lazres directly, why bother creating .bat file first?

Curt Carpenter

  • Sr. Member
  • ****
  • Posts: 402
Re: Running Lazres from a window under Windows
« Reply #2 on: August 28, 2011, 05:42:14 pm »
The windows wrapper makes it quite a bit easier to run Lazres in a windows environment for me, where (for example) directory and file names can be long and include embedded spaces.  I like being able to use an OpenDialog to find the files I want to convert,  too -- and also the ease of editing a long list of file names ( a real plus over needing to retype a long Lazres command line from scratch when I make my usual typos).   

Plus, writing the wrapper was a good exercise in learning how to use Lazarus  :)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Running Lazres from a window under Windows
« Reply #3 on: August 28, 2011, 06:34:42 pm »
I mean, you're going to call it from TProcess, right? So you're not gonna type all the arguments, it's your program job to do so.

Curt Carpenter

  • Sr. Member
  • ****
  • Posts: 402
Re: Running Lazres from a window under Windows
« Reply #4 on: August 28, 2011, 06:40:45 pm »
Oh -- yes, you're right of course!  Creating a .bat is an un-necessary step.

 

TinyPortal © 2005-2018