Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3365
  • Last Modified:

Visual Basic 6 wait till shellexecute API completes before continuing program execution

I am using the ShellExecute API to print   pdf   files.  I want to loop until the shellexecute api has completed sending the print job to the print queue then continue with program execution.   Of course I could put a long delay in the program after the shellexecute line but the size of the print files vary greatly.

Below is the shellexecute function and the line used to call the function.

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
      "ShellExecuteA" (ByVal hwnd As Long, ByVal lpszOp As _
      String, ByVal lpszFile As String, ByVal lpszParams As String, _
      ByVal lpszDir As String, ByVal FsShowCmd As Long) As Long


 PrintDoc = ShellExecute(0, "Print", Fname, " ", " ", SW_HIDE)

0
DenverDan
Asked:
DenverDan
  • 2
  • 2
3 Solutions
 
jpaulinoCommented:
0
 
jpaulinoCommented:
Hummmm!

Also have a look on this wsteegmans proposal http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Controls/Q_20809593.html

It's a nice option.
0
 
DenverDanAuthor Commented:
I reviewed both your suggestions,  the item you suggested "Shell execute print"  was pretty clear that getting process information when printing pdf files is not appropriate.  I will just put a long delay after the shellexecute command before executing a the next lines of code.  Thanks,
0
 
DenverDanAuthor Commented:
No Objections
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now