Community
Showing results for 
Search instead for 
Do you mean 
Reply

Is it possible to intercept or block any command?

Tuned Listener
Posts: 38
Country: Poland

Is it possible to intercept or block any command?

I need manually manage any commands (eg from menu or toolbars). Eg. block any command.

 

best regards

bernardo

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Is it possible to intercept or block any command?

To monitor an ACT menu you can register your own command on top of ACT's.
But that does not block it, only lets you know it was raised. 

 

ACTAPP.RegisterCommand("act-ui://com.act/application/menu/schedule/call", AddressOf MyMnuCall_Click, Act.UI.RegisterType.Shell)

 

Public Sub mnuCall_Click(ByVal CommandID As String)
  ' your code here
End Sub

 

The code above only raises the commandID it does not pass any event arguments. 

I would be very nice if ACT raised the object and a Cancel Event Arg like so.. 
 

Public Sub MnuCall_Click(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
 ' your code here
' Let ACT know you handled the menu event e.Cancel = true
End Sub

 

For some ACT menus I need to completely monitor and suppress, I remove the native menu and replace it with my own. 
 

If somebody knows a different way I would love to here about it!
 

Thanks

-- Jim Durkin