MemoryEx: ExtractAssociatedIcon

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Shrek
    Forum Member
    • Jul 2012
    • 723

    MemoryEx: ExtractAssociatedIcon

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


    I'm at this so far:

    Code:
    Shell32 [COLOR="#FF0000"]=[/COLOR] Library[COLOR="#FF0000"].[/COLOR]Load([COLOR="#800080"]"Shell32.dll"[/COLOR]);
    
    ExtractAssociatedIcon [COLOR="#FF0000"]=[/COLOR] [COLOR="#0000FF"]function[/COLOR](P)
     [COLOR="#0000FF"]local[/COLOR] m [COLOR="#FF0000"]=[/COLOR] MemoryEx[COLOR="#FF0000"].[/COLOR]Allocate(String[COLOR="#FF0000"].[/COLOR]Length(P) + [COLOR="#000000"]1[/COLOR])
     MemoryEx[COLOR="#FF0000"].[/COLOR]String(m[COLOR="#FF0000"],[/COLOR]-[COLOR="#000000"]1[/COLOR][COLOR="#FF0000"],[/COLOR]MEMEX_ASCII[COLOR="#FF0000"],[/COLOR]P)
     [COLOR="#0000FF"]local[/COLOR] n [COLOR="#FF0000"]=[/COLOR] MemoryEx[COLOR="#FF0000"].[/COLOR]Allocate([COLOR="#000000"]1024[/COLOR])
     [COLOR="#008000"]--[/COLOR]
     [COLOR="#0000FF"]local[/COLOR] H [COLOR="#FF0000"]=[/COLOR] Shell32[COLOR="#FF0000"].[/COLOR]ExtractAssociatedIconA(Application[COLOR="#FF0000"].[/COLOR]GetWndHandle()[COLOR="#FF0000"],[/COLOR]m[COLOR="#FF0000"],[/COLOR]n)
     MemoryEx[COLOR="#FF0000"].[/COLOR]Free(m)
     MemoryEx[COLOR="#FF0000"].[/COLOR]Free(n)
     [COLOR="#0000FF"]return[/COLOR] H
    [COLOR="#0000FF"]end[/COLOR];
    the index I assume would be 0, it's for getting the associated file icon of say a text or zip file.
  • Cybergraph
    Indigo Rose Customer
    • Feb 2007
    • 1633

    #2
    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.

    Comment

    • Shrek
      Forum Member
      • Jul 2012
      • 723

      #3
      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.

      Comment

      • Cybergraph
        Indigo Rose Customer
        • Feb 2007
        • 1633

        #4
        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.

        Comment

        • Imagine Programming
          Indigo Rose Customer
          • Apr 2007
          • 4252

          #5
          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

          AMS8 Plugins
          IMXLH Compiler

          Comment

          • Shrek
            Forum Member
            • Jul 2012
            • 723

            #6
            Code:
            Shell32 [COLOR="#FF0000"]=[/COLOR] Library[COLOR="#FF0000"].[/COLOR]Load([COLOR="#800080"]"Shell32.dll"[/COLOR]);
            
            ExtractAssociatedIcon [COLOR="#FF0000"]=[/COLOR] [COLOR="#0000FF"]function[/COLOR](P[COLOR="#FF0000"],[/COLOR]I)
             [COLOR="#0000FF"]local[/COLOR] m [COLOR="#FF0000"]=[/COLOR] MemoryEx[COLOR="#FF0000"].[/COLOR]Allocate(String[COLOR="#FF0000"].[/COLOR]Length(P) + [COLOR="#000000"]1[/COLOR])
             MemoryEx[COLOR="#FF0000"].[/COLOR]String(m[COLOR="#FF0000"],[/COLOR]-[COLOR="#000000"]1[/COLOR][COLOR="#FF0000"],[/COLOR]MEMEX_ASCII[COLOR="#FF0000"],[/COLOR]P)
             [COLOR="#0000FF"]local[/COLOR] n [COLOR="#FF0000"]=[/COLOR] MemoryEx[COLOR="#FF0000"].[/COLOR]Allocate([COLOR="#000000"]2[/COLOR])
             MemoryEx[COLOR="#FF0000"].[/COLOR]Word(n[COLOR="#FF0000"],[/COLOR]I)
             [COLOR="#0000FF"]local[/COLOR] H [COLOR="#FF0000"]=[/COLOR] Shell32[COLOR="#FF0000"].[/COLOR]ExtractAssociatedIconA(Application[COLOR="#FF0000"].[/COLOR]GetWndHandle()[COLOR="#FF0000"],[/COLOR]m[COLOR="#FF0000"],[/COLOR]n)
             MemoryEx[COLOR="#FF0000"].[/COLOR]Free(m)
             MemoryEx[COLOR="#FF0000"].[/COLOR]Free(n)
             [COLOR="#0000FF"]return[/COLOR] H
            [COLOR="#0000FF"]end[/COLOR];
            
            [COLOR="#008000"]-- ExtractAssociatedIcon(file path,icon index)[/COLOR]
            easy as that then.

            Comment

            • Imagine Programming
              Indigo Rose Customer
              • Apr 2007
              • 4252

              #7
              Easy as that, haha! ^^
              Bas Groothedde
              Imagine Programming :: Blog

              AMS8 Plugins
              IMXLH Compiler

              Comment

              Working...
              X