"Selection" help, please. :S

Discussion in 'Programming General' started by Darthatron, Aug 6, 2008.

"Selection" help, please. :S
  1. Unread #1 - Aug 6, 2008 at 10:47 AM
  2. Darthatron
    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    "Selection" help, please. :S

    Ok, so... I have this code:

    Code:
    Private Sub imgWindow_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        imgWindow.MousePointer = 2
        
        Me.WindowState = vbMinimized
    End Sub
    
    Private Sub imgWindow_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        GetCursorPos PosXY
        imgWindow.MousePointer = 0
        SelWnd = WindowFromPoint(PosXY.X, PosXY.Y)
    
        Me.WindowState = vbNormal
    End Sub
    As you can probably tell it's used to select a window. However, I seemed to have run into a rather annoying bug:

    When you use that image to select a window, the window minimizes before the icon changes and then (for some facked up reason) the MouseUp Event never happens...

    I've tried fixing it with a "DoEvents", but that didn't help. I tried some other stuff aswell, but all it led to was the same problem.



    Please Note: I only ever get this bug when the VB6 window isn't directly behind the application.

    Frankly, it makes no sense... All help is welcomed. >_>
     
  3. Unread #2 - Aug 6, 2008 at 11:41 AM
  4. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    "Selection" help, please. :S

    Seems to work for me.
    (i didn't use the getmousepos API though i just used a msgbox to check if it worked)
     
  5. Unread #3 - Aug 6, 2008 at 10:57 PM
  6. Darthatron
    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    "Selection" help, please. :S

    Hmm... Perhaps it's just my crappy computer... Oh well. >_>

    Thanks for the help, Covey.
     
< Taking a screenshot of a window! [BitBlt] | need help on random numbers >

Users viewing this thread
1 guest


 
 
Adblock breaks this site