| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2708 人关注过本帖
标题:[求助]Private Declare Function....
只看楼主 加入收藏
douya1012
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2006-8-8
收藏
 问题点数:0 回复次数:6 
[求助]Private Declare Function....
这是声明在 通用 中一个 我也不知道它是不是一个函数。。
Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
请知道的讲解一下它的功能是什么 每个参数都是什么意思。。。。。谢谢
搜索更多相关主题的帖子: Function Declare Private ByVal 
2006-08-08 11:48
学习VB才2天
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1653
专家分:0
注 册:2006-5-4
收藏
得分:0 

winDOWS的帮助API吧。在百度上搜一下吧。。

[此贴子已经被作者于2006-8-8 11:53:33编辑过]


[GLOW=255,DeepPink,3]我的免费网盘[/GLOW]
2006-08-08 11:52
douya1012
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2006-8-8
收藏
得分:0 
是吗
我查过API了 里面好象没有这个 东西啊

2006-08-08 11:54
学习VB才2天
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1653
专家分:0
注 册:2006-5-4
收藏
得分:0 

恩 我给一个例子,自己看吧。。

Private Declare Function OSWinHelp% Lib"user32"Alias"WinHelpA"(ByVal hωnd&,ByVal HelpFile$, ByVal wCommand%, dwData As Any)
Private Sub Command1_Click()
Dim b(), bi(),bs(), BT(), m(4, 4), mt(), vt(), ω(4, 4), ωb(4, 4), ωbt(), ωt(), uo(), u(1, 4),PB(), pbb(), pp(), Tzdc(4, 4)
Dim ωi As Integer
‘从文本框中读取参数,多边形顶点坐标值到相应的数组.
u1 = Val(Text1)
u2 = Val(Text2)
N = Val(Text3)
ReDim uo(1, N)
For i = 0 To N
uo(1, i) = u1 + ((u2 - u1) * i) / N
Next i
If WBLN = False Then
ReDim bi(4, 4, 1), p(2, N, 1), b(4, 4)
For i = 0 To 3
bi(1, i + 1, 1) = Val(Tbx(i))
bi(2, i + 1, 1) = Val(Tby(i))
Next i
End If
If YLBLN = False Then
wi = 1
Else
If WBLN = False Then
'//////非有理
ReDim w(1, 4)
For i = 0 To 3
w(1, i + 1) = Val(tw(i))
Next i
End If
End If
'/////////
For i = 1 To 4
For j = 1 To 4
Tzdc(i, j) = 0
Next j
Next i
Tzdc(1,1)=0.7071:Tzdc(1,2)=0.4082:Tzdc(2,2)=0.8165
Tzdc(3,1)=0.7071:Tzdc(3,2)=-0.4082:Tzdc(4,4)=1
Rem设定M矩阵.
Select Case selectN
‘在曲线菜单上选择Bezier有理或非有理子菜单,对应执行CASE O或CASE 1.
Case 0:'//曲线——Bezier_有理
'/////////////////
‘首先设定绘图参数.
k1 = bi(1, 1, 1)
k2 = bi(2, 1, 1)
For k = 1 To 4
If bi(1,k, 1) > k1 Then k1 = bi(1, k, 1)
If bi(2,k, 1) > k2 Then k2 = bi(2, k, 1)
Next k
x2=1.2*k1
y2=1.2*k2
Pic.Scale(-x2/5,-y2/5)-(x2,y2)
Pic.Line(0,0)-(0,y2*0.9)
Pic.Line(0,y2*0.9)-(x2*0.8,y2*0.9)
Pic.DrawWidth=4
For i=1 To 4
Pic.PSet(bi(1,i,1),y2-bi(2,i,1)),vbRed
Next i
Pic.DrawWidth=1
Pic.CurrentX=bi(1,1,1)
Pic.CurrentY=y2-bi(2,1,1)
For i=2 To 4
Pic.Line-(bi(1,i,1),y2-bi(2,i,1)),vbBlack
Next I
'b/////////////
‘由读取的参数,多边形顶点坐标值,权因子值等计算模拟曲线上点的坐标值.
For IB = 1 To 2
For IA = 0 To N
ua = uo(1, IA)
For ii = 1 To 4
u(1, ii) = ua ^ (4 - ii)
Next ii
Call ZZ(w, 1, 4, wt)
For i = 1 To 4
b(1, i) = bi(IB, i, 1)
Next i
For i = 1 To 4
wb(1, i) = w(1, i) * b(1, i)
Next i
Call ZZ(wb, 1, 4, wbt)
Call JZji(u, 1, 4, m, 4, 4, nj)
Call JZji(nj, 1, 4, wbt, 4, 1, pp)
Call JZji(nj, 1, 4, wt, 4, 1, PB)
If PB(1, 1) = 0 Then p(IB, IA, 1) = 0
Else
p(IB, IA, 1) = pp(1, 1) / PB(1, 1)
End If
Next IA
Next IB
‘由绘图命令画出多边形和模拟的曲线.
Pic.DrawWidth = 1
For i = 0 To N - 1
Pic.CurrentX = p(1, i, 1)
Pic.CurrentY = y2 - p(2, i, 1)
Pic.Line -(p(1, i + 1, 1), y2 - p(2, i + 1, 1)), vbBlue
Next I
‘把模拟曲线上点的坐标值存入文本中,便于管理.
Open "T21.TXT" For Output As #1
For k = 0 To N
Print #1, p(1, k, 1); " "; p(2, k, 1)
Print #1,".............................."
Next k
Close #1
Case 1: '//曲线——Bezier_非有理.
‘首先设定绘图参数.
For IB = 1 To 2
For IA = 0 To N
ua = uo(1, IA)
For ii = 1 To 4
u(1, ii) = ua ^ (4 - ii)
Next ii
For i = 1 To 4
b(1, i) = bi(IB, i, 1)
Next i
Call ZZ(b, 1, 4, wbt)
Call JZji(u, 1, 4, m, 4, 4, nj)
Call JZji(nj, 1, 4, wbt, 4, 1, pp)
p(IB, IA, 1) = pp(1, 1)
Next IA
Next IB
Pic.DrawWidth = 1
For i = 0 To N - 1
Pic.CurrentX = p(1, i, 1)
Pic.CurrentY = y2 - p(2, i, 1)
Pic.Line -(p(1, i + 1, 1), y2 - p(2, i + 1, 1)), vbYellow
Next i
Open "T12.TXT" For Output As #1
For k = 0 To N
Print #1, p(1, k, 1); " "; p(2, k, 1)
Print #1,"..............................."
Next k
Close #1
End Select
End Sub
‘对Bezier非有理进行参数设置.
Private Sub NYL1_Click()
WBLN = False
YLBLN = False
selectN = 1
Fra.Visible = True
lx = frmMain.Width
ly = frmMain.Height
Pic.Move 0.5 * lx, 0.06 * ly, 0.45 * lx, 0.8 * ly
For i = 0 To 4
'Frl(i).Enabled = False
Next i
For i = 0 To 3
Tbz(i).Enabled = False
Next i
For i = 1 To 3
Frame4(i).Enabled = False
Next i
For i = 0 To 3
Tbx(i).Enabled = True
Tby(i).Enabled = True
Next
End Sub
'对Bezier有理进行参数设置.
Private Sub YL1_Click()
WBLN = False
YLBLN = True
selectN = 0
Fra.Visible = True
lx = frmMain.Width
ly = frmMain.Height
Pic.Move 0.5 * lx, 0.06 * ly, 0.45 * lx, 0.8 * ly
For i = 0 To 3
'Frl(i).Enabled = False
Next i
For i = 0 To 3
Tbz(i).Enabled = False
Next i
For i = 1 To 3
Frame4(i).Enabled = False
Next i
For i = 0 To 3
tw(i).Enabled = True
Tbx(i).Enabled = True
Tby(i).Enabled = True
Tbz(i).Enabled = False
Next
End Sub
'以下是矩阵运算子模块.
Public fMainForm As frmMain
Public N, NV, selectN As Integer
Public WBLN, YLBLN As Boolean
Public j3(), p2()
Public Sub JZji(j1, x1, y1, j2, x2, y2, j3)
ReDim j3(x1, y2)
Dim jk As Integer
If y1 <= x2 Then
jk = y1
Else
jk = x2
End If
For i = 1 To x1
For j = 1 To y2
na = 0
For jj = 1 To jk
na = na + j1(i, jj) * j2(jj, j)
Next jj
j3(i, j) = na
Next j
Next i
End Sub
Public Sub RALIZE()
End Sub

Public Sub ZZ(p1, x1, y1, p2)
ReDim p2(y1, x1)
For i = 1 To y1
For j = 1 To x1
p2(i, j) = p1(j, i)
Next j
Next i
End Sub
Public Sub palizeline()
w_x = frmMain.Pic.Width
w_y = frmMain.Pic.Height
frmMain.Pic.Cls
frmMain.Pic.DrawWidth = 1
frmMain.Pic.CurrentX = w_x * 0.05
frmMain.Pic.CurrentY = w_y * 0.9
frmMain.Pic.Line -(0.05 * w_x, 0.05 * w_y), vbBlack
'/////////////
frmMain.Pic.CurrentX = w_x * 0.05
frmMain.Pic.CurrentY = w_y * 0.9
frmMain.Pic.Line -(0.95 * w_x, 0.9 * w_y), vbBlack
End


[GLOW=255,DeepPink,3]我的免费网盘[/GLOW]
2006-08-08 11:58
leon2
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:731
专家分:0
注 册:2005-3-18
收藏
得分:0 
Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)

第一个参数是指定打开帮助的窗体句柄,即 handle。
第二个是要打开的帮助文件,第三个和第四个都是用来定位帮助索引的吧。。。
2006-08-09 18:29
yeshirow
Rank: 4
等 级:贵宾
威 望:10
帖 子:854
专家分:0
注 册:2006-6-8
收藏
得分:0 

[MSDN]

BOOL WinHelp( HWND hWndMain,
LPCTSTR lpszHelp,
UINT uCommand,
ULONG_PTR dwData
);
-------------------------------------------
Starts Microsoft Windows Help (Winhelp.exe) and passes additional data that indicates the nature of the help requested by the application.
------------------------------------------
Parameters

[hWndMain]:
Handle to the window requesting help. The WinHelp function uses this handle to keep track of which applications have requested help. If the uCommand parameter specifies HELP_CONTEXTMENU or HELP_WM_HELP, hWndMain identifies the control requesting help.

[lpszHelp]:
Address of a null-terminated string containing the path, if necessary, and the name of the Help file that WinHelp is to display.

The file name can be followed by an angle bracket (>) and the name of a secondary window if the topic is to be displayed in a secondary window rather than in the primary window. You must define the name of the secondary window in the [WINDOWS] section of the Help project (.hpj) file.

[uCommand]
Type of help requested. For a list of possible values and how they affect the value to place in the dwData parameter, see the Remarks section.
dwData
Additional data. The value used depends on the value of the uCommand parameter. For a list of possible dwData values, see the Remarks section.


Return Value

Returns nonzero if successful, or zero otherwise. To retrieve extended error information, call GetLastError.


原來朋友仔感情再天真, 亦是我永遠也會愛惜的人, 明日愛他人, 也記住學會不要緊; 原來朋友比戀人更高分, 亦讓我開始懂得不記恨, 若大家都敏感, 我更要永遠記得拒絕再因小事怪人, 爲何沒有這條校訓...Twins-朋友仔 MCSD Training
2006-08-10 06:16
douya1012
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2006-8-8
收藏
得分:0 
谢谢了。。。
超级羡慕楼上的 英语。。。
不知道有没有中文版本的 MSDN。。
惭愧洋文不好啊

2006-08-10 08:29
快速回复:[求助]Private Declare Function....
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028754 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved