News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

How do I do IID_IImageList TGUID '{46EB5926-582E-4017-9FDF-E8998DAA0950}'

Started by jimg, April 06, 2018, 04:40:40 AM

Previous topic - Next topic

jimg

Still on my neverending quest to get the images from the desktop syslistview32 in 64bit windows.

All I can get is the handle to the imagelist that the desktop listview uses.

How do I copy an imagelist for my own uses given only the handle?

The only function I've found is HIMAGELIST_QueryInterface. https://msdn.microsoft.com/en-us/library/windows/desktop/bb761510(v=vs.85).aspx

Parameters:

himl [in]
    Type: HIMAGELIST
    The handle to the image list.
riid [in]
    Type: REFIID
    The identifier of the interface being requested. Normally IID_IImageList or IID_IImageList2.
ppv [out]
    Type: void**  (?)
    When this method returns, contains the address of the interface pointer requested in riid. If the object does not support the interface specified in riid, ppv is NULL.

So... I finally found the value of IID_IImageList:

IID_IImageList TGUID  '{46EB5926-582E-4017-9FDF-E8998DAA0950}'

How do I enter this constant in masm?

Siekmanski

You can write it this way,

.const
IID_IImageList TEXTEQU <{046EB5926h,0582Eh,04017h,{09Fh,0DFh,0E8h,099h,08Dh,0AAh,009h,050h}}>
Creative coders use backward thinking techniques as a strategy.

jimg

Thank you.  I was expecting something in a .data statement rather than an assembler string, let me think about what you are saying.

Siekmanski

For COM interfaces I use this macro to place the interface constant in the data section,

.const
GUID_ADDR MACRO guid_text:REQ
LOCAL guid_data
.data
guid_data GUID guid_text
.code
EXITM <addr (guid_data)>
ENDM

IID_IImageList TEXTEQU <{046EB5926h,0582Eh,04017h,{09Fh,0DFh,0E8h,099h,08Dh,0AAh,009h,050h}}>

LPPPV   typedef PTR DWORD

.data
ppv     LPPPV NULL
HIMAGELIST dd 0

.code
    invoke    HIMAGELIST_QueryInterface,HIMAGELIST,GUID_ADDR(IID_IImageList),addr ppv


This way you can make an include file with all the interface constants.
And when you only need some of them you don't bloat your executable.
Creative coders use backward thinking techniques as a strategy.

jimg


Siekmanski

 :biggrin:
I think you need to translate the "IImageList" interface as well.
And then you need a "com invoke" macro to execute the interface members.
Creative coders use backward thinking techniques as a strategy.

jimg

Thanks Again.
More than I bargained for.  That must be why I'm getting-
"Entry Point Not Found
The procedure entry point HIMAGELIST_QueryInterface
could not be located in the dynamic link library (name of my .exe)."

I don't know why I thought this would be straight forward.

Siekmanski

Programming COM interfaces is a lot of work.  :t
The "HIMAGELIST_QueryInterface" function is available in Comctl32.lib ( Comctl32.dll )

If you need a COM example, find one of my D3D9 sources I have posted and see how it can be done in Masm.
Creative coders use backward thinking techniques as a strategy.

jimg

The big surprise was I had no idea it involved com when I started :icon_rolleyes:

Siekmanski

Maybe Comctl32.lib is a wrapper library and you don't have to mess with COM and use only functions instead.
I don't know and sadly don't have the time to investigate it.  :(

ImageList_CoCreateInstance function, creates com objects,
https://msdn.microsoft.com/en-us/library/windows/desktop/bb761518(v=vs.85).aspx

EDIT: I think it can be done without COM programming, found a post on the old forum that uses "ImageList_Draw"

http://www.masmforum.com/board/index.php?topic=9964.0

http://msdn.microsoft.com/en-us/library/windows/desktop/bb761389%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/hh270414%28v=vs.85%29.aspx

Creative coders use backward thinking techniques as a strategy.

jimg

Okay.  Lots to look at here.  Thanks.   (As an aside, I'm always amazed at how much I like the old board.  Even though the text seems the same size, it always looks sharper and easier to read than the new.  The new always seems a bit fuzzy to me.  Perhaps the white background rather than the blue-gray.  Hope Hutch isn't listening.)

hutch--


Lonewolff

@Siekmanski - Hey dude, I am trying to learn COM myself also. Wrapping the DX11 functions I need to get a bare bones application running.

Do you have a link to your DX9 library so I can take a look and see if I can follow how you went about it?

I am pretty up to speed with the workings of DX11 and have done quite a bit in C++ with it. But it would be extremely cool to replicate what I have done in C++ back in ASM.  8)

Just need a few hints to get up and walking in the right direction.

Siekmanski

What a coincidence, I just answered your previous topic with the same question.  :biggrin:

Creative coders use backward thinking techniques as a strategy.

nidud