[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2007-12-05
4
Medium Priority
?
3,331 Views
Last Modified: 2013-12-25
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
Comment
Question by:DenverDan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Assisted Solution

by:jpaulino
jpaulino earned 2000 total points
ID: 20417846
0
 
LVL 48

Assisted Solution

by:jpaulino
jpaulino earned 2000 total points
ID: 20417861
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
 
LVL 1

Accepted Solution

by:
DenverDan earned 0 total points
ID: 20422670
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
 
LVL 1

Author Comment

by:DenverDan
ID: 22926102
No Objections
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question