1. Kieu Parrish
  2. PowerBuilder
  3. Thursday, 10 December 2020 20:56 PM UTC

Good Afternoon!

We are using PB2019 R2 Build 2328.

I'm looking for some helps!

The request is : open PDF images from the database with Adobe Acrobat Standard 2017 and display the PDF files on the second monitor.

The coding that gets PDF images into Adobe Acrobat is fine. I have problem is the PDF files are not moved to the second monitor. 

I'm using OLE for the PDF images then I use the SetWindowPos() to move PDFs to second monitor. 

The PDF images with Adobe Acrobat are not moving. If I manually open a PDF and move it to the second monitor then PDF image from PB moved to second monitor but only one PDF image is moved (example if I have 2 PDF images , one is still on the main monitor) 

I only call SetWindowPos() to move . I tried with windows created in PB and they all were moved correctly. The Adobe Acrobat PDFs are not. 

Could you guys give me some helps ?

Thank you very much!!

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 10 December 2020 21:06 PM UTC
  2. PowerBuilder
  3. # 1

Hi Kieu;

  For the "SetWindowPos" command's HANDLE ... are using the FindWindow() API call beforehand to get the Adobe PDF display's Window handle OK?

Regards .... Chris

Comment
  1. Kieu Parrish
  2. Thursday, 10 December 2020 21:18 PM UTC
Thank you, Chris!



Yes.

I have the below:

AVYourDoc = create OleObject

ll_connect = AVYourDoc.Connecttonewobject("AcroExch.AVDoc")

bFileOpen = AVYourDoc.Open( ls_path , ls_file_name)



and call "AcroExch.App" to show the Adobe.

call ll_hWnd = FindWindow(ls_null,ls_null)

and GetWindowText() to check title for matching with "ls_file_name" from AVYourDoc.Open().

It returns the Handle .

  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 10 December 2020 21:37 PM UTC
Just a thought ... If your Adobe App is of a 64bit nature, you might need to process its handle as a "LongPtr" data type.
  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.