View Single Post
Old Apr 14th, 2006, 2:07 AM   #5
bigguy
Professional Programmer
 
bigguy's Avatar
 
Join Date: Sep 2005
Location: Arkansas
Posts: 298
Rep Power: 0 bigguy is an unknown quantity at this point
Send a message via AIM to bigguy Send a message via MSN to bigguy Send a message via Yahoo to bigguy
Ok grumpy and I started what you said and here is the code I done for your idea and then the code for mine. Plus the outcome:

1. Your Idea
Public Class Form1

    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer

    Private IEDownload as Int32 = 0

    Private Sub IEDownloads()
        IEDownload = FindWindow("#32770", "File Download")
        MsgBox(IEDownload.ToString + "Download Detected")
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim thrblock As New System.Threading.Thread(AddressOf IEDownloads)
        thrblock.Start()
    End Sub
End Class

^^With that I get the message box as soon as I start the project, regardless if the download window is open or not.

2. My Code
Public Class Form1

    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer

    Private IEDownload As Int32 = 0

    Private Sub IEDownloads()
        IEDownload = FindWindow("#32770", "File Download")
        MsgBox(IEDownload.ToString + "Download Detected")
    End Sub

    Private Sub Timer1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Disposed
        Dim thrblock As New System.Threading.Thread(AddressOf IEDownloads)
        thrblock.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim thrblock As New System.Threading.Thread(AddressOf IEDownloads)
        thrblock.Start()
    End Sub
End Class

^^^ With that the msgbox doesnt appear till AFTER I close the download windows, well actually when I close the running project and I go back to design mode. I think I'm geting close, but much more of this shit, I'll goi back to vb6. lol
No seriously thanks for yalls help thuis far, and hopefully I'm not that far off from fixing this problem.

Also daemon thanks.
__________________
Forgiveness is the fragrance that the violet sheds on the heal that has crushed it. - Mark Twain

Destruction leads to a very rough road, but it also breeds creation.
bigguy is offline   Reply With Quote