windowsvb:如何在VB中终止Windows系统来源: 发布时间:星期四, 2009年2月12日 浏览:116次 评论:0
在visual basic 程 序 中 ![]() ![]() ![]() 可 以 使 用windows api ![]() ![]() ![]() ![]() private declare function exitwindowsex lib \"user32\" (byval uflags as long, byval dwreserved as long) as long exitwindowsex 函 数 需 要2 个 参 数 ![]() ![]() ![]() ![]() ![]() ewx_force 所 有 ![]() ![]() ewx_logoff 所 有 ![]() ![]() ![]() ewx_poweroff 计 算 机 系 统 被 关 机 ![]() ![]() ![]() ewx_reboot 计 算 机 系 统 被 关 机 并 重 新 启 动 ![]() ewx_shutdown 计 算 机 被 物 理 地 安 全 地 关 机 ![]() 下 面 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 样 例 程 序 该 样 例 程 序 显 示 了 如 何 关 闭 计 算 机 系 统 ![]() 1. 在visual basic 中 开 始 ![]() ![]() ![]() ![]() ![]() 2. 将 如 下 常 量 和 声 明 语 句 添 加 到form1 ![]() ![]() private declare function exitwindowsex lib \"user32\" (byval uflags as long, byval dwreserved as long) as long const ewx_logoff = 0 const ewx_shutdown = 1 const ewx_reboot = 2 const ewx_force = 4 const ewx_poweroff = 8 const ewx_re ![]() 3. 在form1 上 添 加 ![]() ![]() ![]() ![]() ![]() ![]() 4. 将 如 下 代 码 添 加 到command1 ![]() private sub command1_click ![]() dim x as long x = exitwindowsex(ewx_re ![]() end sub 按 下f5 来 运 行 上 述 样 例 程 序 ![]() ![]() ![]() 0
相关文章
读者评论发表评论 |