-
2
- #1
imagenetics
Programmer
I have finally managed to disable popup menu in TShockwaveFlash component. The solution was in writing a function that responds to right-click message send to an application. Here's the code (green is what you have to write):
In "Unit1.h"
In "Unit1.cpp"
If you want to popup your own menu (for some reason Popup Menu property in TShockwaveFlash doesn't work) do this:
In "Unit1.h"
Code:
[b]private:[/b]
[COLOR=green] [b]void __fastcall[/b] NoRightClick(TMsg &Message, [b]bool[/b] &Handled);[/color]
Code:
[b]__fastcall[/b] TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
[COLOR=green]Application->OnMessage = NoRightClick;[/color]
}
//---------------------------------------------------------------------------
[COLOR=green][b]void __fastcall[/b] TForm1::NoRightClick(TMsg &Msg, [b]bool[/b] &Handled)
{
[b]if[/b]((Msg.message == WM_RBUTTONDOWN) && (Msg.wParam == MK_RBUTTON)){
Handled = [b]true[/b];
}[b]else[/b]{
Handled = [b]false[/b];
}
}[/color]
Code:
[b]void __fastcall[/b] TForm1::NoRightClick(TMsg &Msg, [b]bool[/b] &Handled)
{
[b]if[/b]((Msg.message == WM_RBUTTONDOWN) && (Msg.wParam == MK_RBUTTON)){
Handled = [b]true[/b];
[COLOR=green]POINT cursorPos;
GetCursorPos(&cursorPos);
PopupMenu1->Popup(cursorPos.x, cursorPos.y);[/color]
}[b]else[/b]{
Handled = [b]false[/b];
}
}