Get Shortcut?
Blitz3D Forums/Blitz3D Programming/Get Shortcut?
| ||
I'm trying to get the contents of a dropped shortcut (-got the dropped bit working). Unfortunately this causes a MAV, and I don't understand the code well enough. Can anybody help? Graphics 800,600 pszLinkto$ = "C:\Documents and Settings\John\Desktop\Lifestory.doc.lnk" ; test shortcut pszDir$ = Chr$(0) ;= String$(" ",512) ; neither of these make any difference pszName$ = String$(" ",512) ; \/ This causes a MAV api_SHGetNewLinkInfo% (pszLinkto$, pszDir$, pszName$, pfMustCopy%, uFlags%) ; : User32 "SHGetNewLinkInfoA" Print pszLinkto$ Print pszDir$ Print pszName$ WaitKey() End |
| ||
Without testing it ... just looking into the Code ... http://msdn.microsoft.com/en-us/library/windows/desktop/bb762193(v=vs.85).aspx It's not a User32 Function ... It should be in Shell32 (decls) Maybe that's the reason? |
| ||
Sorry - my mistake. Not User32.... it was already in Shell32.decls. But that doesn't change the fact that it MAV's. Maybe I need to drop this into the Win forum. |
| ||
.lib "shell32.dll" SHGetNewLinkInfo%(pszLinkto$, pszDir$, pszName*, pfMustCopy*, uFlags%) There were Pointers missing in the decls file See here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb762193(v=vs.85).aspx Don't know what the function should do - so I do not know if it works now. Anyway - It does not MAV anymore ;-) And you can build on it. RGR . |
| ||
I think you're right about the decls definition. Thanks for the new one, it does not MAV. Unfortunately this line now MAVs: Dummy=PeekByte(Bank,Zlr) |
| ||
I've spent 3 days trying to understand DLLs. I got fed up and handcoded it in an hour:- http://www.blitzbasic.co.nz/codearcs/codearcs.php?code=3104 Don't you just love Blitz! |