How to use RzLauncher instead of ShellExecuteW

Have a Raize Components question that does not fit into any of the forums below? Post it here.

How to use RzLauncher instead of ShellExecuteW

Postby AndyColmes » Wed Mar 05, 2014 9:22 am

I have a code that uses ShellExecuteW to print a file to the default printer using the following:

ShellExecuteW(HWND(nil), 'print', PWideChar(fs), PWideChar('"' + PrinterName + '"'), nil, SW_MINIMIZE); //SW_MINIMIZE

I would like to use RzLauncher instead since it has a wait until finish. How would I convert the above with RzLauncher?

Thanks in advance

Andy
AndyColmes
 
Posts: 5
Joined:
Wed Mar 05, 2014 9:15 am

Re: How to use RzLauncher instead of ShellExecuteW

Postby Raize Support » Wed Mar 05, 2014 3:32 pm

Hi Andy,

You can set the following parameters either at design-time or runtime:

RzLauncher1.Action := 'Print';
RzLauncher1.FileName := fs;
RzLauncher1.Parameters := '"' + PrinterName + '"';
RzLauncher1.ShowMode := smMinimized;

and then call the Launch method.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 604
Joined:
Fri Mar 25, 2011 9:04 pm

Re: How to use RzLauncher instead of ShellExecuteW

Postby AndyColmes » Wed Mar 05, 2014 3:46 pm

Hi Ray,

Works like a charm! Thanks a million.

Andy
AndyColmes
 
Posts: 5
Joined:
Wed Mar 05, 2014 9:15 am

Re: How to use RzLauncher instead of ShellExecuteW

Postby Raize Support » Wed Mar 05, 2014 10:06 pm

You're welcome!

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 604
Joined:
Fri Mar 25, 2011 9:04 pm

Re: How to use RzLauncher instead of ShellExecuteW

Postby AndyColmes » Fri Mar 28, 2014 11:04 am

Hi Ray,

When I try to print a Word doc to a printer driver using RzLauncher, I get a progress window like the one attached. Someone suggested that I use SW_SHOWMINNOACTIVE when using ShellExecuteW. Will that help and how would I do that with RzLauncher?

Thanks again Ray in advance.

Andy
Attachments
2014-03-27_16-19-17.jpg
2014-03-27_16-19-17.jpg (16.97 KiB) Viewed 7609 times
AndyColmes
 
Posts: 5
Joined:
Wed Mar 05, 2014 9:15 am

Re: How to use RzLauncher instead of ShellExecuteW

Postby Raize Support » Sat Mar 29, 2014 1:30 am

Hi Andy,

You could try setting TRzLauncher.ShowMode to smHide.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 604
Joined:
Fri Mar 25, 2011 9:04 pm


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests

cron