首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

bcb 6 怎么获取应用程序的图片,是要64*64以下的哦。挣扎了几天,还是没有收获,希望各位帮个忙。多谢

2012-04-28 
bcb 6 如何获取应用程序的图片,是要64*64以下的哦。挣扎了几天,还是没有收获,希望各位帮个忙。谢谢答案当然

bcb 6 如何获取应用程序的图片,是要64*64以下的哦。挣扎了几天,还是没有收获,希望各位帮个忙。谢谢
答案当然是越详细越好啦

[解决办法]
应用程序的图片不是ICO格式的吗?嗯!我看着你的贴!
[解决办法]

C/C++ code
total=0;    hIcon=NULL;    ImageList1->Clear();    ListView1->Clear();    OpenDialog1->Execute();    filename=OpenDialog1->FileName;    Edit1->Text=filename;    total=(int)ExtractIcon(this->Handle,filename.c_str(),-1);    //If the file is an .ICO file, the return value is 1.    if(total==1)    {        hIcon = ExtractIcon( this->Handle, filename.c_str(), 0);//提取图标        Icon1->Handle=hIcon;        ImageList1->AddIcon(Icon1);        ListItem1=ListView1->Items->Add();        ListItem1->Caption=ListView1->GetCount()-1;        ListItem1->ImageIndex=0;    }    for(int i=0;i<total;i++)    {        hIcon = ExtractIcon( this->Handle, filename.c_str(), i);//提取图标        Icon1->Handle=hIcon;        ImageList1->AddIcon(Icon1);        ListItem1=ListView1->Items->Add();        ListItem1->Caption=ListView1->GetCount()-1;        ListItem1->ImageIndex=i;    } 

热点排行