how to disable AxShockwaveFlash menu????
-
Monday, January 28, 2008 2:15 PM
i add AxShockwaveFlash in my form and i want to disable it's right click menu ???
please in detail
thanks
Answers
-
Tuesday, January 29, 2008 3:30 PM
Since everything in Windows is based on messages, you can completely disable the right-click message for that control. To do this, you need to inherit from the Flash control to make your own Flash control with right-click disabled. The code below shows how I created the new inherited control. You can notice, that message 204 (aka right-click) is ignored. You can then add this control to your form using the code in the second code snippet.
The steps I took to get everything setup
-
Create a new Windows Forms Application project named "DisableRightClickForFlash"
-
Add a Shockwave Flash control to Form1
-
Create a new Class file named "NoRightClickFlashControl.vb"
-
Paste the code from Code Snippet 1 into NoRightClickFlashControl.vb
-
Open the Form1.Designer.vb file
-
Replace all the code in that file with the code from Code Snippet 2.
-
Press F5 to run!
Code for NoRightClickFlashControl.vb
Code Snippet 1Public
Class NoRightClickFlashControl Inherits AxShockwaveFlashObjects.AxShockwaveFlashPrivate Const WM_RBUTTONDOWN As Integer = &H204
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_RBUTTONDOWN
' Do nothing on right-click
m.Result =
New IntPtr(1) Return End Select MyBase.WndProc(m) End SubEnd
ClassCode for Form1.Designer.vb
Code Snippet 2<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial
Class Form1 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list._
Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Thencomponents.Dispose()
End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor._
Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) Me.NoRightClickFlashControl1 = New DisableRightClickForFlash.NoRightClickFlashControl CType(Me.NoRightClickFlashControl1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'NoRightClickFlashControl1 ' Me.NoRightClickFlashControl1.Enabled = True Me.NoRightClickFlashControl1.Location = New System.Drawing.Point(41, 44) Me.NoRightClickFlashControl1.Name = "NoRightClickFlashControl1" Me.NoRightClickFlashControl1.OcxState = CType(resources.GetObject("NoRightClickFlashControl1.OcxState"), System.Windows.Forms.AxHost.State) Me.NoRightClickFlashControl1.Size = New System.Drawing.Size(192, 192) Me.NoRightClickFlashControl1.TabIndex = 0 ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(292, 266) Me.Controls.Add(Me.NoRightClickFlashControl1) Me.Name = "Form1" Me.Text = "Form1" CType(Me.NoRightClickFlashControl1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents NoRightClickFlashControl1 As NoRightClickFlashControlEnd
Class -
All Replies
-
Monday, January 28, 2008 4:23 PM
You can disable the context-menu by setting the "menu" property to false. According to Adobe, you can not remove the "About Adobe..." and "Settings" options. So setting "menu" to false will remove, "Zoom In", "Zoom Out", "Show All", etc...
The link shows a description of all the properties for the Flash Player.
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
-
Tuesday, January 29, 2008 2:57 PM
i know this idea
but i want to disable ablout adobe flash also
like disable right click in form
do you have way?
and thank you
-
Tuesday, January 29, 2008 3:30 PM
Since everything in Windows is based on messages, you can completely disable the right-click message for that control. To do this, you need to inherit from the Flash control to make your own Flash control with right-click disabled. The code below shows how I created the new inherited control. You can notice, that message 204 (aka right-click) is ignored. You can then add this control to your form using the code in the second code snippet.
The steps I took to get everything setup
-
Create a new Windows Forms Application project named "DisableRightClickForFlash"
-
Add a Shockwave Flash control to Form1
-
Create a new Class file named "NoRightClickFlashControl.vb"
-
Paste the code from Code Snippet 1 into NoRightClickFlashControl.vb
-
Open the Form1.Designer.vb file
-
Replace all the code in that file with the code from Code Snippet 2.
-
Press F5 to run!
Code for NoRightClickFlashControl.vb
Code Snippet 1Public
Class NoRightClickFlashControl Inherits AxShockwaveFlashObjects.AxShockwaveFlashPrivate Const WM_RBUTTONDOWN As Integer = &H204
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_RBUTTONDOWN
' Do nothing on right-click
m.Result =
New IntPtr(1) Return End Select MyBase.WndProc(m) End SubEnd
ClassCode for Form1.Designer.vb
Code Snippet 2<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial
Class Form1 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list._
Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Thencomponents.Dispose()
End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor._
Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) Me.NoRightClickFlashControl1 = New DisableRightClickForFlash.NoRightClickFlashControl CType(Me.NoRightClickFlashControl1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'NoRightClickFlashControl1 ' Me.NoRightClickFlashControl1.Enabled = True Me.NoRightClickFlashControl1.Location = New System.Drawing.Point(41, 44) Me.NoRightClickFlashControl1.Name = "NoRightClickFlashControl1" Me.NoRightClickFlashControl1.OcxState = CType(resources.GetObject("NoRightClickFlashControl1.OcxState"), System.Windows.Forms.AxHost.State) Me.NoRightClickFlashControl1.Size = New System.Drawing.Size(192, 192) Me.NoRightClickFlashControl1.TabIndex = 0 ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(292, 266) Me.Controls.Add(Me.NoRightClickFlashControl1) Me.Name = "Form1" Me.Text = "Form1" CType(Me.NoRightClickFlashControl1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Friend WithEvents NoRightClickFlashControl1 As NoRightClickFlashControlEnd
Class -
-
Tuesday, January 29, 2008 3:49 PM
im sorry for disturb you
please explain in details
i try you way but there are some errors in your code
thank you
-
Friday, February 01, 2008 7:27 AMModerator
HI Mega,
In this scenario Moshe Gutman uses the control.WndProc method to process windows message. If it finds WM_RBUTTONDOWN message, it doesn't pass this message to base class to handle it. So this can filter out WM_RBUTTONDOWN message and doesn't trigger the right button click.
Best regards,
Riquel
-
Wednesday, February 06, 2008 3:28 AM
please explain WM_RBUTTONDOWN
and how use it
-
Monday, July 28, 2008 11:05 AMSorry to bump old topic, but I used your code and it works, but it seems to mess up the movie in question. The movie loops back after playing the intro. It was fine before I used your code though. Can you think of any reasons fr why this might be/and or solutions?
EDIT:
Don't worry, I've fixed it.- Edited by Jeremy Parker Tuesday, July 29, 2008 10:35 AM fixed
-
Monday, September 07, 2009 4:53 PMThanks a lot Moshe.. I used your code and it works fine. i have edited the right click message with my customized message.
Thanks again buddy. Do you know anything about AxShockwave's MovieData Property? or about InlineData property? like how to assign data and use of that

