1. Tina Prestas
  2. PowerBuilder
  3. Monday, 31 August 2020 12:42 PM UTC

Good Morning!

We recently upgraded to PB 2019 and had some complaints from our users in the Citrix environment where their default printer was not being set correctly.  At the time we tried to implement a suggestion found here by adding an option that our application would call an extra windows printer API when opening to determine which default printer to use but that didn't seem to help.  We then found an option in Citrix that tells the application to start without waiting for default printers, we turned this off which causes a minimal delay but the default printers were now available. 

One clientis still having an issue and has been working with Citrix directly but was hoping for some guidance as per a request from Citrix to have a phone call.  Here is the information they are looking for and I was hoping someone could help answer this as to how PB is looking for the printers.  I saw in another thread The PB run-time just calls the equivalent "Enumprinters" command API in the O/S ( https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters).    Is there any other information that could be provided that may be helpful to them?

From our client:

So right now we have our VDAs working on the LTSR version (1912) but we are unable to upgrade to the latest VDA versions starting with 2003. Below is what Citrix would be looking for on the call.

“The goal is to have the vendor explain what their application is looking for to enumerate a printer in their application. Are there registry keys or values the application is looking for that are present in VDA 1912 sessions that are not present in VDA 2003 sessions? This is the level of information we need from the application vendor. This way, I can go to our engineering team and ask why these particular settings/values in the LTSR branch differ from the CR branch.”

 

Olan Knight Accepted Answer Pending Moderation
  1. Monday, 31 August 2020 14:33 PM UTC
  2. PowerBuilder
  3. # 1

Tina -

   Our apps are presented to the users via Citrix. Here is how I have implemented handling of the default printer in our apps. Note that we are on a Windows 10 64 bit platform.

// Get a list of printers
ls_printer_list_array = PrintGetPrinters()

// Get the current printer (this is not necessarily the default printer)
ls_printer = PrintGetPrinter()


// To set the default printer for the Windows platform
// Get the selected printer
ls_new = dw_1.GetitemString (ll_new, "printername")
        
// Reset the default printer
ll_result = RegistrySet("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows",   &
                              "Device", RegString!, ls_new)
                                        
IF (ll_result = 1) THEN
                
      // Set the printer for the next PRINT job
      ll_result = PrintSetPrinter (ls_new)

ELSE
   // Error processing
END IF


Hopoe This Helps, 

Olan

Comment
  1. Tina Prestas
  2. Thursday, 3 September 2020 18:44 PM UTC
Thank you Olan. We implemented an option for an extra API call and it resolved the clients issue.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Thursday, 3 September 2020 19:13 PM UTC
Thanks for confirming the solution!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.