Hi,
Here's a nice bit of work from long ago by Tony Jones - circa 2002 .. :)
Tony says:
QuoteI originally wanted to write a card game in "pure" IBasic without the need for a 3rd party DLL, but knew that it would take way too long to come up with the support for it, mainly the drag and drop routines.
In any case, below is what I came up with. It's based on an example in C that I found from Microsoft for Windows 3.1 circa 1993.
This is a detailed piece of work that is worth some study, using many graphics API routines.
I've included the .exe file for those who would like to try it, but don't have CB loaded.
all the best, :)
Graham
[Code amended as per Brian's comment below]
Graham,
There's an error in this line (well, according to IWB, that is):
' Copy old background to screen
BitBlt(hdc,ImageInfo.bmX+dx,ImageInfo+dy,ImageInfo.bmWidth,ImageInfo.bmHeight,hdcOldBkg,0,0,SRCCOPY)
Needs changing to:
' Copy old background to screen
BitBlt(hdc,ImageInfo.bmX+dx,ImageInfo.bmY+dy,ImageInfo.bmWidth,ImageInfo.bmHeight,hdcOldBkg,0,0,SRCCOPY)
Brian
Brian,
Thanks for the correction. Strange it didn't seem to affect the programs operation. ::)
I've altered the zip file in the first post ..
best wishes, :)
Graham
Graham,
Actually, it did. When you drag the bitmap down to the bottom of the screen, it reacts
quite differently to when you drag it to the top, left and right sides
Brian
Yep, I hadn't studied it, so I reckon it might need a bit of thought about what behaviour is required at the screen edges.
all the best, :)
Graham