1

Topic: How to catch event at copying between applications?

There are two separately started applications. Copying from the first in the second becomes. Both are able drag-and-drop. How to catch event in the first application? Whether is standard  ? I am able to catch copying in the same application but how same to make if copying comes to an end in the second? For example, there are 2 teksto-like editors, copy the text from one in another. Still: 2 types-kartinochnogo of application, the same copying. In advance thanks.

2

Re: How to catch event at copying between applications?

Hello, gok, you wrote: gok> There are two separately started applications. Copying from the first in the second becomes. Both are able drag-and-drop. gok> How to catch event in the first application? Whether is standard  ? gok> I am able to catch copying in the same application but how same to make if copying comes to an end in the second? gok> for example, there are 2 teksto-like editors, copy the text from one in another. gok> still: 2 types-kartinochnogo of application, the same copying. gok> in advance thanks. We implement COM-interface IDropTarget, and  it on window RegisterDropTarget. There in general all  further in COM-interface implementation ...

3

Re: How to catch event at copying between applications?

Hello, Carc, you wrote: a C> Hello, gok, you wrote: gok>> There are two separately started applications. Copying from the first in the second becomes. Both are able drag-and-drop. gok>> How to catch event in the first application? Whether is standard  ? gok>> I am able to catch copying in the same application but how same to make if copying comes to an end in the second? gok>> for example, there are 2 teksto-like editors, copy the text from one in another. gok>> still: 2 types-kartinochnogo of application, the same copying. gok>> in advance thanks. A C> we Implement COM-interface IDropTarget, and  it on window RegisterDropTarget. There in general all  further in COM-interface implementation ... Addition: drag-n-drop it should be caught only in the first application. In the resulted links (how much I understood) there is a structure of a "target" product, i.e." Where "it is necessary  from the first (above in the link corrected conditions). Something Is necessary like" incurred from the first application - we wait for a signal ". When"threw"in the second application the first receives the notification message about it, but thus the second any  does not send for knows nothing about a source. Whether it is possible copied "to charge"with what that properties to inform a source about event and the addressee? It is a lot of examples of transfer of files from a desktop in application. The desktop has the characteristic keys of registration on which it can be recognized. I can not find reception of messages in application"observer"from the same type of application"passer-by". Thanks, Sars, for links!

4

Re: How to catch event at copying between applications?

Hello, gok, you wrote: gok> Addition: drag-n-drop it should be caught only in the first application. In the resulted links (how much I understood) there is a structure of a "target" product i.e. "where" it is necessary  from the first (above in the link corrected conditions). How much I remember, the first application (at the interface) has a method which just twitches on event Drop where it is possible to make any actions on a content.

5

Re: How to catch event at copying between applications?

Hello, gok, you wrote: gok> Hello, Carc, you wrote: gok> Addition: drag-n-drop it should be caught only in the first application. In the resulted links (how much I understood) there is a structure of a "target" product, i.e." Where "it is necessary  from the first (above in the link corrected conditions). gok> something Is necessary like" incurred from the first application - we wait for a signal ". When"threw"in the second application the first receives the notification message about it, but thus the second any  does not send for knows nothing about a source. Whether it is possible copied "to charge"with what that properties to inform a source about event and the addressee? gok> it is a lot of examples of transfer of files from a desktop in application. The desktop has the characteristic keys of registration on which it can be recognized. I can not find reception of messages in application"observer"from the same type of application"passer-by". gok> Thanks, Sars, for links! When it is initialized  from the first application the data in object IOleDataSource there is charged, there there are everyones *Delay* methods (Delay in a title of methods) which just and will twitch in IOleDataSource-object when actually rushes itself dragn-n-drop. Here the description on MFC object COleDataSource. Accordingly, to finish it "on-than-@-friend" it is possible by analogy. Here in these methods, also it is possible and to give already actually the data, and besides to begin "" between the receiver and the sender. Same COM. Only the interface. How also that there it is implemented completely on a payoff of the developer. Any IPC approaches. By youth I such implemented in Aml Pages. If briefly briefly in COleDataSource it was put  about the sender. And the receiver started to communicate with it already. I there on a miscellaneous did: from the beginning were HWND the receiver and the message.  in a binary type, the receiver decrypted, and began dialogue. Then it "" also made differently: all was put in XML, and  went through Memory Mapped Files. And then and at all " ...". I simply asked users as often they drag between separate "applications" (cross connect-protsessno). There was that almost anybody, save-paste all approaches more (and it is by the way clear why:" The wizard "is always more clear, more pleasant and more convenient - than a thin motility + super-concentration of attention at ). I and at all removed Ole-Dragndrop the data. In application to make all is much easier, for there are no inter-processes,  and . If on mind: that it is necessary to know what exactly and where you drag? Well purely visually I mean. Type to drag pictures from photoshops in  and it is reverse, or something like - it yes, rather conveniently. Well like objects big, besides "a fit" zone  too, as a rule, rather big. And here if there something small, and small on the screen to a fit zone it is full  it to use. In my case from one process of a tree (TreeView) it was dragged in the same tree in other process.  yo-May! Here attentively select, push the button and drag  , do not forget to switch an alto-tabom to other application (and  do not miss, and that  will be completed), there it is attentive  suppose in a proper place in a tree in other application (and it and the tree car-podskroll if is necessary, and a time delay with deployment of nodes and ). In general full speed! Only ponder:  to drag, the button not ,  to switch an alto-tabom to other application, there attentively to look where to suppose (and do not result-ospadi  to release casually), still dynamics in the receiver (at me a tree , nodes were torn with a time delay), but also on sense it is necessary to think where to release. Represent as this a pressure for the user? It is necessary so here still to think,  or save-paste. It though "step by step": easy , easy opened that is necessary, selected where, easy selected a command "Vpastit". All is clear, any pressure, all is convenient, all is easy for interrupting, all is easy for beginning anew.

6

Re: How to catch event at copying between applications?

Hello, Carc, you wrote: a C> Hello, gok, you wrote: gok>> Hello, Carc, you wrote: gok>> Addition: drag-n-drop it should be caught only in the first application. In the resulted links (how much I understood) there is a structure of a "target" product, i.e." Where "it is necessary  from the first (above in the link corrected conditions). gok>> something Is necessary like" incurred from the first application - we wait for a signal ". When"threw"in the second application the first receives the notification message about it, but thus the second any  does not send for knows nothing about a source. Whether it is possible copied "to charge"with what that properties to inform a source about event and the addressee? gok>> it is a lot of examples of transfer of files from a desktop in application. The desktop has the characteristic keys of registration on which it can be recognized. I can not find reception of messages in application"observer"from the same type of application"passer-by". gok>> Thanks, Sars, for links! The C> When is initialized  from the first application the data in object IOleDataSource there is charged, there there are everyones *Delay* methods (Delay in a title of methods) which just and will twitch in IOleDataSource-object when actually rushes itself dragn-n-drop. Here the description on MFC object COleDataSource. Accordingly, to finish it "on-than-@-friend" it is possible by analogy. Learned  between application and a desktop! I am played with CListCtrl, works in both sides, but only with real files (those they should exist physically on a disk). Between applications (one copy of another) any exchange I can not play back. The transmitter fulfills normally, and in the receiver happens nothing. CoCreateInstance () and registration CMyDropTarget: public COleDropTarget in application  it is normal. Something does not suffice. I see dialogue is restricted "Predefined Clipboard Formats", CF_HDROP for files. With it questions: 1. How to organize dialogue between boxes instead of between a desktop. 2. Whether it is possible  any "neutral" format to drag not system , BLOB for example. COleDataObject it is fastened (as I understood) on a clip-format: HGLOBAL GetGlobalData (CLIPFORMAT cfFormat, LPFORMATETC lpFormatEtc = NULL);

7

Re: How to catch event at copying between applications?

gok> learned  between application and a desktop! I am played with CListCtrl, works in both sides, but only with real files (those they should exist physically on a disk). gok> Between applications (one copy of another) any exchange I can not play back. The transmitter fulfills normally, and in the receiver happens nothing. CoCreateInstance () and registration CMyDropTarget: public COleDropTarget in application  it is normal. gok> Something does not suffice. I see dialogue is restricted "Predefined Clipboard Formats", CF_HDROP for files. gok> with it questions: 1. How to organize dialogue between boxes instead of between a desktop. 2. Whether it is possible  any "neutral" format to drag not system , BLOB for example. COleDataObject it is fastened (as I understood) on a clip-format: gok> HGLOBAL GetGlobalData (CLIPFORMAT cfFormat, LPFORMATETC lpFormatEtc = NULL); Certainly it is possible. There generally in a source everything it is possible to superimpose. Simply  own format of a clipboard through RegisterClipboardFormat and in a source  we start to mean to superimpose in COleDataSource our data under CLIPFORMAT, received of RegisterClipboardFormat. And accordingly in the receiver  in implementation IDropTarget:: DragEnter it is asked pointer IDataObject (the first parameter in DragEnter), whether there is at it data in such here a format? If yes, it is changed possible effects in  *pdwEffect if for us that this interesting is it is specified DROPEFFECT_COPY or DROPEFFECT_MOVE. Somehow so approximately: HRESULT IMyDropTarget:: DragEnter (IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect); {Whether//here at IDataObject it is asked there is data in the format necessary to us//I on storage precisely will not tell, but there there are methods with speaking names like EnumFormatEtc and ,//they allow to understand  there in IDataObject lies, and if it is necessary, it is possible and generally the data therefrom//to pull//... in general we clarify all this business and if to us something suitable is that we specify a pier , " and " *pdwEffect=DROPEFFECT_COPY | DROPEFFECT_MOVE; return S_OK;}

8

Re: How to catch event at copying between applications?

Well here actually article on codeproject.com, there certainly an emphasis becomes CF_HDROP with files, but not an essence. It illustrates the core. Only that in implementation IDropTarget all of them time at a source (COleDataObject) beg the data in format CF_HDROP, well and in our case it is necessary to ask difference CLIPFORMAT received from RegisterClipboardFormat. Well clear business, serialization \deserializatsija of the data in our format completely our care. Their source supposes eventually in a type what-thread HGLOBAL. OLE-dragndrop already on itself a care beret as  the data specified in HGLOBAL in address space of other process. But in the receiver  besides we receive the same HGLOBAL - that is simply pointer on storage where ours  the data lies in "a crude" type, pieces of bytes the piled. As these given to disassemble and  in a comprehensible type it already our care. Basically the same XML well approaches. The blessing as shows experiment,  develops, the data changes, and formats and including in  too. XML as though allows us to consider easier it at data writing in the form of XML, well and reading oh it is reverse. But it already from area of councils. By youth  the protocols in binary variants, then with support it was tortured, when the protocol of this data began  to change. It became heavy there: the new fields, any offsets, Unicode\Unicode. With XML all it in times is easier.

9

Re: How to catch event at copying between applications?

Hello, Carc, you wrote: the C> Well here actually article on codeproject.com, there certainly an emphasis becomes CF_HDROP with files, but not an essence.> the Core it illustrates a C. Only that in implementation IDropTarget all of them time at a source (COleDataObject) beg the data in format CF_HDROP, well and in our case it is necessary to ask difference CLIPFORMAT received from RegisterClipboardFormat. Aha, with it also began. Thanks big for  and councils!