none
HOOK EnumPrinters——hide the other printers RRS feed

  • 问题

  • I want control the printers list, make it just show my printer.

    I try to hook the EnumPrinters of winspool.drv global by the open source Mhook library, but it just effective in my Demo and the WPS office,noneffective in the Application of Windows such as Notepad.exe、IE。

    And I discover my hook is effective in Notepad and IE, but it still could show all the printers even if I just return my printer in the EnumPrinters。

    Is there other method to enumerate the printers after the EnumPrinters in Notepad.exe ? 

    Who can help me? thank you very much.


    2014年6月26日 10:15

答案

  • Hi,

    How did you write the hook code? Do you mean that when you hook EnumPrinters, you can get the speficied printer in your demo but get all the available printers in Notepad and IE? If like this, how about tring to use GetPrinter function instead of EnumPrinters, which retrieves information about a specified printer.

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年6月30日 7:53

全部回复

  • Is there anybody who knows?

    This troblem bothering me for a long time...

    2014年6月27日 2:59
  • Hi,

    How did you write the hook code? Do you mean that when you hook EnumPrinters, you can get the speficied printer in your demo but get all the available printers in Notepad and IE? If like this, how about tring to use GetPrinter function instead of EnumPrinters, which retrieves information about a specified printer.

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年6月30日 7:53
  • Were you able to resolve this?
    2016年8月17日 13:57
  • I am also stuck with this problem for a while.

    There are two dll prncache and prnfldr which are server and client. The server fills the cache. and notepad and IE picks up the list from there.

    But the problem remains the same the server also uses EnumPrinters but that does not work.

    2016年9月15日 15:15