>Has anybody had any success in setting the icon in a treeview control to the icon associated with a file?
>
>I wish to have the subnodes of a treeview control display the icon based on the file extension of a file.
>
>I would assume that I would use the ExtractAssociatedIcon API call to accomplish this, but every time I think I am on the right track I get the C00000005 error in VFP7 SP1.
>
>Thanks in Advance,
Troy,
It sounds like you may not be passing the last parameter by reference. The declaration should be
DECLARE INTEGER ExtractAssociatedIcon IN Shell32;
INTEGER hInst, STRING @lpIconPath,;
INTEGER @lpiIcon
The first required parameter is the instance handle of the calling application. You get that with the following
DECLARE INTEGER GetClassLong IN Win32API;
INTEGER hWnd, INTEGER nIndex
lninstance = GetClassLong(_VFP.hWnd, -16)
Secondly, see MESSAGE#
656045 for an idea of what's required.
George
Ubi caritas et amor, deus ibi est