Jump to content

Two questions about icons and UDF ListView


Recommended Posts

Hello!

I'm trying to figure out...

How can I create icon instead of a column name?

How can I create icon from file, that I could later place in specific cell of listview?

$bitmap = _GDIPlus_BitmatCreateFromFile
$hbitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($bitmap)

Doesn't work! ;)

(it goes with menu items

[thankx doudou again :)]

but won't with _GuiImageList)

As always, impatiently looking forward for ur help,

4gr

@EDIT:

Apparently I haven't studied HelpFile with due diligence.

I found obvious anwser for first question, optional argument "$iImage" which connects image from imagelist to column header.

But I still I have no idea how can I create ImageList from .jpg/.bmp etc. files...

Edited by 4ggr35510n
Link to comment
Share on other sites

I once used one of Yashieds _WINAPI_ functions, I think it was Get associatedIcon, but I think its been replaced.

You should have a look at _WinAPI_GetIconBitmap whick I think is the newest, and all the fuctions have headers with the infp you need.

http://www.autoitscript.com/forum/index.php?showtopic=98712

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

not sure what you mean?

If you want to add icon to list view here is my code ;)

#include "GuiListView.au3"
#include "GuiImageList.au3"
$Title = "Add Icon"
$RegForm = GUICreate($Title, 757, 498, -1, -1, -1)

$ListView = GUICtrlCreateListView("COL1|Col2|Col3|",266, 56, 386, 408, BitOR($LVS_REPORT,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS))
;Add icon
    $hImage = _GUIImageList_Create(16, 16, 5, 3)
        _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 7) ;icon1
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 8) ;icon2
        _GUICtrlListView_SetImageList($listview, $hImage, 1)            
        

    _GUICtrlListView_AddItem($ListView,"Icon2",1);set icon2
    _GUICtrlListView_AddItem($ListView,"Icon1",0);seticon1
    GUISetState(@SW_SHOW)
Do 
Until GUIGetMsg() = -3
Edited by LeHuynhNam

4m848p10.gif 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...