Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
13
Erster Beitrag:
vor 5 Jahren, 2 Monaten
Letzter Beitrag:
vor 5 Jahren, 1 Monat
Beteiligte Autoren:
Ola, Yogi Yang, issah, Alexandre Leclerc, Arie, Al

[WD16] How to drag and drop an image to an external program

Startbeitrag von Ola am 25.05.2013 12:36

Hi all

I have an image control in my product maintenance form displaying an image of the product.
The image's filename consists of directory names specified elsewhere in the system plus the actual image name and extension in the product's record.

I would like to drag such an image from the maintenance form to an external program, such as Ventura Publisher.

Before wasting too much time on this, I would like to know if this is possible with Windev's commands and how?

Any hints will be appreciated.

br
Ola

Antworten:

Hi Ola,
if you buy lst91 you have an example and sourcecode to do so
http://www.pcsoft.fr/lst/Last/lst91.htm
(somewhere in the middle you will find DRAG AND DROP DE WINDEV À WINDOWS )

von Arie - am 25.05.2013 13:07
Thanks Arie

br
Ola

von Ola - am 27.05.2013 09:39
Hi Ola,

LST 91 implements this behaviour using Windows API:

- OpenClipboard - http://msdn.microsoft.com/en-us/library/windows/desktop/ms649048%28v=vs.85%29.aspx
- EmptyClipboard
- SetClipboardData (with the structure, the format)
- CloseClipboard

In the LST, it is of CF_TEXT format because it only transfers the filename. They also create a global memory buffer (In kernel32: GlobalAlloc, GlobalLock, GlobalUnlock, and using WinDev's Transfer function) to copy a DROPFILES structure into it ( http://msdn.microsoft.com/en-us/library/windows/desktop/bb773269%28v=vs.85%29.aspx ) to pass that information about a filename to the clipboard - because the example is about a simple drag and drop of a file to the explorer process, so they create the file then send the drag and drop information using this structure.

If you search the Web you will find many different examples using Windows' API and you can implement the same in WinDev.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 27.05.2013 13:00
Hi Alexandre

Thank you for the explanation.
I must confess that I have no experience in API programming, but I'll try to investigate it based on your hints when I have some extra time (maybe after I've been buried?:) )

br
Ola

von Ola - am 27.05.2013 13:23
Hello Ola

I had a play around with some of the "d" functions but nothing worked, however V18 has a ToClipboard(Image) which according to the help makes th image available to the copy/paste functions. It is not in V16 but maybe it is in V17 so it might be a workaround you could use, if your users could paste the image rather than drag and drop ?

Regards
Al

von Al - am 27.05.2013 14:28
Hi Al,

Thanks for the hint.

Copying an image to a page layout program (in my case Ventura) would be fully possible, but not desirable, unless the image is very small.. Copying will create an embedded image and thereby increases the layout file size enormously.

br
Ola

von Ola - am 28.05.2013 18:42
Ventura publisher????......I thought,, oh never mind.

issah

von issah - am 28.05.2013 22:28
:)
Hi Issah,

I use Ventura for the very same reason as Windev. Its the very best in its category, for my purposes:-)

br
Ola

von Ola - am 29.05.2013 14:30
I don;t know if this will solve you problem but...

Do check this: http://www.freevbcode.com/ShowCode.asp?ID=1311

It is in VB and should give you some ideas as to what APIs you will have to use to achieve Drag and Drop between your software and Ventura Publisher.

My educated guess is that you will have to use DDE to communicate with VP from your software as if I know correctly VP does not support OLE that well but had very good support for DDE.

If you can use DDE then sending any info to VP will be very easy.

HTH

Yogi Yang

von Yogi Yang - am 30.05.2013 05:43
Hi Yogi,

Thanks for the hint, although it seem to be for a somewhat vice-versa situation ("Drag File Names from Windows Explorer to Controls in Your Application.).
I can successfully drag and drop image files to Ventura from any file manager (that I have tried. I haven't tried them all, of course...).
I do not know whether OLE or DDE is being used in this process.

br
Ola

von Ola - am 20.06.2013 07:28
Hi Ola,

From my experience I can say that Windows Explorer uses OLE when we do any drag and drop in any software that supports drag and drop. It also stores the file name(s) in clipboard in a special format so if target app does not support OLE it can access the clipboard and get the file names.

HTH

Yogi Yang

von Yogi Yang - am 21.06.2013 12:11
Thanks Yogi and all

I'm now a bit more knowledgeable when I jump into this project.

br
Ola

von Ola - am 22.06.2013 09:12
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.