English
Source / code snippets

Auftr

 
printer Print WinSpool OpenPrinter Jobs EnumJobs PRINTER_CHANGE_JOB Spooler Aufträge Überwachen Landscape Hochformat DevMode FindFirstPrinterChangeNotification:

Andreas Miethe (20.11.10)


Rolf Koch (11/20/10)

so having before the Konzert again gekuckt and fixes, that
print test&,wi&,he&
always 0,0,0 printen.
Well time cosy rangehen and study ^^


If asks on the incorrect place the Devmode-structure.
high or Landscape standing on position 44 as word 1 or 2
CompileMarkSeparation
 {$cleq}
 $H Windows.ph
 $H winspool.ph
DEF Get_STDPrinter(1) Substr$(ReadIni$("WIN.INI","Windows","Device"),@&(1),",")
DEF &PRINTER_CHANGE_JOB  $FF00
DEF &INFINITE $FFFFFFFF
DEF &PRINTER_CHANGE_ADD_JOB $100
DEF OpenPrinterA(3) !"winspool.drv","OpenPrinterA"
DEF FindFirstPrinterChangeNotification(4) !"winspool.drv","FindFirstPrinterChangeNotification"
DEF FindNextPrinterChangeNotification(4) !"winspool.drv","FindNextPrinterChangeNotification"
DEF EnumJobsA(8) !"winspool.drv","EnumJobsA"
DEF FindClosePrinterChangeNotification(1) !"winspool.drv","FindClosePrinterChangeNotification"
DEF ClosePrinter(1) !"winspool.drv","ClosePrinter"
Declare JOB_INFO_1#
Declare druckername$,dokument$,dstring$
Declare Ende%,lb&,old_count&,entry$,sounddir$,lizenz$
Declare hicon&,cancel&,Title$,Version$,config$
Declare wav$,dateipfad$,belege$,wurde$,new$,abelege%
Var InfoBuffer& = 0
Var BytesNeeded& = 0
Var BytesReturned& = 0;
Var A& = 0
Var L& = 0
Var chgObject& = 0
Var pdwChange& = 0
Var fcnreturn& = 0
Var hPrinter& = 0
Var foundprint& = 0
Var Printer$ = Get_STDPrinter(1)
Var devmoaddr&=0
Var drv$=""
Var wi&=0
Var he&=0
Var Orientation&=0
Var test&=0
//WindowStyle 64
CLS
print usedll("winspool.drv")
print printer$
print OpenPrinterA(Addr(Printer$),Addr(hPrinter&),0)
print hPrinter&
chgObject& = FindFirstPrinterChangeNotification(hPrinter&,&PRINTER_CHANGE_JOB, 0, 0)
print chgObject&
dateipfad$=$progdir
dstring$="Drucktest.rtf"'Wordpad Datei unter Drucktest.rtf gespeichert für Test!
' Am besten einen Filedruck auswählen, damit man kein Papier verbraucht.
settimer 50

WhileNot Ende%

    Waitinput

    If %wmtimer

        ~WaitForSingleObject(chgObject&,150)'200 Millisekunden warten
        fcnreturn& = FindNextPrinterChangeNotification(chgObject&, Addr(pdwChange&),0,0)
        foundprint&=0

        If fcnreturn&

            If pdwChange& = &PRINTER_CHANGE_ADD_JOB

                'Print "neuer Druck-Job"
                EnumJobsA(hPrinter&,0,1,2,0,0,Addr(BytesNeeded&),Addr(BytesReturned&))
                Dim JOB_INFO_1#,BytesNeeded&

                Repeat

                    EnumJobsA(hPrinter&,0,1,2,JOB_INFO_1#,BytesNeeded&,Addr(BytesNeeded&),Addr(BytesReturned&))

                    If BytesReturned&

                        'Locate 0,0
                        druckername$=String$(Long(JOB_INFO_1#,4),0)
                        dokument$=String$(Long(JOB_INFO_1#,16),0)
                        foundprint&=1
                        devmoaddr&=Long(JOB_INFO_1#,40)
                        test&=long(devmoaddr&,104)
                        wi&=long(devmoaddr&,108)
                        he&=long(devmoaddr&,112)
                        Orientation&=word(devmoaddr&,44)
                        drv$=string$(devmoaddr&,0)

                    EndIf

                Until BytesReturned& = 0

                If foundprint&=1

                    print dokument$
                    print dstring$
                    print drv$
                    print test&,wi&,he&
                    Print If (Orientation& = 1,"Hochformat","Querformat")

                    If dokument$=dstring$

                        'playsound sounddir$+"doorbell.wav",1 'HIER SOUNDAUSGABE
                        PRINT "Jetzt würde der Lautsprecher Dingdong spielen"

                    EndIf

                EndIf

            EndIf

        EndIf

    EndIf

EndWhile

FindClosePrinterChangeNotification(chgObject&)
ClosePrinter(hPrinter&)
killtimer
End

 
11/20/10  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.224 Views

Untitledvor 0 min.
AndreasS11/27/18
Thomas Freier12/29/13
iF11/28/12
Rolf Koch10/28/12
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie