网站首页  词典首页

请输入您要查询的函数:

 

术语 shutdownblockreasoncreate
释义 ShutdownBlockReasonCreate
语法:
C++
BOOL WINAPI ShutdownBlockReasonCreate(
__in HWND hWnd,
__in LPCWSTR pwszReason
);
ShutdownBlockReasonCreate功能
表明,该系统不能被关闭,并设置一个原因字符串显示给用户,如果系统关机启动。
参数
hWnd [in]
一个句柄,应用程序的主窗口。
pwszReason [in]
之所以应用程序必须阻止系统关闭。此字符串将被截断,用于显示的字符后MAX_STR_BLOCKREASON。
返回值
如果调用成功,则返回值为非零值。
如果调用失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
此功能只能调用的线程创建的hWnd参数指定的窗口。否则,函数失败,最后错误代码为ERROR_ACCESS_DENIED。
应用程序应该调用这个函数,因为他们开始如刻录CD或DVD的,不能中断操作。当操作完成,函数调用ShutdownBlockReasonDestroy表明该系统可以被关闭。
因为用户并不急于通常是在关闭系统,他们可能仅在关机是由系统显示的原因后几秒钟。因此,重要的是您的理由字符串短,明确的。例如“A CD刻录的。”进行中较“此应用程序阻止系统关闭,因为CD刻录正在进行中。不要关闭。”
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinuser.h(头文件:winuser.h)
LibraryUser32.lib
DLLUser32.dll
参见
ShutdownBlockReasonDestroy
关机
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==ShutdownBlockReasonCreate Function
Indicates that the system cannot be shut down and sets a reason string to be displayed to the user if system shutdown is initiated.
Syntax
C++
BOOL WINAPI ShutdownBlockReasonCreate(
__in HWND hWnd,
__in LPCWSTR pwszReason
);
Parameters
hWnd [in]
A handle to the main window of the application.
pwszReason [in]
The reason the application must block system shutdown. This string will be truncated for display purposes after MAX_STR_BLOCKREASON characters.
Return Value
If the call succeeds, the return value is nonzero.
If the call fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
This function can only be called from the thread that created the window specified by the hWnd parameter. Otherwise, the function fails and the last error code is ERROR_ACCESS_DENIED.
Applications should call this function as they begin an operation that cannot be interrupted, such as burning a CD or DVD. When the operation has completed, call the ShutdownBlockReasonDestroy function to indicate that the system can be shut down.
Because users are typically in a hurry when shutting down the system, they may spend only a few seconds looking at the shutdown reasons that are displayed by the system. Therefore, it is important that your reason strings are short and clear. For example "A CD burn is in progress." is better than "This application is blocking system shutdown because a CD burn is in progress. Do not shut down."
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinuser.h (include Windows.h)
LibraryUser32.lib
DLLUser32.dll
See Also
ShutdownBlockReasonDestroy
Shutting Down
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa376877(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:17:30