DrawIconEx [英] DrawIconEx

查看:64
本文介绍了DrawIconEx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用DrawIconEx的确切语法

DrawIconEx(System.Windows.Forms.PictureBox1.hdc,_

0,_

0,_

lngmIcon,_

660,_

450,_

0,_

0,_

DI_NORMAL)

你可以看到它不起作用。我尝试添加.PictureBox1(控件的名称

)并且它也没有工作。

我是新手,所以请耐心等待我。

Marshall

What is the exact syntax for using DrawIconEx
DrawIconEx(System.Windows.Forms.PictureBox1.hdc, _
0, _
0, _
lngmIcon, _
660, _
450, _
0, _
0, _
DI_NORMAL)
as you can see it doesn''t work. I tried adding .PictureBox1 (the name
of the control) and it didn''t work either.
I''m new to this, so please bear with me.
Marshall

推荐答案

私有声明函数ExtractAssociatedIcon Lib" shell32.dll" Alias

" ExtractAssociatedIconA" (ByVal hInst As Long,ByVal lpIconPath As String,

lpiIcon As Long)As Long


私有声明函数DrawIconEx Lib" user32" (ByVal hdc As Long,ByVal

xLeft As Long,ByVal yTop As Long,ByVal hIcon As Long,ByVal cxWidth As

Long,ByVal cyWidth As Long,ByVal istepIfAniCur As Long,ByVal

hbrFlickerFreeDraw As Long,ByVal diFlags As Long)


私有声明功能DestroyIcon Lib" user32" (ByVal hIcon As Long)As

Long


为什么要使用非托管代码?好奇。


-

使用KJM获取功能强大的网络,数据库,应用程序和电子邮件托管

解决方案
http://www.kjmsolutions.com


Marshall < RA **** @ oriok.net>在消息中写道

news:11 ********************** @ g44g2000cwa.googlegr oups.com ...
Private Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias
"ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String,
lpiIcon As Long) As Long

Private Declare Function DrawIconEx Lib "user32" (ByVal hdc As Long, ByVal
xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As
Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal
hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long

Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As
Long

Why do you want to use unmanaged code? Just curious.

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com

"Marshall" <ra****@oriok.net> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
使用DrawIconEx的确切语法是什么
DrawIconEx(System.Windows.Forms.PictureBox1.hdc,_
0,_
0,_
lngmIcon,_
660,_
450,_
0,_
0,_
DI_NORMAL)
你可以看到它不起作用。我尝试添加.PictureBox1(控件的名称
)并且它也没有用。
我是新手,所以请耐心等待。
Marshall
What is the exact syntax for using DrawIconEx
DrawIconEx(System.Windows.Forms.PictureBox1.hdc, _
0, _
0, _
lngmIcon, _
660, _
450, _
0, _
0, _
DI_NORMAL)
as you can see it doesn''t work. I tried adding .PictureBox1 (the name
of the control) and it didn''t work either.
I''m new to this, so please bear with me.
Marshall





vbnetdev写道:

vbnetdev wrote:
私有声明函数ExtractAssociatedIcon Lib" shell32.dll"别名
ExtractAssociatedIconA (ByVal hInst As Long,ByVal lpIconPath As String,
lpiIcon As Long)长期

私有声明函数DrawIconEx Lib" user32" (ByVal hdc As Long,ByVal
xLeft As Long,ByVal yTop As Long,ByVal hIcon As Long,ByVal cxWidth As
Long,ByVal cyWidth As Long,ByVal istepIfAniCur As Long,ByVal
hbrFlickerFreeDraw As Long,ByVal diFlags As Long)

私有声明功能DestroyIcon Lib" user32" (ByVal hIcon As Long)作为


为什么要使用非托管代码?好奇。

-
使用KJM获得强大的网络,数据库,应用程序和电子邮件主机
http://www.kjmsolutions.com

vbnetdev:

我''我做了这一切。我只是把我的代码脱离了背景。

我不认为我必须展示它。

这只是DrawIconEx(System.WIndows) .Forms.PictureBox.Picture 1.hdc

也不起作用。

那么System.Forms的语法是什么.....?

Marshall

" Marshall"< ra **** @ oriok.net>在留言中写道
新闻:11 ********** ************@g44g2000cwa.googlegr oups.com ...
Private Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias
"ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String,
lpiIcon As Long) As Long

Private Declare Function DrawIconEx Lib "user32" (ByVal hdc As Long, ByVal
xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As
Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal
hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long

Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As
Long

Why do you want to use unmanaged code? Just curious.

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com
vbnetdev:
I''ve done all that. I just took my code out of context.
I didn''t think that I had to show it all.
It''s just that DrawIconEx(System.WIndows.Forms.PictureBox.Picture 1.hdc
doesn''t work either.
So what is the syntax for System.Forms.....?
Marshall

"Marshall" <ra****@oriok.net> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
使用DrawIconEx的确切语法
DrawIconEx(System.Windows.Forms。 PictureBox1.hdc,_
0,_
0,_
lngmIcon,_
660,_
450,_
0,_
0,_
DI_NORMAL)
你可以看到它不起作用。我尝试添加.PictureBox1(控件的名称
)并且它也没有用。
我是新来的是的,请耐心等待。
Marshall
What is the exact syntax for using DrawIconEx
DrawIconEx(System.Windows.Forms.PictureBox1.hdc, _
0, _
0, _
lngmIcon, _
660, _
450, _
0, _
0, _
DI_NORMAL)
as you can see it doesn''t work. I tried adding .PictureBox1 (the name
of the control) and it didn''t work either.
I''m new to this, so please bear with me.
Marshall






" vbnetdev" < VB ****** @ community.nospam> schrieb
"vbnetdev" <vb******@community.nospam> schrieb
私有声明函数ExtractAssociatedIcon Lib" shell32.dll"
Alias" ExtractAssociatedIconA" (ByVal hInst As Long,ByVal
lpIconPath As String,lpiIcon As Long)As Long

私有声明函数DrawIconEx Lib" user32" (ByVal hdc As Long,
ByVal xLeft As Long,ByVal yTop As Long,ByVal hIcon As Long,ByVal
cxWidth As Long,ByVal cyWidth As Long,ByVal istepIfAniCur As Long,
ByVal
hbrFlickerFreeDraw As Long,ByVal diFlags As Long)

私有声明功能DestroyIcon Lib" user32" (ByVal hIcon As
Long)As Long
Private Declare Function ExtractAssociatedIcon Lib "shell32.dll"
Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal
lpIconPath As String, lpiIcon As Long) As Long

Private Declare Function DrawIconEx Lib "user32" (ByVal hdc As Long,
ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal
cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long,
ByVal
hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long

Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As
Long) As Long



您的代码是VB6代码,但这是一个VB.Net组。


正确的声明是:(未经验证)


私有声明函数ExtractAssociatedIcon Lib" shell32.dll"

Alias" ExtractAssociatedIconA" (ByVal hInst as intptr,ByVal

lpIconPath As String,byref lpiIcon As Integer)as intptr


私有声明函数DrawIconEx Lib" user32" (ByVal hdc As intptr,

ByVal xLeft As integer,ByVal yTop As integer,ByVal hIcon As intptr,ByVal

cxWidth As integer,ByVal cyWidth As integer,ByVal istepIfAniCur As

整数,

ByVal hbrFlickerFreeDraw作为intptr,ByVal diFlags作为整数)作为布尔值


(在VB 2005中你可以使用istepIfAniCur的无符号整数类型和

diFlags。)

私有声明函数DestroyIcon Lib" user32" (ByVal hIcon As

intptr)作为boolean

但我同意我们应尽可能使用托管版本。在Framework 2.0中BTW,

,有Icon.ExtractAssociatedIcon方法。

Armin


Your code is VB6 code but this is a VB.Net group.

The correct declaration is: (unverified)

Private Declare Function ExtractAssociatedIcon Lib "shell32.dll"
Alias "ExtractAssociatedIconA" (ByVal hInst As intptr, ByVal
lpIconPath As String, byref lpiIcon As Integer) As intptr

Private Declare Function DrawIconEx Lib "user32" (ByVal hdc As intptr,
ByVal xLeft As integer, ByVal yTop As integer, ByVal hIcon As intptr, ByVal
cxWidth As integer, ByVal cyWidth As integer, ByVal istepIfAniCur As
integer,
ByVal hbrFlickerFreeDraw As intptr, ByVal diFlags As integer) As boolean

(In VB 2005 you can use the Unsigned Integer type for istepIfAniCur and
diFlags.)

Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As
intptr) As boolean
But I agree that we should use the managed version wherever possible. BTW,
in Framework 2.0, there is the Icon.ExtractAssociatedIcon method.
Armin


这篇关于DrawIconEx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆