I am trying to obtain the path from inside of Windows shortcut files (.lnk). I am using VB6 (mandatory) and API. Windows 10 on the computer.
For this was suggested to me to use functions from ole32.dll and shell32.dll. I had declared CLSID_ShellLink, IID_IShellLink, IID_IShellLinkA, IID_IPersistFile, also the table IShellLinkVtbl and other various as such:
continued in the next post; (I am trying to split because the forum returned error 403 when tried first time to post these)Code:Private Const MAX_PATH As Long = 260 Private Const S_OK As Long = 0 Private Const CLSCTX_INPROC_SERVER As Long = 1 Private Declare Function CoCreateInstance Lib "ole32.dll" ( _ ByRef rclsid As Any, ByVal pUnkOuter As Long, _ ByVal dwClsContext As Long, ByRef riid As Any, _ ByRef ppv As Any) As Long Private Declare Function CLSIDFromString Lib "ole32.dll" ( _ ByVal lpsz As Long, ByRef pclsid As GUID) As Long Private Declare Function DispCallFunc Lib "oleaut32.dll" ( _ ByVal pvInstance As Long, ByVal oVft As Long, ByVal cc As Long, _ ByVal vtReturn As Integer, ByVal cActuals As Long, _ ByRef prgvt As Any, ByRef prgpvarg As Any, _ ByRef pvargResult As Any) As Long ' Required GUIDs Private Type GUID Data1 As Long Data2 As Integer Data3 As Integer Data4(7) As Byte End Type ' CLSID and IID Definitions Private Const CLSID_ShellLink As String = "{00021401-0000-0000-C000-000000000046}" Private Const IID_IShellLinkA As String = "{000214EE-0000-0000-C000-000000000046}" Private Const IID_IPersistFile As String = "{0000010B-0000-0000-C000-000000000046}"




Reply With Quote
