Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to drag a bitmap?

Status
Not open for further replies.

hashimsaleem

Programmer
Feb 28, 2003
2
0
0
US

I need to know a way to drag a bitmap by mouse in client area of a window.

Thanks
 
You must write a program that does this - there are no such APIs.
 
>tchouch
You're kidding. ActiveX/OLE API provide a standartized technology which gives possibilities to drag anything. For example an user can drag an image to a word, excel or another unknown application. The technology is complex. Sender should implement IDropSrource and IDataObject. The consummer should implement IDropTarget. The target window whould be registered as drop target. I've done it a lot before, but there is too much code to put it in the forum.

Ion Filipski
1c.bmp
 
>>You must write a program that does this - there are no such APIs

That is what i m asking. I need to know an algo to do this task. What i have thought is that to trap the WM_MOUSEMOVE message and on every MOUSEMOVE, call bitblt() with new rectangle .

Any ideas ???????
 
>IonFilipsky
I know this technologies, but there are lot of questions on the forum, where people hope to find a very simple solution (couple lines of code). And my answer says only, here is no such easy solution - You says the same, but with many words.

hashimsaleem,

if You wish to use drag/drop functions within Your Program only (if a file should be dropped on Your Program from the same program or another applications), You can yse easier technology with functions DragQueryFile(), DropItem() etc. without interfaces. There are some samples on MSDN, but there have some errors, and You in all cases will need much time to really implement it. If You wish to drop from Your program to another programs, You can use IDropSrource, IDataObject and IDropTarget interfaces or you must hook WM_LBUTTONUP, WM_MOUSEMOVE (and may be WM_DROPFILES) messages of target applications.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top