locked
Monitoring Printer Devices in the Metro App

    Question

  • Hello.

    I'm Daniel Park and working as software engineer.

    I have some questions about background task on windows 8 to monitor status of printing devices.

    I've been testing background tasks for Metro UI because I need to implement monitoring metro app to check printing status when user print out something via installed printers. To implement this part, I think background task can be used to polling printing devices and show toast messages if there are critical errors by firing some triggers.

    I've faced some issues with this feasibility. My initial plan is that I think background task for monitoring printer devices can be fired by TimerTrigger or SessionStart Trigger and then the task is running as a thread to check device and show Toast messages if there is critical device errors. And then it’s terminated if the printing job is finished by checking device status.

    First of all, minimum configuration of TimerTigger is 15 min. so that it cannot be used to monitor device in real time. If I can use this TimerTigger with more specific time such as 500 milliseconds, when printing is fired, printer driver call immediately the background task which monitor devices during printing. Anyway, it’s impossible with current implementation of Windows 8.

    Second, I try to use SesstionStart trigger to monitor printing device whenever starting user session, but it's not working in the C# example for background task when trigger part is only changed and toast messages in the background task. (It’s possible to miss something by me). In detail, I've modified SystemTrigger to SystemTriggerType.SessionStart and change notifications settings of toast capable from No to Yes and Lock Screen notification from "Title Text" to "Badge and Tile Text".  And then I've added code to show Toast message in the background task but Toast message is not showing after logging off and logging in again. But if it’s possible to monitor devices by SessionStart, it seems it’s not good way because background task can be running always (if windows 8 keep it alive).

    I think the best ways to monitor printing device during printing is that Windows 8 supports printing job status trigger as system trigger such as PrintingStart, PrintingComplete or PrinterStateChange that  make it easier to check up the printing device status during printing so that I think running time for background task for that purpose can be optimized.

    If all above items are impossible in the metro App and its environment, please let me know how to implement it by some different ways or workarounds such as using communication between windows services (or normal daemon processes) and metro Apps if possible.

    I would be very appreciated if you could help me about above issues.

     

    • Edited by Host_Driver Monday, November 14, 2011 7:04 AM
    Monday, November 14, 2011 7:03 AM

Answers