![]() |
|
Модераторы: Poseidon, Snowy, bems, MetalFan |
![]()
|
|
| Limonadni Joe |
|
|||
|
Опытный ![]() ![]() Профиль Группа: Участник Сообщений: 311 Регистрация: 1.11.2002 Где: Москва Репутация: нет Всего: 2 |
Я хочу реализовать перенос картинки (TBitMap) в другое приложение (напр. Word) путём перетаскивания - т.е. пользователь кликнул на PaintBox и потащил мышь в окно Word'а. Как это сделать?
|
|||
|
||||
| Полудненко Олег |
|
|||
|
Українець ![]() ![]() Профиль Группа: Участник... Сообщений: 556 Регистрация: 13.8.2003 Репутация: 1 Всего: -11 |
Можно попытаться сделать следующее:
на клик по Имеджу (а точнее на опускание кнопки мыши) копировать картинку в буфео обмена; на поднятие кнопки мыши эмюлировать нажатие кнопки Shift+Ins или что-то в этом роде. |
|||
|
||||
| <Spawn> |
|
|||
![]() Око кары:) ![]() ![]() ![]() ![]() Профиль Группа: Экс. модератор Сообщений: 2776 Регистрация: 29.1.2003 Где: Екатеринбург Репутация: 44 Всего: 64 |
посмотри работу итерфейста - IDropTarget что ли называется.
-------------------- "Для некоторых людей программирование является такой же внутренней потребностью, подобно тому, как коровы дают молоко, или писатели стремятся писать" - Николай Безруков. |
|||
|
||||
| Limonadni Joe |
|
|||
|
Опытный ![]() ![]() Профиль Группа: Участник Сообщений: 311 Регистрация: 1.11.2002 Где: Москва Репутация: нет Всего: 2 |
Полудненко Олег Думаю, такой метод буду использовать в последнюю очередь.
<Spawn> Что-то не нашёл в справке ничего подходящего. Можно по-подробнее? |
|||
|
||||
| <Spawn> |
|
|||
![]() Око кары:) ![]() ![]() ![]() ![]() Профиль Группа: Экс. модератор Сообщений: 2776 Регистрация: 29.1.2003 Где: Екатеринбург Репутация: 44 Всего: 64 |
IDropTarget
Platform SDK: COM IDropTarget The IDropTarget interface is one of the interfaces you implement to provide drag-and-drop operations in your application. It contains methods used in any application that can be a target for data during a drag-and-drop operation. A drop-target application is responsible for: Determining the effect of the drop on the target application. Incorporating any valid dropped data when the drop occurs. Communicating target feedback to the source so the source application can provide appropriate visual feedback such as setting the cursor. Implementing drag scrolling. Registering and revoking its application windows as drop targets. The IDropTarget interface contains methods that handle all these responsibilities except registering and revoking the application window as a drop target, for which you must call the RegisterDragDrop and the RevokeDragDrop functions. When to Implement Implement the IDropTarget interface if you are developing an application that can act as a target for a drag-and-drop operation. The IDropTarget interface is associated with your application windows and is implemented on your window objects. Call the RegisterDragDrop function to register your window objects as drop targets. When to Use You do not call the methods of IDropTarget directly. The DoDragDrop function calls the IDropTarget methods during the drag-and-drop operation. For example, DoDragDrop calls IDropTarget::DragEnter when it detects the mouse has moved over a window that is registered as a drag target. Once the mouse has entered a drag-target window, DoDragDrop calls IDropTarget::DragOver as the mouse moves through the window and calls IDropTarget::DragLeave if the mouse leaves the target window or if the user cancels or completes the drag-and-drop operation. DoDragDrop calls IDropTarget::Drop if the drop finally occurs. Methods in Vtable Order IUnknown Methods Description QueryInterface Returns pointers to supported interfaces. AddRef Increments reference count. Release Decrements reference count. IDropTarget Methods Description DragEnter Determines whether a drop can be accepted and its effect if it is accepted. DragOver Provides target feedback to the user through the DoDragDrop function. DragLeave Causes the drop target to suspend its feedback actions. Drop Drops the data into the target window. Requirements Windows NT/2000/XP: Requires Windows NT 3.1 or later. Windows 95/98: Requires Windows 95 or later. Header: Declared in oleidl.h. See Also DoDragDrop, IDropSource, RegisterDragDrop, RevokeDragDrop Platform SDK Release: November 2001 What did you think of this topic? Let us know. Order a Platform SDK CD Online (U.S/Canada) (International) IDropSource Platform SDK: COM IDropSource The IDropSource interface is one of the interfaces you implement to provide drag-and-drop operations in your application. It contains methods used in any application used as a data source in a drag-and-drop operation. The data source application in a drag-and-drop operation is responsible for: Determining the data being dragged based on the user's selection. Initiating the drag-and-drop operation based on the user's mouse actions. Generating some of the visual feedback during the drag-and-drop operation, such as setting the cursor and highlighting the data selected for the drag-and-drop operation. Canceling or completing the drag-and-drop operation based on the user's mouse actions. Performing any action on the original data caused by the drop operation, such as deleting the data on a drag move. IDropSource contains the methods for generating visual feedback to the end user and for canceling or completing the drag-and-drop operation. You also need to call the DoDragDrop, RegisterDragDrop, and RevokeDragDrop functions in drag-and-drop operations. When to Implement Implement IDropSource if you are developing a container or server application that can act as a data source for a drag-and-drop operation. The IDropSource interface is only required during the drag-and-drop operation. If you implement the IDropSource interface, you must also implement the IDataObject interface on the same object to represent the data being transferred. You can use the same implementation of IDataObject for drag-and-drop data as for the data object offered to the clipboard. Once you have implemented clipboard operations in your application, you can add drag-and-drop operations with only a little extra work. When to Use You don't usually call IDropSource methods directly. Instead, your data source calls the DoDragDrop function when it detects that the user has initiated a drag-and-drop operation. Then, DoDragDrop calls the IDropSource methods during the drag-and-drop operation. For example, DoDragDrop calls IDropSource::GiveFeedback when you need to change the cursor shape or when you need to provide some other visual feedback. DoDragDrop calls IDropSource::QueryContinueDrag when there is a change in the mouse button state to determine if the drag-and-drop operation was canceled or completed. Methods in Vtable Order IUnknown Methods Description QueryInterface Returns pointers to supported interfaces. AddRef Increments reference count. Release Decrements reference count. IDropSource Methods Description QueryContinueDrag Determines whether a drag-and-drop operation should continue. GiveFeedback Gives visual feedback to an end user during a drag-and-drop operation. Requirements Windows NT/2000/XP: Requires Windows NT 3.1 or later. Windows 95/98: Requires Windows 95 or later. Header: Declared in oleidl.h. See Also DoDragDrop, IDataObject, IDropTarget Platform SDK Release: November 2001 What did you think of this topic? Let us know. Order a Platform SDK CD Online (U.S/Canada) (International) -------------------- "Для некоторых людей программирование является такой же внутренней потребностью, подобно тому, как коровы дают молоко, или писатели стремятся писать" - Николай Безруков. |
|||
|
||||
![]()
|
| Правила форума "Delphi: Общие вопросы" | |
|
|
Запрещается! 1. Публиковать ссылки на вскрытые компоненты 2. Обсуждать взлом компонентов и делиться вскрытыми компонентами
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Snowy, MetalFan, bems, Poseidon, Rrader. |
| 0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
| 0 Пользователей: | |
| « Предыдущая тема | Delphi: Общие вопросы | Следующая тема » |
|
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |