PDA

View Full Version : Printing the license agreement from SdLicense



AndrewRich
06-27-2008, 04:47 PM
SdLicense (and its variants) has a [Print] button which sends the license file directly to the default printer using the registered handler for that filetype (notepad for .txt, wordpad for .rtf, etc). Internally, the SdLicense code uses an undocumented InstallShield function (PrintFile) to accomplish this.


case SD_PBUT_PRINT:
PrintFile( szFinalFile );

I have a requirement to use the standard Windows print handler--the one that comes up when you print from most applications, that allows you to select a printer and set other options--instead of printing directly.

I can't find any documentation on PrintFile or any other way of printing a file from InstallShield. Any ideas?

RobertDickau
06-27-2008, 05:15 PM
Perhaps use LaunchApplication and set LAAW_SHELLEXECUTEVERB = "print"?

AndrewRich
06-27-2008, 05:40 PM
Perhaps use LaunchApplication and set LAAW_SHELLEXECUTEVERB = "print"?

Wouldn't that have the same effect? PrintFile (unless I'm greatly mistaken) does ShellExecute with the "print" verb, which in the case of .txt and .rtf files causes notepad/wordpad to immediately print the files and exit.

I think what I'm actually looking for is what happens when you load the document into notepad/wordpad and hit ctrl-p.

RobertDickau
06-27-2008, 06:16 PM
I don't know anything about the implementation of PrintFile, but drat, yes, I was led astray by my nonstandard default text editor; using the "print" verb with a .rtf or .doc file skipped the print-settings dialog. Back to the drawing board...