Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard.GetDataObject need singleton #20

Open
BBUBBA opened this issue Feb 22, 2021 · 1 comment
Open

Clipboard.GetDataObject need singleton #20

BBUBBA opened this issue Feb 22, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@BBUBBA
Copy link

BBUBBA commented Feb 22, 2021

image

If Hook WM_DRAWCLIPBOARD Multiple Process

Hook event is good work Data is Empty. -_- ( It's Sometime )
( WM_CLIPBOARDUPDATE is Same Trouble )
( I tried Global Mutex Control Critical Section = Same Trouble)
( I Think Just One Process and need IPC Communication )

It's OS Stupid But we need Solve that...

and we need use WM_CLIPBOARDUPDATE if over Windows Vista....

if WM_DRAWCLIPBOARD Die about Chain Clipboard is Stupid ( About Another Process )

it's My dirty Code....
( Warning : My english is not good...)

class ClipboardManager : ClipboardCommon, IClipboardManager
{

    [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
    protected override void WndProc(ref Message m)
    {
        switch (m.Msg)
        {
            case NativeConstant.WM_CLIPBOARDUPDATE:
                ClipboardChange_Proc();
                //Trace.WriteLine("ChangeClipboard");
                break;
        }
        base.WndProc(ref m);
    }

    public ClipboardManager()
    {
        RegisterClipboardViewer();
    }

    public override void RegisterClipboardViewer()
    {
        Native.AddClipboardFormatListener(this.Handle);
    }

    public override void UnregisterClipboardViewer()
    {
        try
        {
            Native.RemoveClipboardFormatListener(this.Handle);
        }
        catch (ObjectDisposedException ex) { }
    }

}
@Willy-Kimura Willy-Kimura added the enhancement New feature or request label May 28, 2021
@Willy-Kimura
Copy link
Owner

Great, thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants