15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


OLE drag 'n drop of URLs

Yuliya@FrontierTech.COM
Friday, May 03, 1996

WIN95, VC 4.1, MFC

I'm utilizing OLE drag n' drop to implement a transfer of URLs ( Universal 
Resource Locators) between diff. browsers and my application ( and my application 
and a desktop).
The problem I'm experiencing is that I don't know what format I should indicate in
COleDataObject::GetGlobalData( cfFormat). I tried CF_TEXT and I can see the data 
and I can get to the data .However,  when I create a source object of CF_TEXT type 
myself and try to drop it on a desktop ( or the browser which is a drop target) it 
doesn't work because as I suspect format is wrong. 
The new Win32 SDK which was given away on a Microsoft Developers Conference 
implements InternetShortcut interfaces (IUniformResourceLocator) but I can't get 
this SDK installed.
Can anyone give me a hint what format I should be using?
        Thanks for your time.





Tim Philip -- philip@cs.usask.ca
Wednesday, May 08, 1996

[Mini-digest: 2 responses]

Yuliya@FrontierTech.COM writes:
> 
> WIN95, VC 4.1, MFC
> 
> I'm utilizing OLE drag n' drop to implement a transfer of URLs ( Universal 
> Resource Locators) between diff. browsers and my application ( and my application 
> and a desktop).

Can you tell me what the name of the SDK is?  I need to do EXACTLY this
and have no idea how to get started.  Any information would be greatly
appreciated.

Which browers will accept a drop?  I didn't think netscape or mosaic
did.

-------
Tim Philip, B.Sc.           Randco Software Corporation
Consultant                  2530 Hanover Avenue   
                            Saskatoon, SK          Phone: +1-306-343-3380
philip@cs.usask.ca          Canada   S7J 1G1         Fax: +1-306-343-3341
-----From: John Addis 

What you need to do is get the shell to create a "Scrap File". Add data in two 
formats to accomplish the drop onto the desktop. The format names are defined 
as CFSTR_FILEDESCRIPTOR and CFSTR_FILECONTENTS in shlobj.h but not registered 
-- you must call RegisterClipboardFormat() for them.

CFSTR_FILEDESCRIPTOR
--------------------
CFSTR_FILEDESCRIPTOR contains a FILEGROUPDESCRIPTOR struct which also contains a
FILEDESCRIPTOR array. 

Fill in the FILEGROUPDESCRIPTOR as you would expect. In the FILEDESCRIPTOR 
struct(s) set: 1)dwFlags = FD_LINKUI, 2)cFileName = name of output file,
3) all others to 0.

CFSTR_FILECONTENTS
------------------
This must contain the actual contents of the file, in "Internet Shortcut" 
format, i.e. "[InternetShortcut]\nURL=url-goes-here".

I don't know if this is documented in the INetSDK or not. The clipboard formats
and "Scrap Files" are in the Win32 SDK docs.

If anybody know a better way to do it I would be interested in knowing. I
simply spied into what Netscape was doing when you dragged a shortcut onto
the desktop.

-- 
John Addis        Master of Time and Space
jaddis@erols.com  C++, MFC, Win32, Win95, TCP/IP
"Invalid or missing REALITY.COM Universe halted."





| Вернуться в корень Архива |