窗口尚未创建。 [英] Window not created yet.

查看:64
本文介绍了窗口尚未创建。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个问题我无法解决。



有人可以请你好好解释我哪里出错了。



情况如下:



我正在唤起一个基于Java的应用程序。如何检查该窗口是否已创建?



我确定HWND无法解决我的问题。因为我在唤起它的时候就得到了HWND。



有时窗口需要1到5分钟才会出现。这是一个Java应用程序。



有没有办法确认窗口是否已创建?





////////////////////////////////////////// /////

对不起,我应该提到这是一个外部应用程序。

我正在使用ShellExecute启动目标应用程序。

我没有目标应用程序的代码。

一旦执行,我正在寻找目标窗口的HWND。

// /////////////////////////////////////////////

解决方案

老实说,任何花费超过几秒钟(最多十次)创建窗口的应用程序都存在严重问题,并且无法在我的计算机上生存当然:如果它没有创建一个窗口,那么用户不知道它正在运行,并且很可能再次双击它,并且又一次又一次......



但如果你真的,真的必须使用它,那么你唯一的解决方案我将使用 EnumWindows功能 [ ^ ]重复获取现有的Windows列表,直到你想要的列表出现在列表中:你可以从窗口标题文本中识别它,具体取决于应用程序的功能,或者可能将它与你已经拥有的句柄进行比较?

Hello,

I am having an issue i haven't been able to resolve.

Can someone please be nice enough and explain me where I am going wrong.

Here is the situation:

I am evoking an application, which is Java based. How can I check that that window has been created?

I am sure HWND is not going to solve my problem. Since I do get the HWND as soon as I evoke it.

Sometimes it takes a 1 to 5 minutes for the window to come up. It's a Java app.

Is there a way to confirm if the window has been created?


///////////////////////////////////////////////
I am sorry, I should have mentioned this is an external app.
I am starting up the target application using "ShellExecute".
I don't have the code for the target application.
Once I execute that I am looking for the HWND of the target window.
///////////////////////////////////////////////

解决方案

To be honest, any app that takes more than a couple of seconds (ten at the maximum) to create it's window has severe problems and wouldn't survive on my computer as a matter of course: if it doesn't create a window, then the user doesn't know it is running, and is likely to double click it again, and again, and again...

But if you really, really have to use it, then your only solution is going to be to use the EnumWindows function[^] to get the existing windows list repeatedly until the one you want appears in the list: you can probably ID it from teh window title text, depending on what the app does, or possibly compare it to the handle you already have?


这篇关于窗口尚未创建。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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