Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Mouse events for CommandBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mouse events for CommandBar

 Post Reply Post Reply
Author
Message
IAgree View Drop Down
Newbie
Newbie


Joined: 22 July 2004
Location: Bosnia Hercegovina
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote IAgree Quote  Post ReplyReply Direct Link To This Post Topic: Mouse events for CommandBar
    Posted: 22 July 2004 at 11:46pm
How can I get mouse events for a CommandBars object?

Currently I have a Sheridan toolbar which responds to standard VB events such as MouseUp, MouseDown, MouseMove, etc. and need these events in CodeJock CommandBars. The reason is users can right-click a toolbar icon which displays a popup menu specific for that icon. The popup menu has many options specific to the application I am creating, such as security permissions for the icon.

So, how can I display my own popup menu when a user right clicks on a CodeJock toolbar icon?

Thanks.
Back to Top
leojay View Drop Down
Groupie
Groupie


Joined: 07 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote leojay Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2005 at 8:35pm

I wonder how to handle these mouse events too.

I set the mouse pointer of main form to 9:
Me.MousePointer = 9

and i want to set the mouse pointer back to default pointer when the user moved the mouse out of the main form.

Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2005 at 9:13pm

The 'ControlSelected' event is fired when you move the mouse over a control, and the 'ControlSelected' event is fired again when you move off the control (with a null value passed for the selected control).

There is no standard way to detect right mouse clicks.  Not sure if there are any hacks to get around it.

Back to Top
leojay View Drop Down
Groupie
Groupie


Joined: 07 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote leojay Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2005 at 9:57pm

I found a temporary solution to my problem. 

    Dim ptMouse As POINTAPI
    Dim rt As RECT
    rt = GetCommandBarRect
   
    If GetCapture <> Me.hwnd Then
        ptMouse = GetCursor
        If Not (ptMouse.X < rt.Right And ptMouse.X > rt.Left And ptMouse.Y < rt.Bottom And ptMouse.Y > rt.Top) And Me.MousePointer = 9 Then
             Me.MousePointer = 0
        End If
    End If

the GetCursor() and GetCommandBarRect() are my functions to get mouse cursor's position and CommandBar's client area, respectively.

I hope it will be useful to you.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.