如何从程序中最小化另一个应用程序 [英] How can i minimize another application from my program

查看:205
本文介绍了如何从程序中最小化另一个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个全屏运行的VB应用程序.单击VB应用程序上的按钮后,将打开一个小程序.单击小程序上的按钮后,它将调用c ++ dll(吐温),并且该dll具有创建弹出窗口的代码,并且该窗口位于全屏VB应用程序的下方,而不是位于顶部. >
有人可以让我知道将弹出窗口显示在全屏VB表单和小程序顶部的方法吗?

在此先感谢,
Kris

Hi,

I have a VB application that runs full screen. On the click of a button on the VB application, an applet is opened. On the click of a button on the applet, it calls a c++ dll (twain) and this dll has the code to create a pop up window and this window goes underneath the full screen VB application instead of being at the top.

Can someone let me know the way i can get this pop up window onto the top of full screen VB form and the applet?

Thanks in Advance,
Kris

推荐答案

您可以在vc ++ dll中实现以下内容

You can implement following into vc++ dll

CWnd *pCalc = CWnd::FindWindow(NULL, _T("Applet Name"));
if(pCalc != NULL)
{
   pCalc->BringWindowToTop();
   pCalc->CenterWindow();
}


您还可以使用MoveWindow();.要将窗口移到大小合适的位置.


You can also use MoveWindow(); To move window at desried location with size.


只需在创建该窗口时将窗口设置设置为OnTop.
Just make the window settings to OnTop while creating that window.


如果可能,您应该通过窗口作为父窗口调用的过程的句柄.否则,您可以安装一个钩子来做到这一点(SetWindowsHookEx(WH_SHELL,...)).捕获HSHELL_WINDOWCREATED消息并将您的窗口设置为父窗口(SetParentWindow或SetWindowPos或SetForegroundWindow等.pp.).
问候.
If possible you should pass your window handle to the called procedure as parent window. Otherwise you can install a hook to do that (SetWindowsHookEx(WH_SHELL,...)). Catch the HSHELL_WINDOWCREATED message and set yout window as parent (SetParentWindow, or SetWindowPos or SetForegroundWindow etc. pp.).
Regards.


这篇关于如何从程序中最小化另一个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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