| |
|
|
- Page 1 - |
|
Rolf Koch | The following is again not my strength Have one Tool program, where I on a printer with the usual Apis access. me missing To dato yet irgendeine Possibility if the Druckbefehl ankommt before whom Content auszulesen, before it druckt. means so in the manner: Druckerseite in String. of/ one a idea? me falls in the momentum nothing one |
|
|
| |
|
|
| |
|
- Page 3 - |
|
|
« this Posting watts as Solution marked. » |
|
- Page 4 - |
|
Andreas Miethe
| 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
{$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$,document$,dstring$
Declare end%,lb&,old_count&,entry$,sounddir$,license$
Declare hicon&,cancel&,Title$,Version$,config$
Declare wav$,dateipfad$,belege$,watts$,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
//Window Style 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 File under Drucktest.rtf stored for Test!
' best a Filedruck select, so one no paper uses.
settimer 50
WhileNot end%
Waitinput
If %wmtimer
~WaitForSingleObject(chgObject&,150)'200 Millisekunden Waiting
fcnreturn& = FindNextPrinterChangeNotification(chgObject&, Addr(pdwChange&),0,0)
foundprint&=0
If fcnreturn&
If pdwChange& = &PRINTER_CHANGE_ADD_JOB
'Print "neuer pressure-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)
document$=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 document$
print dstring$
print drv$
print test&,wi&,he&
Print If (Orientation& = 1,"Hochformat","Querformat")
If document$=dstring$
'playsound sounddir$+"doorbell.wav",1 'HIER SOUNDAUSGABE
PRINT "Jetzt would the loudspeaker Dingdong spielen"
EndIf
EndIf
EndIf
EndIf
EndIf
EndWhile
FindClosePrinterChangeNotification(chgObject&)
ClosePrinter(hPrinter&)
killtimer
End
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 11/20/10 ▲ |
|
|
|
|
|
| Obiger code is still super revealing - now white I what You want. ^^
for which Zielsystem? How I the understand Better get going XP tougher as ex Vista if I me [...] and [...] and [...] and [...] so ansehe.
then shining it me as if You - if at all - on The Steuerdaten herankommst The for printer aufbereitet get - means no Pixel and no "DC" separate sooner Text ala PCL the against well simply in a File standing.
GetSpoolFileHandle in link with GetFileInformationByHandleEx could möglicherweise help on whom Filenames heranzukommen circa against from the File To reading.
I could me already present the in the File against simple Texts stand The You z.B. with InStr find could.
alike but well whether XP or higher disembark The Steuerdaten in a File and as would not already well tricky enough Gibts then well too yet [...] and [...] what thoroughly very promising looks.
of it Idea have I but no and no experience with - should me there too first (ill) einarbeiten.
Perhaps. would it plenty plainer in the (known?!) Spoolverzeichnis to ("den") Files look and these impudent einzuladen and instr... - 100% reliably is the but then naturally not. |
|
|
| |
|
|
|
| [OFFTOPIC] E.T. (17.11.10)[OFFTOPIC]@IF: würd I Yes make, if I selbige not forget had...[/OFFTOPIC] simply date of birth with Password and the Username is the Domainname - So how with eachone good Domain! [/OFFTOPIC] |
|
|
| |
|
|
|
Rolf Koch | @iF - thanks first times for whom Anstoss. @Mario - the what then there drin standing, the wisely I Yes, because i will Yes How iF by instr rausfiltern and if gewisse Textpassagen o.ä. present, then is it my File. |
|
|
| |
|
|
|
Rolf Koch | where it another Possibility were. because I herausfinde, whether the document on the Printer athwart or Hochkant is. because the important document is the only, which athwart ankommt. |
|
|
| |
|
|
|
| in the job_info_2 [...] Gibts DevMode [...] and there Gibts Orientation - could means klappen! |
|
|
| |
|
|
|
Rolf Koch | OK thanks you for Info. Oje The is Yes vast and straight I should the umsetzen. Phew. Well time look ^^ |
|
|
| |
|
|
|
E.T. | Rolf Koch (18.11.10)
... Oje The is Yes vast and straight I should the umsetzen. ...
Yes, straight DU should the umsetzen, because You you Yes otherwise too not at all To help points... |
|
|
| Grüße aus Sachsen... Mario WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte... | 11/18/10 ▲ |
|
|
|
|
Rolf Koch | LOL - ought to Yes really something like mean: I sucker, I werd me still certainly again verfranzen. I stand very often with Api's on Kriegsfuss, vorallem if the parts so ellenlang are. alas alike irgenwann falls me what a, How I the hinterlistige part of printer überliste |
|
|
| |
|
|
|
E.T. | Kannste not time so NEN Druckauftrag (File) post ?? time one "leeres Formular" To you send let.... The special data would Yes none interested. only The rel. data, which ausgewertet should, are so too interestingly, How these in the "zu-druckenden-Datei" stand.
[OFFTOPIC]Häng strain drann, nem MultiEdit single Lines hinzuzufügen, thought, the goes by AddStrings in the X2-R1, but pustekuchen...[/OFFTOPIC] |
|
|
| Grüße aus Sachsen... Mario WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte... | 11/19/10 ▲ |
|
|
|
|
Rolf Koch | Tjo if I on The File rankäme. this is Yes not the trouble, I wisely Yes already which Strings I to that filtern using would. what kind of leeres form? This will in the application with the data generiert somewhere, sometime u.s.w. The Programmer werd I well never ask can, The sit somewhere well in the Busch i'll never Info get - know certainly The EDV Clauses in Grossfirmen. is indeed alike. thanks you first once, so How I it see, there no simple thing on whom Text heranzukommen, so as though is a File opens and a variable schmeist. Have I in the meantime eingesehen. |
|
|
| |
|
|
|
| @Rolf: Perhaps. can You obigen View source something complete so it runs, Landscape then herausbekommen is then integrally simply. ^^ |
|
|
| |
|
|
|
Rolf Koch | Have time adjusted. this is even well so, because then can You iF discern, Why XPSE over some things schimpft. How z.B. OpenprinterA. with reinem Profan runs it correct. CompileMarkSeparation'Druck erkennen
'Quelltext grosse Teile von Andreas Miethe!!!
Set("Errorlevel",0)
$H Windows.ph'evtl. anpassen
DEF Get_STDPrinter(1) Substr$(ReadIni$("WIN.INI","Windows","Device"),@&(1),",")
Var InfoBuffer& = 0
Var Spool& = ImportDll("Winspool.drv","")
cls
DEF &PRINTER_CHANGE_JOB $FF00
DEF &INFINITE $FFFFFFFF
DEF &PRINTER_CHANGE_ADD_JOB $100
Declare JOB_INFO_1#
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
Declare druckername$,dokument$,dstring$
Var Printer$ = Get_STDPrinter(1)
OpenPrinterA(Addr(Printer$),Addr(hPrinter&),0)
chgObject& = FindFirstPrinterChangeNotification(hPrinter&,&PRINTER_CHANGE_JOB, 0, 0)
Declare Ende%,lb&,old_count&,entry$,sounddir$,lizenz$
Declare hicon&,cancel&,Title$,Version$,config$
Declare wav$,dateipfad$,belege$,wurde$,new$,abelege%
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.
WindowStyle 64
Window 0,0-800,800
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,1,0,0,Addr(BytesNeeded&),Addr(BytesReturned&))
Dim JOB_INFO_1#,BytesNeeded&
Repeat
EnumJobsA(hPrinter&,0,1,1,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
Endif
Until BytesReturned& = 0
if foundprint&=1
'print dokument$
'print dstring$
if dokument$=dstring$
'playsound sounddir$+"doorbell.wav",1 'HIER SOUNDAUSGABE
PRINT "Jetzt würde der Lautsprecher Dingdong spielen"
endif
endif
endif
Endif
endwhile
FindClosePrinterChangeNotification(chgObject&)
ClosePrinter(hPrinter&)
end
|
|
|
| |
|
|