Forum | | | | - 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 4 - |
| | « 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: where should XPSE because OpenPrinterA kennen, if nirgends in the code definiert?
in the code go first if it launched is by ImportDll("Winspool.drv","") these APIs invited, these engineering can xpse technical not "unterstützen" there it not "vorher" know can which Apis on one sometime-somewhere-Zielsystem present his go. moreover comes thats DLL well not everywhere permanent loaded is and therefore with specified $h winspool.ph nevertheless The Funktionsadressen not bezogenen go can - I füge these DLL as such Spezialdll into this angelegte interne list the XPSE so too such functions correctly eingebunden (and calls... ) and used go can. to remedy bliebe here otherwise only one useDll and Funktionsaufrufe of functions from this DLL by external or def...
there missing too somehow one if in the code...
I login me ifs me succeed whom code... |
| | | | |
| | | Try time whether you the helps: 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 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)
drv$=string$(devmoaddr&,0)
Endif
Until BytesReturned& = 0
if foundprint&=1
print dokument$
print dstring$
print drv$
print test&,wi&,he&
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
|
| | | | |
| | Rolf Koch | thanks iF - yes a if can are missing in the Eifer the Kopiergeschichte ^^ Kucke then later to, now same first to a Pyracanda Reunion Konzert (20 Years Later - The Metalband, where I time mitgespielt have ^^) Freu. |
| | | | |
| | | | | | | |
| | Rolf Koch | 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 ^^ |
| | | | |
| | | by me zeigts always 0,2900,2100 - well wide, Höhe - depends but of printer(driver/ processor/ Irgendwas / high3) ex.
Have on info2 changed but without Variable umzubenennen, deference! |
| | | | |
| | 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 ▲ |
| |
| | | 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
is correct+flip!
super, now funktionierts! |
| | | | |
| | Rolf Koch | WOW same right time testing - Andreas thanks!!! I faith Andreas ought to time slow whom DOKTOR XPROFAN EHRENHALBER verliehen get |
| | | | |
| | | Rolf Koch (20.11.10)
WOW same right time testing - Andreas thanks!!! I faith Andreas ought to time slow whom DOKTOR XPROFAN EHRENHALBER verliehen get
be already thereby this the Community beizubringen/ einzuprogrammieren! |
| | | | |
| | Rolf Koch | Nachtrag: i'm full up delighted - horny! it works inspired! Go! any scream: Andreas get whom Ehrendoktor XPROFAN! and for everything else I will another person as Ehrendoktor for XPROFAN - who well? clear iF!!!! |
| | | | |
| | | | | | | |
|
AnswerTopic-Options | 47.134 Views |
Themeninformationenthis Topic has 4 subscriber: |