|
/* in header */
...........
#define WM_PINGICONMESSAGE WM_USER + 1
...........
void __fastcall PingIconMessage(TMessage& Msg);
public: // User declarations
__fastcall TConfig(TComponent* Owner);
void __fastcall LoadConfiguration();
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_PINGICONMESSAGE, TMessage, PingIconMessage)
END_MESSAGE_MAP(TForm)
............
/* in source */
void __fastcall TConfig::PingIconMessage(TMessage& Msg)
{
if (Msg.LParam == WM_RBUTTONDOWN)
{
POINT p;
GetCursorPos(&p);
SetForegroundWindow(Handle);
PopupMenu->Popup(p.x, p.y);
}
if (Msg.LParam == WM_LBUTTONDOWN)
{
...........
}
}
잘 보시고 해보세요.
|