运行特定命令时是否可以隐藏MessageBox? [英] Is it possible to suppress MessageBox when running a specific command?

查看:54
本文介绍了运行特定命令时是否可以隐藏MessageBox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Tortoise SVN和TortoisePlink进行远程ssh连接.TortoisePlink有时会显示如下错误:

I'm using Tortoise SVN, and TortoisePlink for remote ssh connections. From time to time TortoisePlink is displaying errors like:

---------------------------
TortoisePlink Fatal Error
---------------------------
Network error: Software caused connection abort
---------------------------
OK   
---------------------------

它们显示为消息框,需要最终用户单击.

And they appears as messagebox and needs to be clicked by end-user.

我试图通过从命令行使用-batch来禁止显示消息框,但是问题仍然可以重现.对我来说,如果我禁用消息框提示并在命令行中打印例如相同的信息就足够了-因为我的批处理稍后会自动重试.

I have tried to suppress messagebox by using -batch from command line, but problem still can be reproduced. For me it's sufficient if I'll disable messagebox prompting and print for example in command line same information - since my batch will retry later on again automatically.

是否存在可以覆盖默认Windows行为并在控制台窗口中打印出消息框中显示内容的软件.

Does there exists such software which can override default windows behavior and print in console window whatever is displayed in message box.

我想用最简单的话来说,这样的命令行工具很容易创建,例如使用

I guess in simplest terms such command line tool can be easily created, using for example

http://www.codeproject.com/Articles/44326/MinHook-The-Minimalistic-xx-API-Hooking-Libra

并重写MessageBoxA/MessageBoxW-但是有人做过这种事情吗?

and override MessageBoxA / MessageBoxW - but have anyone done this kind of thing ?

推荐答案

我认为您正在以错误的方式进行操作.与其尝试隐藏TortoisePlink显示的对话框,不如使用原始Plink .TortoisePlink是Plink的一个分支,用于显式显示消息框并在命令行上打印任何内容,因为它是为UI应用程序而非控制台应用程序设计的.

I think you're going about this the wrong way. Instead of trying to suppress the dialog boxes that TortoisePlink is showing, use the original Plink. TortoisePlink is a fork of Plink to explicitly show message boxes and not print anything on a command line, because it's designed for an UI app and not for console apps.

如果您真的只想从批处理文件中使用svn,请不要使用TortoiseSVN,而要使用原始的svn命令行客户端(也可以与TSVN安装程序一起安装),并从命令中使用'svn'命令线.

And if you really only want to use svn from a batch file, don't use TortoiseSVN but the original svn command line client (can be installed with the TSVN installer as well) and use the 'svn' command from the command line.

这篇关于运行特定命令时是否可以隐藏MessageBox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆