VB6 - finding windows via the api

  • 13 years ago

    Hi all,

     I have an application which goes out to various websites and tries to down load info, on one occasion it finds a .csv file and i am then presented with the usual "File Download" box with the OPEN, SAVE and CANCEL buttons, of which i want to press save.

     Does anyone know how to do this ??

     I have been trying the findwindow and findwindoxex API's but as the "File Download" box appears my VB application stops until a button is pressed manually.


            awnd = FindWindow(vbNullString, "MyApplication")
            hwnd = FindWindowEx(awnd, 0, vbNullString, "File Download")  
            DoEvents
             If hwnd <> 0 Then
                lObjhWnd = FindWindowEx(hwnd, 0, "Button", "Save")
                DoEvents
                iii = SendMessage(lObjhWnd, BM_CLICK, 0, ByVal 0&)
                bFoundFileDownload = True
                DoEvents
             End If
             DoEvents

     Any help would be appreciated.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Walking on water and developing software from a specification are easy if both are frozen.” - Edward V Berard