找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 713|回复: 2

[求助] [求助]:SHELL 如何在后台隐藏运行?

[复制链接]
发表于 2005-4-23 16:44:50 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
SHELL 如何在后台隐藏运行?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2005-4-24 20:08:29 | 显示全部楼层
你可以利用wscript的shell, 可以通过activeX口调用。具体可以参考windows script host的资料。

函数原型:
WshShell.Run(strCommand[, [intWindowStyle][, bWaitOnReturn]])

intWindowStyle可以选的值。所谓的后台运行就是Hide吧。
0 vbHide Hides the window. Another window is activated (is shown and gets the focus).
1 vbNormalFocus Activates the window and shows it. If the process is already active and the window is minimized or maximized, the previous size and position are restored.
2 vbMinimizedFocus Activates the window and minimizes it. The button on the taskbar receives the focus.
3 vbMaximizedFocus Activates the window, maximizes it, and gives it the focus.
4 vbNormalNoFocus Displays a window in its most recent size and position. The active window remains active.
5  Activates the window in its current size and position.
6 vbMinimizedNoFocus Minimizes the window and activates the next top-level window in the z-order.
7  Displays the window as an icon (minimized). The active window remains active.
8  Displays the window in its current state. The active window remains active.
9  Activates and displays the window. If a window is minimized or maximized, Windows restores the original size and position. An application should specify this flag when restoring a minimized window. (This parameter can't be used with the Run method.)
10  Sets the show state based on the state of the program that started the application.

给个例子:


  1.   [FONT=courier new]
  2. (setq shell (vlax-create-object "WScript.shell"))
  3. ;; 注,在Windows 9x中calc.exe程序不在本示例中的位置,而在"%WINDIR%\\Calc.exe"
  4. (vlax-invoke-method shell 'run "%WINDIR%\\system32\\Calc.exe" 1 :vlax-true)
  5. (vlax-invoke-method shell 'run "%COMSPEC% /c copy c:\\aaa.lsp c:\\bbb.lsp" 0 :vlax-false)
  6. (vlax-release-object shell)
  7.   [/FONT]
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2005-4-24 20:23:52 | 显示全部楼层
可以简单吗??
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-5-25 07:12 , Processed in 0.354772 second(s), 35 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表