Clipboard events in windows service

  • Thread starter Thread starter yevron2
  • Start date Start date
Y

yevron2

Hello,

I am trying to get clipboard events using SetClipboardViewer api.
It works in a windows form when i override the function:

protected override void WndProc(ref System.Windows.Forms.Message m)

that belongs to the base class System.Windows.Forms.

The problem is that i want to do it in a windows service...
Does someone knows how to get the clipboard events in a windows
service?

Thanks.
 
If you want to access the currently logged users clipboard, you cannot do it
directly from a service processes run on a different window station than the
interactive user. Every window station has it's own clipboard so the service
process would not see the users clipboard anyway.

Indirectly, you need to get the interactive user to start a "hidden" program
(could be a WinForms app w/o window) that then watches clipboard events and
uses named pipes/remoting etc. to comunicate with the service process.
Or, you could try to use CreateProcessAsUser Win32API to autostart the exe
but it could be tricky.

This link might be interesting:
http://msdn2.microsoft.com/en-us/library/ms683502.aspx.
 
If you want to access the currently logged users clipboard, you cannot do it
directly from a service processes run on a different window station than the
interactive user. Every window station has it's own clipboard so the service
process would not see the users clipboard anyway.

Indirectly, you need to get the interactive user to start a "hidden" program
(could be a WinForms app w/o window) that then watches clipboard events and
uses named pipes/remoting etc. to comunicate with the service process.
Or, you could try to use CreateProcessAsUser Win32API to autostart the exe
but it could be tricky.

This link might be interesting:http://msdn2.microsoft.com/en-us/library/ms683502.aspx.

<[email protected]> ha scritto nel messaggio








- Show quoted text -

Thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top