Hello,
i found this code:
protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource; if (hwndSource != null) { installedHandle = hwndSource.Handle; viewerHandle = SetClipboardViewer(installedHandle); hwndSource.AddHook(new HwndSourceHook(this.hwndSourceHook)); } }
to start a hwndSourceHook (to capture the clipboard). But this code only works with a "Window" but not with a "Windows.Form".
How i can get the hwndSource of my Form to add the hwndSourceHook?
(instead of the override I should use the Form_Load function I think...)
EDIT: Thanks, but the Form doesnt have the AddHook function to add my hwndSourceHook