richrock316
Programmer
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
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