[Implemented] LVFINDINFO structure needed for ListIconGadget

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

[Implemented] LVFINDINFO structure needed for ListIconGadget

Post by PB »

Hi, I need the LVFINDINFO structure to be supported so that I can search a
ListIconGadget for an entry. Or, does anyone know how to do this already?
Here's some API code that would do the trick if the structure was supported:

Code: Select all

a$="target"
FindTopic.LVFINDINFO ; <-- Compiler says 'Structure not found'
FindTopic\flags=#LVFI_STRING
FindTopic\psz=@a$
p=SendMessage_(hWnd,#LVM_FINDITEM,-1,FindTopic)
Debug "target was found at index position "+Str(p)
UPDATE: I just realised I could do a FindString search on each ListIconGadget item:

Code: Select all

a$="target"
For a=0 To CountGadgetItems(#gadget)-1
  If FindString(GetGadgetItemText(#gadget,a,0),a$,1)<>0 : p=a : Break : EndIf
Next
Debug "target was found at index position "+Str(p)
But it would still be nice to have this structure added. ;)
Last edited by PB on Thu Aug 05, 2004 1:23 pm, edited 1 time in total.
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

Structure viewer shows:
LV_FINDINFO


Structure LV_FINDINFO
flags.l
psz.l
lParam.l
pt.POINT
vkDirection.l
EndStructure
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Structure viewer shows:
> LV_FINDINFO

But as you can see from my post, the compiler can't find it... don't know why.
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

I posted my reply because of the underscore.

Am i incorrect?
User avatar
blueb
Addict
Addict
Posts: 1115
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Post by blueb »

I've never known you to be wrong! :D

P.S. - I like the icon to PBDev.... maybe more users will try it and see
that it's a great program.


--blueb
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> I posted my reply because of the underscore

Oh my goodness, now I see the light! :)
I didn't notice the underscore before.

Hmm, but why is an underscore there? No wonder I didn't see it in the
structure viewer. All API web sites don't have an underscore for it...
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

LV_FINDINFO was the old way M$ named their structures, LVFINDINFO is the
new one. The M$ documentation doesn't contain any word about this change, and
since the PB definitions are quite old, they still have that old thing in it.

This applies to many many other structures, so if you don't find the structure
you search for, just try to put an underscore after the 2nd or 3rd letter.

Timo
Last edited by freak on Fri Aug 13, 2004 1:54 am, edited 1 time in total.
quidquid Latine dictum sit altum videtur
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> if you don't find the structure you search for, just try to put an underscore
> after the 2nd or 3rd letter.

Thanks for the info, Freak! :)
Post Reply