Results 1 to 2 of 2

Thread: print head cleaning in VB?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    10

    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

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    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
  •  



Click Here to Expand Forum to Full Width