c# - run application in system tray and set hotkey for copy in clipboard -


i want have application without viewable form(for run in system tray only). now, when user pressed hot key(for example "f11") , copy selected texts application clipboard , want print texts in defined format . don't know how can that.

please me...

thanks lot

you need use hooking contains 3 main part:

  • a system hook allows insert callback function intercepts windows messages (e.g., mouse related messages).

  • a local system hook system hook called when specified messages processed single thread.

  • a global system hook system hook called when specified messages processed application on entire system.

in addition requirement, need use global system hook. can use helpful link.

update:

i think it's simple side of story detect keyboard pressed key, or put formless app in system tray (trough link), can set text clipboard using system.windows.forms.clipboard.settext("hello, clipboard");but , text? that's point of interest. if wanna selected text open app contains select-able text, need go in different way. i've searched little , got respectable link.

update again:

as mentioned in comments, link's guide doesn't work proper demand. tested few minutes ago , wrote sample app using that. i've got selected control text active windows result, means nit well.

a little searched again , result below:

  • it not possible in general able value of "any" selected text, because of fact programs can re-implement own version of win32 controls way see fit, , program cannot possibly expect work of them.

  • you can use microsoft ui automation new accessibility framework microsoft windows, available on operating systems. ui automation provides programmatic access user interface (ui) elements on desktop, enabling assistive technology products such screen readers provide information ui end users , manipulate ui means other standard input. ui automation allows automated test scripts interact ui.

note: saw in samples , questions around it, solution not cool , in addition others experiment, won't work of apps(such firefox, etc).

any helpful quote add answer. i've got you.

be lucky


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -