FormでWndProcを宣言する
1 2 |
protected: virtual void WndProc(Message% m) override = Control::WndProc; |
実装する
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
void Form1::WndProc(Message% m) { switch (m.Msg) { case WM_CLIPBOARDUPDATE: { if (Clipboard::ContainsText()) { try { String^ text = Clipboard::GetText(); txtLog->AppendText("\n"); txtLog->AppendText(text); } catch (Exception^ ex) { MessageBox::Show(ex->Message); } } m.Result = (IntPtr)0; return; } } Form::WndProc(m); } |