XPS Sample Driver question
- Hi,I am trying to modify xpsdrvsmpl to call another program shortly after the documentstarts to "print". Where would be the best place to place the CreateProcess or ShellExecutecall so that it only executes once? ThanksRandy
답변
- Hi!
You can to this in the User Interface DLL. see http://msdn.microsoft.com/en-us/library/bb734121.aspx with the DOCUMENTEVENT_STARTDOC event.
- 답변으로 표시됨rjenovai 2009년 10월 22일 목요일 오후 6:01
- I got it to work after adding the following to DOCUMENTEVENT_QUERYFILTER:
I also made sure that piResult was not set as an unreferenced parameterif (pvOut) { DOCEVENT_FILTER* pFilter = (DOCEVENT_FILTER*)pvOut; pFilter->cElementsReturned = 6; pFilter->aDocEventCall[0] = DOCUMENTEVENT_ENDDOCPOST; pFilter->aDocEventCall[1] = DOCUMENTEVENT_STARTDOC; pFilter->aDocEventCall[2] = DOCUMENTEVENT_ENDDOC; pFilter->aDocEventCall[3] = DOCUMENTEVENT_STARTPAGE; pFilter->aDocEventCall[4] = DOCUMENTEVENT_ENDPAGE; pFilter->aDocEventCall[5] = DOCUMENTEVENT_XPS_ADDFIXEDDOCUMENTSEQUENCEPOST; *piResult = DOCUMENTEVENT_SUCCESS; ret = DOCUMENTEVENT_SUCCESS; } else { *piResult = DOCUMENTEVENT_UNSUPPORTED; ret = E_NOTIMPL; }
Once these were added, the STARTDOC, ENDDOC, etc.. events were fired in windows x64.- 답변으로 표시됨rjenovai 2009년 10월 22일 목요일 오후 6:01
모든 응답
- Hi!
You can to this in the User Interface DLL. see http://msdn.microsoft.com/en-us/library/bb734121.aspx with the DOCUMENTEVENT_STARTDOC event.
- 답변으로 표시됨rjenovai 2009년 10월 22일 목요일 오후 6:01
- This worked well until I tried to move my driver to 64-bit vista and windows 7. It appears that the STARTDOC and ENDDOC events
are not being called. Is this true and if so what can I do to workaround? Thanks
Randy - I got it to work after adding the following to DOCUMENTEVENT_QUERYFILTER:
I also made sure that piResult was not set as an unreferenced parameterif (pvOut) { DOCEVENT_FILTER* pFilter = (DOCEVENT_FILTER*)pvOut; pFilter->cElementsReturned = 6; pFilter->aDocEventCall[0] = DOCUMENTEVENT_ENDDOCPOST; pFilter->aDocEventCall[1] = DOCUMENTEVENT_STARTDOC; pFilter->aDocEventCall[2] = DOCUMENTEVENT_ENDDOC; pFilter->aDocEventCall[3] = DOCUMENTEVENT_STARTPAGE; pFilter->aDocEventCall[4] = DOCUMENTEVENT_ENDPAGE; pFilter->aDocEventCall[5] = DOCUMENTEVENT_XPS_ADDFIXEDDOCUMENTSEQUENCEPOST; *piResult = DOCUMENTEVENT_SUCCESS; ret = DOCUMENTEVENT_SUCCESS; } else { *piResult = DOCUMENTEVENT_UNSUPPORTED; ret = E_NOTIMPL; }
Once these were added, the STARTDOC, ENDDOC, etc.. events were fired in windows x64.- 답변으로 표시됨rjenovai 2009년 10월 22일 목요일 오후 6:01

