Link to home
Start Free TrialLog in
Avatar of boss302_lp
boss302_lp

asked on

Windows Focus

When i run my vb application ( a download manager) no matter which window i am on will lose focus, but still remain topmost, and then gain it back some time later.

i think my problems are somewhere in here:

Private Sub TimerC_Timer()
WantDown.Tag = ""
Open App.Path & "\data.xml" For Input Shared As #1
    Input #1, TEMPshowexit
    Input #1, TEMPshowclip
Close #1
        Static ClipboardText As String
          If Clipboard.GetFormat(vbCFText) = True And Clipboard.GetText <> ClipboardText Then
             
             ClipboardText = Clipboard.GetText
             If Trim$(Left$(ClipboardText, 7)) = "http://" Then
                'seems good address
                If WantDown.Tag = "" Then
                WantDown.Show
                If TEMPshowclip = 1 Then
                   Unload WantDown
                End If
                Else
                GoTo 2000
                End If
               
                WantDown.Tag = ""
                WantDown.Label2.Caption = ClipboardText
2000:
If TEMPshowclip = 1 Then GoTo 2001
                Do
                   DoEvents
                Loop Until WantDown.Tag <> ""
                WantDown.Hide
2001:
                If WantDown.Tag = "YES" Then
                  StartDownload ClipboardText
                End If
                Unload WantDown              
             End If
          End If

can anyone tell me if this is what is stealing focus from my other windows, and help me fix the problem?
Avatar of Da_Weasel
Da_Weasel
Flag of United States of America image

doesnt look like anything in that code is causing it....mabye its in the StartDownload function?
ASKER CERTIFIED SOLUTION
Avatar of cjcujo
cjcujo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of boss302_lp
boss302_lp

ASKER

with ME.SetFocus does it require any other code, or components in the project?
It does not require and other code or components.