0

I need to find download dialog in IE8, i all ready did this in IE8+ ,and all work 100%,i finded the name and class of window/perent window with Spy++/WinSpy,and get my findow.But in IE8 i get stuck,the download dialog don't have any perents,and it seems to me more easy to find it but no.

Here my winSpy

enter image description here

enter image description here

You can see class and window name,but FindWindow returns 0

Here my code:

 [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
 static extern int FindWindow(string lpClassName, string lpWindowName);

 a3 = FindWindow("Button", "&Save");
 a4 = FindWindow("Button", "Save");
 a5 = FindWindow("#32770 (Dialog)", "File Download");
 a6 = FindWindow("#32770 (Dialog)", "0% of telechargement.cgi from www.cic.fr Completed");

all they are '0'.

Any ideas what i am doing wrong?

Who to find this download dialog window?

Vladimir Potapov
  • 2,347
  • 7
  • 44
  • 71
  • 1
    The class name is just plain "#32770", the (Dialog) annotation is WinSpy trying to be too helpful. And "Button" cannot work, FindWindow() only finds top-level windows. Trying to hack the browser's file download prompt is evil and has lots of counter-measures so that viruses don't take advantage of it. – Hans Passant Aug 25 '14 at 15:12

1 Answers1

0

Thanx to Hans Passant i find the misstake :

The (Dialog) annotation is WinSpy trying to be too helpful

Just need to remove (Dialog) from class name "#32770 (Dialog)".

You need the change code to:

a5 = FindWindow("#32770", "File Download");
a6 = FindWindow("#32770", "0% of telechargement.cgi from www.cic.fr Completed");
Vladimir Potapov
  • 2,347
  • 7
  • 44
  • 71