Code:
' ######################################################################################## ' IShellLink interface ' IID = 000214EE-0000-0000-C000-000000000046 ' ######################################################################################## ' ======================================================================================== ' Retrieves the path and file name of a Shell link object. ' ======================================================================================== FUNCTION IShellLink_GetPath (BYVAL pthis AS DWORD PTR, BYREF pszFile AS ASCIIZ, BYVAL cch AS LONG, BYREF pfd AS WIN32_FIND_DATA, BYVAL fFlags AS DWORD) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[3] USING IShellLink_GetPath (pthis, pszFile, cch, pfd, fFlags) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Retrieves the list of item identifiers for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_GetIDList (BYVAL pthis AS DWORD PTR, BYREF ppidl AS DWORD) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[4] USING IShellLink_GetIDList (pthis, ppidl) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Sets the pointer to an item identifier list (PIDL) for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_SetIDList (BYVAL pthis AS DWORD PTR, BYVAL ppidl AS DWORD) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[5] USING IShellLink_SetIDList (pthis, ppidl) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Retrieves the description string for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_GetDescription (BYVAL pthis AS DWORD PTR, BYREF pszName AS ASCIIZ, BYVAL cch AS DWORD) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[6] USING IShellLink_GetDescription (pthis, pszName, cch) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Sets the description for a Shell link object. The description can be any ' application-defined string. ' ======================================================================================== FUNCTION IShellLink_SetDescription (BYVAL pthis AS DWORD PTR, BYREF pszName AS ASCIIZ) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[7] USING IShellLink_SetDescription (pthis, pszName) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Retrieves the name of the working directory for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_GetWorkingDirectory (BYVAL pthis AS DWORD PTR, BYREF pszDir AS ASCIIZ, BYVAL cch AS LONG) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[8] USING IShellLink_GetWorkingDirectory (pthis, pszDir, cch) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Sets the name of the working directory for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_SetWorkingDirectory (BYVAL pthis AS DWORD PTR, BYREF pszDir AS ASCIIZ) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[9] USING IShellLink_SetWorkingDirectory (pthis, pszDir) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Retrieves the command-line arguments associated with a Shell link object. ' ======================================================================================== FUNCTION IShellLink_GetArguments (BYVAL pthis AS DWORD PTR, BYREF pszArgs AS ASCIIZ, BYVAL cch AS LONG) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[10] USING IShellLink_GetArguments (pthis, pszArgs, cch) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Sets the command-line arguments for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_SetArguments (BYVAL pthis AS DWORD PTR, BYREF pszArgs AS ASCIIZ) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[11] USING IShellLink_SetArguments (pthis, pszArgs) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Retrieves the hot key for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_GetHotKey (BYVAL pthis AS DWORD PTR, BYREF pwHotkey AS WORD) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[12] USING IShellLink_GetHotKey (pthis, pwHotkey) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Sets a hot key for a Shell link object. ' To set Ctrl+Alt+D as the hot key make a word as follows: ' DIM wHotKey AS WORD ' wHotKey = MAKWRD(ASC("D"), %HOTKEYF_CONTROL OR %HOTKEYF_ALT) ' ======================================================================================== FUNCTION IShellLink_SetHotKey (BYVAL pthis AS DWORD PTR, BYVAL pwHotkey AS WORD) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[13] USING IShellLink_SetHotKey (pthis, pwHotkey) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Retrieves the show command for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_GetShowCmd (BYVAL pthis AS DWORD PTR, BYREF piShowCmd AS LONG) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[14] USING IShellLink_GetShowCmd (pthis, piShowCmd) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Sets the show command for a Shell link object. The show command sets the initial show ' state of the window. ' ======================================================================================== FUNCTION IShellLink_SetShowCmd (BYVAL pthis AS DWORD PTR, BYVAL iShowCmd AS LONG) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[15] USING IShellLink_SetShowCmd (pthis, iShowCmd) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Retrieves the location (path and index) of the icon for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_GetIconLocation (BYVAL pthis AS DWORD PTR, BYREF pszIconPath AS ASCIIZ, BYVAL cch AS LONG, BYREF piIcon AS LONG) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[16] USING IShellLink_GetIconLocation (pthis, pszIconPath, cch, piIcon) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Sets the location (path and index) of the icon for a Shell link object. ' ======================================================================================== FUNCTION IShellLink_SetIconLocation (BYVAL pthis AS DWORD PTR, BYREF pszIconPath AS ASCIIZ, BYVAL iIcon AS LONG) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[17] USING IShellLink_SetIconLocation (pthis, pszIconPath, iIcon) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Sets the relative path to the Shell link object. ' ======================================================================================== FUNCTION IShellLink_SetRelativePath (BYVAL pthis AS DWORD PTR, BYREF pszPathRel AS ASCIIZ, OPTIONAL BYVAL dwReserved AS LONG) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[18] USING IShellLink_SetRelativePath (pthis, pszPathRel, dwReserved) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Attempts to find the target of a Shell link, even if it has been moved or renamed. ' ======================================================================================== FUNCTION IShellLink_Resolve (BYVAL pthis AS DWORD PTR, BYVAL hwnd AS DWORD, BYVAL fFlags AS DWORD) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[19] USING IShellLink_Resolve (pthis, hwnd, fFlags) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ======================================================================================== ' ======================================================================================== ' Sets the path and file name of a Shell link object. ' ======================================================================================== FUNCTION IShellLink_SetPath (BYVAL pthis AS DWORD PTR, BYREF pszFile AS ASCIIZ) AS LONG LOCAL HRESULT AS LONG IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION CALL DWORD @@pthis[20] USING IShellLink_SetPath (pthis, pszFile) TO HRESULT FUNCTION = HRESULT END FUNCTION ' ========================================================================================
------------------
Website: http://com.it-berater.org
SED Editor, TypeLib Browser, COM Wrappers.
Forum: http://www.forum.it-berater.org
Leave a comment: