?
Solved

Windows Focus

Posted on 2003-02-28
4
Medium Priority
?
222 Views
Last Modified: 2010-04-07
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?
0
Comment
Question by:boss302_lp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:Da_Weasel
ID: 8043896
doesnt look like anything in that code is causing it....mabye its in the StartDownload function?
0
 

Accepted Solution

by:
cjcujo earned 80 total points
ID: 8044775
I also do not see anthing in this code that would cause this.  You might want to stick "Me.SetFocus" in some spots so it will keep the focus on that form
0
 

Author Comment

by:boss302_lp
ID: 8045114
with ME.SetFocus does it require any other code, or components in the project?
0
 

Expert Comment

by:cjcujo
ID: 8050674
It does not require and other code or components.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question