|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I'm sure there is a Windows XP DLL to use for that but I don't have a clue which one and which function to register and how to register it with SWFKit Pro 2.2
I would also like to be able to detect if the default printer is a networked printer and if it is accessible. The Printer object doesn't have such method. I can checked if the default printer string includes a double backslah at the beginning of the string but I don't think it is the best way to ensure it is a networked printer. Thankx. |
|
|||
|
You can check if it is a network printer by checking a double backslash, because in a local printer name, a backslash is not allowed.
To see if the printer is accessible, you can use the OpenPrinter function. The following code shows how to do this Code:
dllimport "winspool.drv" stdcall Boolean OpenPrinterA(String, int*, pointer);
dllimport "winspool.drv" stdcall Boolean ClosePrinter(int);
var printer = new Object;
printer.value = 0;
// This sample opens the first printer, however, you must
// open the default printer
if (OpenPrinterA(Printer.printers[0], printer, 0))
{
trace("Printer opened successfully with handle:" + printer.value);
ClosePrinter(printer.value);
}
else
{
trace("cannot access the printer");
}
|
|
|||
|
FFish script does not include any method to retrieve and set the default printer. However, we've built a dll (DP.dll) to do that. The DP.dll contains two methods, DPGetDefaultPrinter and DPSetDefaultPrinter. The attached sample shows how to call this dll from with ffish script and actionscript, and the C source code of the DP.dll is also included. To try the sample, please extract the files in the attached zip file into a new folder, and then open the dpsample.skp file with swfkit pro.
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|