| |
|
|
- 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 5 - |
|
|
« 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 ▲ |
|
|
|
|
|
Rolf Koch | unfortunately is the Topic still not Done. everything else on the work understands it beautiful, of because of athwart and Hochformat. except very this part I discern must, remaining with others Print out same and writes: Hochformat. means must I still another Solution find, How Content reading or so |
|
|
| |
|
|
|
Rolf Koch | Nachtrag: where I do not wisely, as then the Landscape produce and print in the application. be me on the druchkämpfen into Api's. Irgendwas must it give circa to get, with same cover something different in the Druckdokument to find. there's still really nothing, what not goes, or? |
|
|
| |
|
|
|
| i know now not ad hoc How big The DevMode But vlt. could You time Dumps of it Blockwriten as well as from the JobInfo1..3-Save.
the klärt imho of course not the Reading the Druckersteuerzeichen but helps hold at Compare. |
|
|
| |
|
|
|
Rolf Koch | I werd yet insane. new Problem, though the program in the form since langer Time runs. Program launch in the morning circa 09:00 and to that 3ten time I get so circa 19:00 watch a Message: Memory-Variable not dimensioniert. comic. there's Yes only a Memory-Variable and the is dimensioniert. code lying Yes here to. but Why to so langer Time? I set Yes a Timer on 50. whether it was of these To do has? would be unlogisch, but possible is everything. it'll too no Dispose used, lt. Help permits, it'll means always new Dim using. but whether it vlcht. on it lying? |
|
|
| |
|
|
|
| Rolf Koch (23.11.10)
I werd yet insane.
Haha!
Rolf Koch (23.11.10)
new Problem, though the program in the form since langer Time runs.
The previous Version or The Neuere?
Rolf Koch (23.11.10)
Program launch in the morning circa 09:00 and to that 3ten time I get so circa 19:00 watch a Message: Memory-Variable not dimensioniert. comic. there's Yes only a Memory-Variable and the is dimensioniert. code lying Yes here to. but Why to so langer Time?
in the code standing Dim JOB_INFO_1#,BytesNeeded& - if BytesNeeded& 0 is?
because drop would I abprüfen. |
|
|
| |
|
|
|
Rolf Koch | The new version. but can it 0 his? - because Yes there already one Druckauftrag vorliegt. |
|
|
| |
|
|
|
| its standing imho not written the there always values > 0 arrive. ^^
The Message anyway can with: CompileMarkSeparation"provozieren". |
|
|
| |
|
|
|
Rolf Koch | Aja, strain time in the Taskmanager watch. always if one pressure recognized watts and is done, so soar the memory circa mind. 4k ??? Do I well still something enable. |
|
|
| |
|
|
|
Rolf Koch | is correct iF The Message comes. Should I means another if drumrumbasteln, if bytesneeded = 0lig is ^^ |
|
|
| |
|
|
|
| Rolf Koch (23.11.10)
Aja, strain time in the Taskmanager watch. always if one pressure recognized watts and is done, so soar the memory circa mind. 4k ??? Do I well still something enable.
in the obigen code standing the Dim in the Hauptprogramm where The zugehörige Variable only 1time declared and always famous is - if you the in the actual Program but in a function run out can then missing naturally one dispose. ^^ |
|
|
| |
|
|
|
Rolf Koch | the Dim and the Variable becomes Yes only Hauptprogramm used. Obiger code is almost the identische. Since there not More plenty More. |
|
|
| |
|
|
|
Rolf Koch | |
|
| |
|
|