|
-
Feb 19th, 2003, 06:57 PM
#1
Thread Starter
New Member
print head cleaning in VB?
Hey all,
Is there any way that I can clean a print head from VB? I know I can clean them through control pannel, but I need a way to automate the process. I've got a large program that prints occasionally, but the problem is, the print head clogs all the time. when i clean them, it's all better, but is there a way that I could impliment an "auto-clean" in the program? The printer is a Canon 4400. Is this something that can even be done without special software? Any help would be great. thanks
-tom
-
Feb 21st, 2003, 04:19 PM
#2
Frenzied Member
Assuming that the printer responds to a special series of commands - usually printer control commands start with ascii 27
the Escape character.
Based on this idea there is an Escape() api that lets you send any string directly to the printer instead of thru GDI - which normally talks to the printer. Use PASSTHRU to let the whole sequence go to the printer.
Your problem is finding out what the sequence is - I do not know.
You will have to play with this code to get what you need.
Code:
Private Declare Function Escape Lib "gdi32" _
(ByVal hdc As Long, ByVal nEscape As Long, ByVal nCount As Long, _
ByVal lpInData As String, lpOutData As Any) As Long
Private Const PASSTHROUGH = 19
Sub Cleanit()
Dim tmp as String
tmp = Chr(27) & "some cleaning string"
Escape Printer.hdc, PASSTHROUGH, Len(tmp), tmp, 0&
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|