SHFILEINFOA STRUCT DWORD hIcon DWORD ? iIcon DWORD ? dwAttributes DWORD ? szDisplayName BYTE MAX_PATH DUP(?) szTypeName BYTE 80 dup? SHFILEINFOA ENDS Could someone please tell me how to make it work for tasm ? I've look the manual but i've found no examples ... THX
Posted on 2001-07-06 15:45:00 by angelo
Like this?


.MASM51 ; just to be compatible

MAX_PATH equ 260 

SHFILEINFOA struct
 hIcon         DWORD ?
 iIcon         DWORD ?
 dwAttributes  DWORD ?
 szDisplayName BYTE MAX_PATH DUP(?)
 szTypeName    BYTE 80 dup(?)
SHFILEINFOA ends

looks OK for me ;)
Posted on 2001-07-06 16:07:00 by BogdanOntanu
something like this should work

SHFILEINFOA STRUCT 
hIcon dd ?
iIcon dd ?
dwAttributes dd ?
szDisplayName db 260 dup (?)
szTypeName db  80 dup (?)
SHFILEINFOA ENDS
hm damn im really to slow in typing :/ This message was edited by Allanon, on 7/6/2001 4:11:29 PM
Posted on 2001-07-06 16:09:00 by Allanon
thanks, your suggestion works, but i'm calling call SHGetFileInfo, offset szRootPath, NULL, offset sfi, size SHFILEINFO, SHGFI_SYSICONINDEX or SHGFI_SMALLICON and getting page fault error on SHELL32.dll. I was thinking the reason could be on defining in a bad way SHFILEINFO struct ... maybe i'm out of the way... what's the meaning of the DWORD after struc ? I can't understand, inside the struc there are also db ...
Posted on 2001-07-06 16:35:00 by angelo
this is what my help shows:

typedef struct _SHFILEINFO { // shfi 
    HICON hIcon; 
    int   iIcon; 
    DWORD dwAttributes; 
    char  szDisplayName; 
    char  szTypeName[80]; 
} SHFILEINFO; 
note then int iIcon ....its a WORD or dw whatever you prefer not a DWORD or dd :( this can be one mistake ..
Posted on 2001-07-06 16:45:00 by BogdanOntanu
BogdanOntanu , again nothing. I always get the error. I've try SHFILEINFO STRUCT hFIcon dw ? try also dd iFIcon dw ? try also db dwAttributes dw ? szDisplayName db MAX_PATH dup(?) szTypeName db 80 dup (?) SHFILEINFO ENDS But i've checked with debugger, error come from a bad SS: address reading, and the structure is defined as LOCAL. Probably the error is in the structure but i've try all the way ... :(
Posted on 2001-07-06 17:06:00 by angelo
i believe Bogdan converted perfectly. angelo, take a look at your code carefully, maybe other code generate an error. next time, try and post the error message - it would be nice for me or others to look at and if they understood the error msg, maybe they can help right away. but right now, i'm just guessing...
Posted on 2001-07-06 17:46:00 by disease_2000
If "sfi" is LOCAL, then you can''t use "offset sfi". You''ll need to "lea ecx,sfi" and then call SHGetFileInfo using "ecx" in place of "offset sfi". In all versions of 32-bit VC, "int" is a dword.
Posted on 2001-07-06 21:11:00 by tank
Tank, many thanks ! You solve my trouble !! :) :) I didn''t know about that i can''t use offset for local structures!! i''m finally using SHFILEINFO STRUCT hIcon DWORD ? iIcon DWORD ? dwAttributes DWORD ? szDisplayName BYTE MAX_PATH DUP(?) szTypeName BYTE 80 dup? SHFILEINFO ENDS thanks to all
Posted on 2001-07-07 07:41:00 by angelo