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(vbCFTe xt) = 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?
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(vbCFTe
ClipboardText = Clipboard.GetText
If Trim$(Left$(ClipboardText,
'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?
doesnt look like anything in that code is causing it....mabye its in the StartDownload function?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
with ME.SetFocus does it require any other code, or components in the project?
It does not require and other code or components.