News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

drag and drop

Started by Hunk, March 23, 2012, 11:45:17 AM

Previous topic - Next topic

Hunk

I know about this function, but problem is this if i drag and drop a shortcut of any exe file.   Its droping that shortcut file *.Ink format.  My question is how to make it work properly so that if i drop of shortcut of exe it should show the real path of that exe in edit box.

dedndave

http://msdn.microsoft.com/en-us/library/dd871305%28v=prot.13%29.aspx

it looks like there are 3 approaches

1) parse through the .LNK file and find the target
2) use windows scripting host
3) use COM


the first method seems simple, but if the target is not found, you are stuck
the second method sounds like a headache - lol
the third method is probably the way to fly
maybe Edgar has some nifty code for this   :P

sure enough   :U
http://www.masm32.com/board/index.php?topic=9652.msg70715#msg70715
maybe Edgar will comment on this code - he may have an updated version

Hunk

 :bg thank you, but that one in goasm, do you any example in pure masm?

dedndave

no, i don't
it is COM stuff - so, not a simple task, either   :P

donkey

Hi,

Sorry, I was away on a mini-vacation for a few weeks and didn't see this thread. The IShellLink interface is a pretty easy one to use for basic stuff like resolving a link. Since LNK files are a rats nest of structured storage, it is hard to decode them reliably. Trust me, I originally thought it might be the best approach and gave up quickly. Scripting Host is a viable solution but the overhead of executing a script from within an assembly language program, though not overly huge is still quite daunting. The only real approach is the COM interface that Microsoft provides for the purpose, you can call the function from MASM using my Files library (from my website) and that way you don't have to translate it. If I get some time this weekend I will see about re-installing MASM and translating the function for that assembler, but that is a long shot - I'm pretty busy.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable