如何找到我自己的应用程序以外的主窗口? [英] How do I find the main window of an application other than my own?

查看:137
本文介绍了如何找到我自己的应用程序以外的主窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的第一篇文章,请耐心等待.

This is my first post so please bear with me. 

我已经使用了magicJack几个月了,除了每次您拨打或接听电话时都会弹出的烦人的呼叫"窗口外,我都喜欢它.

I''ve been using magicJack for a couple of months now and I like it except for the annoying Call window that pops-up every time you make or receive a call.

我的问题是:如何找到该窗口并将其隐藏?我的直觉是,与C#相比,用C ++更好地完成这项工作.也许我很天真,但我认为C ++应用程序会更小,更快.

My question is: how do I find that window and hide it?  My gut feeling is that this job is better done in C++ than C#.  Maybe I''m naive but I think a C++ app would be smaller and faster.

任何建议将不胜感激...

Any suggestions would be much appreciated...

推荐答案

首先,没有确定的主要"窗户".您可能正在谈论无主顶层窗口",如果应用程序只有其中一个,通常称为主窗口".

First, there''s no such thing as a definitive "main window". You''re probably talking about "owner-less top level window", which is usually called "main window" if an application only has one of them.

基本上,首先尝试使用找到FindWindow(NULL,windowTitle)以获得其 HWND ,然后将其用于 ShowWindow(hWnd,SW_HIDE) MoveWindow(hWnd,& ; someRectOffTheScreen) SetWindowPos(hWnd,& someRectOffTheScreen,someOtherMagicFlagsToKeepItReallyHidden)或所有这些!

Basically, first try a FindWindow(NULL, windowTitle) to get its HWND and then use that one to either ShowWindow(hWnd, SW_HIDE) or MoveWindow(hWnd, &someRectOffTheScreen) or SetWindowPos(hWnd, &someRectOffTheScreen, someOtherMagicFlagsToKeepItReallyHidden) or maybe all of them! 

但这些都不能保证应用程序不会使自己回到定时循环或其他状态. 

But none of those can guarantee that the app doesn''t bring itself back in a timed loop or something. 


这篇关于如何找到我自己的应用程序以外的主窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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