4.4 AsyncUI Notification in Bidirectional Communication Mode

This section presents an example of processing an AsyncUI notification in bidirectional communication mode. In this example, a printer driver uses the notification type identifier value AsyncPrintNotificationType_AsyncUI (section 2.2.1) to request the client to display a message box containing multiple buttons. The client then sends back a response identifying the selected button.

All text within the message box is identified by using references to a string resource contained within a client-resident resource file.

Processing an AsyncUI notification in bidirectional communication mode

Figure 15: Processing an AsyncUI notification in bidirectional communication mode

Sample notification:

 <asyncPrintUIRequest xmlns=
 "http://schemas.microsoft.com/2003/print/asyncui/v1/request">
  <v1>
   <requestOpen>
    <messageBoxUI>
     <title stringID="100" resourceDll="IHV.dll" />
     <body stringID="101" resourceDll="IHV.dll" />
     <buttons>
      <button stringID="102" resourceDll="IHV.dll" buttonID="3"/>
      <button stringID="103" resourceDll="IHV.dll" buttonID="4"/>
     </buttons>
    </messageBoxUI>
   </requestOpen>
  </v1>
 </asyncPrintUIRequest>
  

Sample response:

 <asyncPrintUIResponse xmlns=
 "http://schemas.microsoft.com/2003/print/asyncui/v1/response">
  <v1>
   <requestClose>
    <messageBoxUI>
     <buttonID>4</buttonID>
    </messageBoxUI >
   </requestClose>
  </v1>
 </asyncPrintUIResponse>