zoukankan      html  css  js  c++  java
  • SetProcessShutdownParameters

    1. msdn介绍:

    http://msdn.microsoft.com/en-us/library/ms686227(v=vs.85).aspx

    Sets shutdown parameters for the currently calling process. This function sets a shutdown order for a process relative to the other processes in the system.

    Syntax

    BOOL WINAPI SetProcessShutdownParameters(
    __in DWORD dwLevel,
    __in DWORD dwFlags
    );

    dwLevel [in]

    The shutdown priority for a process relative to other processes in the system. The system shuts down processes from high dwLevel values to low. The highest and lowest shutdown priorities are reserved for system components. This parameter must be in the following range of values.

    All processes start at shutdown level 0x280.

    ValueMeaning
    000-0FF

    System reserved last shutdown range.

    100-1FF

    Application reserved last shutdown range.

    200-2FF

    Application reserved "in between" shutdown range.

    300-3FF

    Application reserved first shutdown range.

    400-4FF

    System reserved first shutdown range.

    dwFlags [in]

    This parameter can be the following value.

    ValueMeaning
    SHUTDOWN_NORETRY
    0x00000001

    The system terminates the process without displaying a retry dialog box for the user.

    ——————————————————————————————————————————————————————————————

    2. 个人理解

     该函数设置了进程相对于其它进程的关闭优先级。 系统关闭进程时会从dwLevel值高的开始,按从高到低的顺序关闭。最高和最低的关闭优先级留给了系统组件,dwLevel值必须在制定的范围内取值。

    所有进程启动时默认的关闭优先级为0x280.

    SHUTDOWN_NORETRY  设置了系统关闭进程时对用户不显示retry的重试窗口。

    如果在进程A中调用该函数,则可以设置该进程的退出优先级。,所以可以如果该进程中执行了关机等命令,从而可以影响到其他进程的退出。


     

  • 相关阅读:
    Linux下新建服务
    查看MYSQL日志(包含最近锁表日志)
    Linux后台运行进程
    MYSQL分析慢查询
    Linux下打开超大文件方法
    通过文件列表打包文件
    linux学习笔记<基本知识普及>
    虚拟机的安装
    Android NDK编程,引入第三方.so库
    linux下软件安装与卸载
  • 原文地址:https://www.cnblogs.com/rainduck/p/2160523.html
Copyright © 2011-2022 走看看