求助!关于Shell运行一个应用程序不能窗口最小化运行的问题

gcx1103 2003-10-10 04:15:37
请教:我用SHELL函数运行一个应用程序后,选择SHELL函数的第二个参数让程序窗口最小化运行,可是不管用。无论怎么选参数值该程序总是窗口最大化运行。有别的方法让它最小化(最好隐藏运行)吗?
...全文
137 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
flc 2003-10-11
  • 打赏
  • 举报
回复
学习
sunliangchao 2003-10-10
  • 打赏
  • 举报
回复
问题的关键不在与此,那个程序要输入一些信息才能进入,这个基本信息你不输入,怎么打开他?我看你还是仔细研究一下这个程序是否可以有命令行参数.
rainstormmaster 2003-10-10
  • 打赏
  • 举报
回复
用ShellExecute估计也解决不了你的问题:)

声明:
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
返回值:
Long,非零表示成功,零表示失败。会设置GetLastError
参数:
hwnd ----------- Long,指定一个窗口的句柄,有时候,windows程序有必要在创建自己的主窗口前显示一个消息框

lpOperation ---- String,指定字串“open”来打开lpFlie文档,或指定“Print”来打印它

lpFile --------- String,想用关联程序打印或打开一个程序名或文件名

lpParameters --- String,如lpszFlie是可执行文件,则这个字串包含传递给执行程序的参数

lpDirectory ---- String,想使用的完整路径

nShowCmd ------- Long,定义了如何显示启动程序的常数值。参考ShowWindow函数的nCmdShow参数

用法:
ShellExecute me.hwnd,"open","http://www.csdn.net",vbNullString,vbNullString,3
rainstormmaster 2003-10-10
  • 打赏
  • 举报
回复
程序一开始就有INPUTBOX,是不是和这个有关系

应该是

用全局钩子钩之
gcx1103 2003-10-10
  • 打赏
  • 举报
回复
用vbhide参数也不行,我试过了。我运行的是一个MDI应用程序,程序一开始就有INPUTBOX,是不是和这个有关系?有谁能介绍一下ShellExecute函数的用法吗?
betagain 2003-10-10
  • 打赏
  • 举报
回复
Shell(pathname[,windowstyle])

The windowstyle named argument has these values:

Constant Value Description
vbHide 0 Window is hidden and focus is passed to the hidden window.
vbNormalFocus 1 Window has focus and is restored to its original size and position.

vbMinimizedFocus 2 Window is displayed as an icon with focus.
vbMaximizedFocus 3 Window is maximized with focus.
vbNormalNoFocus 4 Window is restored to its most recent size and position. The currently active window remains active.

vbMinimizedNoFocus 6 Window is displayed as an icon. The currently active window remains active.
xiaobird1 2003-10-10
  • 打赏
  • 举报
回复
设定第二个参数为:vbHide

Shell "c:\1.exe", vbHide

应该没问题的。

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧