/// <summary> /// The FindNextPrinterChangeNotification function retrieves information about the most recent change notification for a /// change notification object associated with a printer or print server. Call this function when a wait operation on the /// change notification object is satisfied. /// The function also resets the change notification object to the not-signaled state. You can then use the object in another /// wait operation to continue monitoring the printer or print server. The operating system will set the object to the signaled /// state the next time one of a specified set of changes occurs to the printer or print server. The FindFirstPrinterChangeNotification /// function creates the change notification object and specifies the set of changes to be monitored /// </summary> /// <param name="hChange">Handle to a change notification object associated with a printer or print server. You obtain such a handle by /// calling the FindFirstPrinterChangeNotification function. The operating system sets this change notification object /// to the signaled state when it detects one of the changes specified in the object's change notification filter</param> /// <param name="pdwChange">A variable whose bits are set to indicate the changes that occurred to cause the most recent /// notification. The bit flags that might be set correspond to those specified in the fdwFlags parameter of the /// FindFirstPrinterChangeNotification call</param> /// <param name="pPrinterNotifyOptions">A PRINTER_NOTIFY_OPTIONS structure. Set the Flags member of this structure to PRINTER_NOTIFY_OPTIONS_REFRESH, /// to cause the function to return the current data for all monitored printer information fields. The function ignores all other members of the structure. This parameter can be null</param> /// <param name="ppPrinterNotifyInfo">Pointer to a pointer variable that receives a pointer to a system-allocated, read-only buffer. /// Call the FreePrinterNotifyInfo function to free the buffer when you are finished with it. This parameter can be null if no information is required</param> /// <returns>If the function succeeds, the return value is true, else false</returns> public static bool FindNextPrinterChangeNotification([In] IntPtr hChange, out PrinterChangeStatus pdwChange, [In] PrinterNotifyOptions pPrinterNotifyOptions, ref IntPtr ppPrinterNotifyInfo) { return(Native.FindNextPrinterChangeNotification(hChange, out pdwChange, ppPrinterNotifyInfo, ref ppPrinterNotifyInfo)); }
public static extern bool FindNextPrinterChangeNotification([In] IntPtr hChange, out PrinterChangeStatus pdwChange, [In] PrinterNotifyOptions pPrinterNotifyOptions, ref IntPtr ppPrinterNotifyInfo);
public static extern IntPtr FindFirstPrinterChangeNotification([In] IntPtr hPrinter, PrinterChangeStatus fdwFlags, uint fdwOptions, [MarshalAs(UnmanagedType.LPStruct)] PrinterNotifyOptions pPrinterNotifyOptions);
/// <summary> /// The FindFirstPrinterChangeNotification function creates a change notification object and /// returns a handle to the object. You can then use this handle in a call to one of the wait /// functions to monitor changes to the printer or print server. /// The FindFirstPrinterChangeNotification call specifies the type of changes to be monitored. /// You can specify a set of conditions to monitor for changes, a set of printer information /// fields to monitor, or both /// </summary> /// <param name="hPrinter">Handle to the printer or print server that you want to monitor. Use the /// OpenPrinter or AddPrinter function to retrieve a printer handle</param> /// <param name="fdwFlags">Specify the conditions that will cause the change notification object to /// enter a signaled state. A change notification occurs when one or more of the specified conditions /// are met. The fdwFlags parameter can be zero if pPrinterNotifyOptions is non-null</param> /// <param name="fdwOptions">Reserved; must be zero</param> /// <param name="pPrinterNotifyOptions">A PRINTER_NOTIFY_OPTIONS structure. The pTypes member of this structure /// is an array of one or more PRINTER_NOTIFY_OPTIONS_TYPE structures, each of which specifies a printer information field to monitor. /// A change notification occurs when one or more of the specified fields changes. When a change occurs, the /// FindNextPrinterChangeNotification function can retrieve the new printer information. This parameter can be null if fdwFlags is nonzero</param> /// <returns>If the function succeeds, the return value is a handle to a change notification object associated with the specified printer or print server, /// If the function fails, the return value is invalid handle.</returns> public static IntPtr FindFirstPrinterChangeNotification([In] IntPtr hPrinter, PrinterChangeStatus fdwFlags, uint fdwOptions, [MarshalAs(UnmanagedType.LPStruct)] PrinterNotifyOptions pPrinterNotifyOptions) { return(Native.FindFirstPrinterChangeNotification(hPrinter, fdwFlags, fdwOptions, pPrinterNotifyOptions)); }