Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

[Left Click] via mouse_event API becomes a [Right Click --> Properties] selecton on Win XP Quick Launch button?

Posted on 2004-08-12
8
Medium Priority
?
2,297 Views
Last Modified: 2012-08-13
For any experts who are comfortable with heavy API usage...

Take a look at the fine solution I posted here:  *pats self on back*
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21091072.html

The app has a small quirk in it that I just can't figure out...

If the app sends a click to a button residing on my XP Quick Launch bar (down on the task bar)...instead of launching the application associated with that button, I instead get the properties dialog for that button as if I had Right clicked on it and selected Properties.

Can anyone else duplicate this problem and if so, shed some light on it?

I am running VB6 on Win XP Pro with all service packs and updates installed.

Regards,

Idle_Mind
0
Comment
Question by:Mike Tomlinson
[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
  • 3
  • 3
  • 2
8 Comments
 
LVL 7

Assisted Solution

by:Burbble
Burbble earned 200 total points
ID: 11794582
I cannot duplicate the problem on Windows Millenium, I can try it on 2000 when I get a chance...

Does

    mouse_event MOUSEEVENTF_LEFTDOWN, x, y, 0, 0
    mouse_event MOUSEEVENTF_LEFTUP, x, y, 0, 0

have the same problem for you as

    mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, x, y, 0, 0

?


-Burbble
0
 
LVL 86

Author Comment

by:Mike Tomlinson
ID: 11796134
Yes...both configurations produce the same result.

Thank you for taking the time to try it out.

Idle_Mind
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 11836203
it's b/c alt is still pressed down when you issue the click event... toggle it off.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 18

Accepted Solution

by:
bobbit31 earned 1800 total points
ID: 11836295
it goes w/o saying that you already know how to do this... but to make your life easier:

Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Public Const VK_ALT = &H12
Public Const KEYEVENTF_KEYUP = &H2

...


Private Sub clickGrid(ByVal grid As Long)
    Dim x As Single
    Dim y As Single
   
    ' erase currentgrid
    DrawGrid
   
    ' turn off capturing
    capturing = False
   
    ' calculate new region
    ' and point to click
    calculateNewRegion grid
    x = (currentRegion.Left + currentRegion.Right) / 2#
    y = (currentRegion.Top + currentRegion.Bottom) / 2#
   
    ' click the center of the selected grid
    Call SetCursorPos(x, y)

    keybd_event VK_ALT, 0, KEYEVENTF_KEYUP, 0 '' *** <---- HERE ***

    mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, x, y, 0, 0
    'mouse_event MOUSEEVENTF_LEFTDOWN, x, y, 0, 0
    'mouse_event MOUSEEVENTF_LEFTUP, x, y, 0, 0
End Sub

I've tested it and it works... at least for me.

btw: nice piece of code.
0
 
LVL 86

Author Comment

by:Mike Tomlinson
ID: 11837492
LOL....    =)

Very nice sleuthing!

I never before realized that holding down Alt and clicking a Quick Launch button brought up its properties dialog.

Thank you bobbit31 for pointing out what is painfully obvious now!

If you comment in these links, I will give you additional points there as well:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21095453.html
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21098934.html

Thanks....I can once more sleep peacefully,

Idle_Mind
0
 
LVL 7

Expert Comment

by:Burbble
ID: 11840942
lol... good job. Clever trick to bring up the properties dialog, I guess (?).

Thanks for the points, although I don't think I deserve them... I didn't really do anything ;-)

-Burbble
0
 
LVL 86

Author Comment

by:Mike Tomlinson
ID: 11841047
You took the time to read the question, build the project and test it out for me.

Personally, I hate it when I participate constructively in a question but don't get points because I didn't have the "complete" answer.

Thanks again,

Idle_Mind
0
 
LVL 7

Expert Comment

by:Burbble
ID: 11841095
Oh... See, about that: I didn't compile the whole project, it was just the clickGrid subroutine I tested. That's why it "worked". The ALT+Click thing DOES bring up the properties dialog on Windows Millenium (probably a feature of Internet Explorer 4 and later).

-Burbble
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

704 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