大网数据广告活动
打印与设备

How To: Display the Print Job Progress

· 52CE 我爱测

This topic describes how to display the print job progress to the user and give them the option to cancel a print job that is currently in progress.

This topic describes how to display the print job progress to the user and give them the option to cancel a print job that is currently in progress.

Overview

A print progress dialog procedure typically performs the following functions.

  • Display print job progress to the user.
  • Start the print processing thread.
  • Display a Cancel button so the user can stop a print job before it finishes.

Strictly speaking, the only thing that the print progress dialog box procedure must do is display the print job progress to the user. However, because the other two functions in the preceding list are closely related, they have also been included in this module.

Displaying Print Job Progress

A print progress dialog box procedure handles the following window messages.

  • WM_INITDIALOG

    Initializes the controls that the dialog box uses.

  • WM_SETCURSOR

    Sets the cursor to a pointer when the user is able to cancel a print job, and to the wait cursor when the print job is at a point where it cannot be cancelled.

  • USER_PRINT_START_PRINTING

    Sets the progress bar parameters for the print job, and creates the printing thread to start processing the print job.

    This is an application-specific window message.

  • WM_COMMAND - IDCANCEL

    Sets the cancel event to tell the print processing thread to cancel the print job.

  • USER_PRINT_STATUS_UPDATE

    Updates the progress bar and status text to show the current state of the print job.

    This is an application-specific window message.

  • USER_PRINT_CLOSING

    Sets the closing status text in the progress dialog box to indicate that the print job is closing.

    This is an application-specific window message.

  • USER_PRINT_COMPLETE

    Displays the "Print job complete" message to the user, and releases handles and events that were used in this print job.

    This is an application-specific window message.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。