[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

Help with Findanywindow API

k_zeon

8/7/2012 8:32:00 PM

I can use the find API function to check for a form name and if found get the child objects, this works ok.
What i have done already is to check if a form window is open and get the hwnd.
i then issue a sleep api for 400ms and then continue to do other things ,then open another window using API etc.

Basically Open 1 form enter info click button then open another form and enter more info click button, then exit out of all forms.

I dont really want to use sleep API as some systems are slower than others.
What i thought about doing is using a Do Loop to check if the form window has been opened before continueing.

ie Click button to process XYZ. Check if Form is open, if not loop until form is open then continue. However this does not work as expected.

Once i click the button and the loop starts, i then open ie Form1 but my app does not see it open until i click somewhere on my app then amazingly Form1 is found

Do While xxxxx = 0
xxxxx = (FindAnyWindow&(Me, "Form1"))
DoEvents
Loop

if you need more code then let me know

thanks

Garry
3 Answers

mm

8/7/2012 10:01:00 PM

0

"Silvermaine" <silvermaine2000@googlemail.com> escribió en el mensaje
news:c05dec13-f7b7-4745-bdf7-b724d2f2b8a9@googlegroups.com...

> Do While xxxxx = 0
> xxxxx = (FindAnyWindow&(Me, "Form1"))
> DoEvents
> Loop

You could try:

Declare Function IsWindowVisible Lib "user32" Alias _
"IsWindowVisible" (ByVal hwnd As Long) As Long

Do While IsWindowVisible(hWndForm) = 0
Doevents
Loop



unknown

8/9/2012 4:05:00 AM

0

Multiposted to:

microsoft.public.vb.general.discussion
microsoft.public.vb.winapi


Mike Williams

8/9/2012 5:22:00 AM

0

"Silvermaine" <silvermaine2000@googlemail.com> wrote in message
news:c05dec13-f7b7-4745-bdf7-b724d2f2b8a9@googlegroups.com...

> Basically Open 1 form enter info click button then open another form
> and enter more info click button, then exit out of all forms.

.. . . and you do all that with only one comma? Impressive.

Mike