Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shellexecute print with windows picture and fax viewer

Status
Not open for further replies.

richrock316

Programmer
Jul 30, 2003
57
0
0
US
I have been using shellexecute in my program to send a bitmap to the printer and it was working fine. Now it opens up the windows picture and fax viewer and doesnt print it. I think it may be because we switched to windows XP, but i dont know how to go back to it printing and the viewer not displaying. Any help would be greatly appreciated.

Here is my code:

Open_file.CommonDialog1.ShowPrinter
Unload Open_file 'Close open window
'Slows program down so that one process can finish before another starts
PauseTime = 1 ' Set duration.
start = Timer ' Set start time.
Do While Timer < start + PauseTime
DoEvents ' Yield to other processes.
Loop

SavePicture CaptureImage(hwnd, "save_screen"), CurDir & "\" & "temp.bmp"

start = Timer ' Set start time.
Do While Timer < start + PauseTime
DoEvents ' Yield to other processes.
Loop

ShellExecute Me.hwnd, "print", "temp.bmp", vbNullString, _
vbNullString, sw_hide
start = Timer ' Set start time.
Do While Timer < start + PauseTime
DoEvents ' Yield to other processes.
Loop

Kill "temp.bmp" 'Get rid of when finished
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top