Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2012
    Posts
    625

    MemoryEx: ExtractAssociatedIcon

    How do I use the LPWORD type? It's for this.


    I'm at this so far:

    Code:
    Shell32 = Library.Load("Shell32.dll");
    
    ExtractAssociatedIcon = function(P)
     local m = MemoryEx.Allocate(String.Length(P) + 1)
     MemoryEx.String(m,-1,MEMEX_ASCII,P)
     local n = MemoryEx.Allocate(1024)
     --
     local H = Shell32.ExtractAssociatedIconA(Application.GetWndHandle(),m,n)
     MemoryEx.Free(m)
     MemoryEx.Free(n)
     return H
    end;
    the index I assume would be 0, it's for getting the associated file icon of say a text or zip file.

  2. #2
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    1,632
    Extract icons is well performed by Icon.dll by Sside.

    In conjunction with ImageEdit.dll you can extract and save icons in a variety of image formats.
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

  3. #3
    Join Date
    Jul 2012
    Posts
    625
    Thanks, you know I have, I think, all the dll's ever posted here but when I got into this memory stuff I figured whats the point in all these dll files when I can do it myself and learn the windows api's at the same time.

  4. #4
    Join Date
    Feb 2007
    Location
    Como, Italy
    Posts
    1,632
    Hi, I'm sure of this. Mine was only a suggestion in case you would need to do things in the shorter time possible.
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

  5. #5
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,676
    How do I use the LPWORD type?
    An LPWORD is simply a pointer to a WORD. Allocate 2 bytes
    of memory and provide the pointer to that word as LPWORD.
    Bas Groothedde
    Imagine Programming :: Blog :: Like the Facebook page for up-to-date info regarding plugins!

    My AMS Plugins:
    iEnc - AMS7, Object - AMS7 - AMS8, PluginInfo - AMS7 - AMS8, VersionInfo - AMS8, ListIcon 2.1 - AMS8, ProgressEx - AMS8, SPLAX - AMS8, MemoryEx - AMS8, MemoryEx Lua Header Compiler - Info - Ä20,-, Draw - Info - Ä5,- NEW

  6. #6
    Join Date
    Jul 2012
    Posts
    625
    Code:
    Shell32 = Library.Load("Shell32.dll");
    
    ExtractAssociatedIcon = function(P,I)
     local m = MemoryEx.Allocate(String.Length(P) + 1)
     MemoryEx.String(m,-1,MEMEX_ASCII,P)
     local n = MemoryEx.Allocate(2)
     MemoryEx.Word(n,I)
     local H = Shell32.ExtractAssociatedIconA(Application.GetWndHandle(),m,n)
     MemoryEx.Free(m)
     MemoryEx.Free(n)
     return H
    end;
    
    -- ExtractAssociatedIcon(file path,icon index)
    easy as that then.

  7. #7
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,676
    Easy as that, haha! ^^
    Bas Groothedde
    Imagine Programming :: Blog :: Like the Facebook page for up-to-date info regarding plugins!

    My AMS Plugins:
    iEnc - AMS7, Object - AMS7 - AMS8, PluginInfo - AMS7 - AMS8, VersionInfo - AMS8, ListIcon 2.1 - AMS8, ProgressEx - AMS8, SPLAX - AMS8, MemoryEx - AMS8, MemoryEx Lua Header Compiler - Info - Ä20,-, Draw - Info - Ä5,- NEW

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts