?
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,305 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
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 7 hours left to enroll

615 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