| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 840 人关注过本帖
标题:[求助]看下怎么程序那里错了
只看楼主 加入收藏
lubin542397
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2007-1-8
收藏
 问题点数:0 回复次数:11 
[求助]看下怎么程序那里错了

Option Explicit
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_CAPPTON = &HC00000
Private Const WS_MAXINIZEBOX = &H10000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_SYSMENU = &H80000
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Enum ESetWindowposStyles
SWP_SHOWWINDOW = &H40
SWP_HIDEWINDOW = &H80
SWP_FRMECHANGED = &H20
SWP_NOACTIVATE = &H10
SWP_NOCOPYBITS = &H100
SWP_NOMOVE = &O2
SWP_NOOWNERZORDER = &H200
SWP_NOREDRAW = &H8
SWP_NOREPOSITION = SWP_NOOWNERZORDER
SWP_NOSIZE = &H1
SWP_NOZORDER = &H4
SWP_DRAWFRAME = SWP_FRMECHANGED
HWND_NOTOPMOST = -2
End Enum
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long

Private Function ShowTitlebar(ByVal bState As Boolean)
Dim lStyle As Long
Dim tR As RECT
GetWindowRect Me.hwnd, tR
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
If (bState) Then
Me.Caption = Me.Tag
If Me.ControlBox Then
lStyle = lStyle Or WS_STYLE
End If
If Me.MaxButton Then
lStyle = lStyle Or WS_MAXIMIZEBOX
End If
If Me.MinButton Then
lStyle = lStyle Or WS_MINIMIZEBOX
End If
If Me.Caption <> "" Then
lStyle = lStyle Or WS_CAPPTON
End If
Else
Me.Tag = Me.Caption
Me.Caption = ""
lStyle = lStyle And Not WS_SYSMENU
lStyle = lStyle And Not WS_MAXIMIZEBOX
lStyle = lStyle And Not WS_MINIMIZEBOX
lStyle = lStyle And Not WS_CAPPTON
End If
SetWindowLong Me.hwnd, GWL_STYLE, lStyle
SetWindowPos Me.hwnd, 0, tR.let, tR.Top, tR.Right - tR.Left, tR.bottom - tR.Top, SWP_NOREPOSITION Or WEP_NOZORDER Or SWEP_FRAMECHANGED
Me.Refresh
End Function
Private Sub Command1_Click()
ShowTitlebar False
Me.Picture = LoadPicture("C:\Documents and Settings\lubin\桌面\27.gif")
Command1.Visible = False
Command2.Visible = True
End Sub

Private Sub Command2_Click()
Dim msg As String
Dim cl As String
ShowTitlebar True
Me.FontSize = 16
Me.Picture = LoadPicture("")
cl = Chr(13) & Chr(10)
msg = " 日冕山" & cl & " 纱锭哈"
msg = msg & cl & " 三点会反对后" & cl & " 看法大家看见"
Cls
Print: Print: Print
Print msg
Command2.Visible = False
Command1.Visible = True
End Sub

Private Sub Form_Click()
End
End Sub

Private Sub Form_Load()
Command1.Visible = True
Command2.Visible = False
End Sub
我运行后老是说Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long这句是未定义!

2007-09-27 20:11
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
放错地方了
2007-09-27 21:19
simpson
Rank: 3Rank: 3
等 级:论坛游民
威 望:7
帖 子:863
专家分:17
注 册:2006-11-16
收藏
得分:0 
yes

全国最大的 Java专业电子书免费分享[url]http:///in.asp?id=xrmao[/url]
2007-09-27 23:09
Joforn
Rank: 6Rank: 6
等 级:贵宾
威 望:23
帖 子:1242
专家分:122
注 册:2007-1-2
收藏
得分:0 
RECT类型没有定义,鉴定完毕。

VB QQ群:47715789
2007-09-28 09:18
缘吇弹
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:地球
等 级:版主
威 望:43
帖 子:3038
专家分:27
注 册:2007-7-2
收藏
得分:0 
以下是引用lubin542397在2007-9-27 20:11:29的发言:

Option Explicit
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const WS_CAPPTON = &HC00000
Private Const WS_MAXINIZEBOX = &H10000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_SYSMENU = &H80000
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Enum ESetWindowposStyles
SWP_SHOWWINDOW = &H40
SWP_HIDEWINDOW = &H80
SWP_FRMECHANGED = &H20
SWP_NOACTIVATE = &H10
SWP_NOCOPYBITS = &H100
SWP_NOMOVE = &O2
SWP_NOOWNERZORDER = &H200
SWP_NOREDRAW = &H8
SWP_NOREPOSITION = SWP_NOOWNERZORDER
SWP_NOSIZE = &H1
SWP_NOZORDER = &H4
SWP_DRAWFRAME = SWP_FRMECHANGED
HWND_NOTOPMOST = -2
End Enum
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long

Private Function ShowTitlebar(ByVal bState As Boolean)
Dim lStyle As Long
Dim tR As RECT
GetWindowRect Me.hwnd, tR
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
If (bState) Then
Me.Caption = Me.Tag
If Me.ControlBox Then
lStyle = lStyle Or WS_STYLE
End If
If Me.MaxButton Then
lStyle = lStyle Or WS_MAXIMIZEBOX
End If
If Me.MinButton Then
lStyle = lStyle Or WS_MINIMIZEBOX
End If
If Me.Caption <> "" Then
lStyle = lStyle Or WS_CAPPTON
End If
Else
Me.Tag = Me.Caption
Me.Caption = ""
lStyle = lStyle And Not WS_SYSMENU
lStyle = lStyle And Not WS_MAXIMIZEBOX
lStyle = lStyle And Not WS_MINIMIZEBOX
lStyle = lStyle And Not WS_CAPPTON
End If
SetWindowLong Me.hwnd, GWL_STYLE, lStyle
SetWindowPos Me.hwnd, 0, tR.let, tR.Top, tR.Right - tR.Left, tR.bottom - tR.Top, SWP_NOREPOSITION Or WEP_NOZORDER Or SWEP_FRAMECHANGED
Me.Refresh
End Function
Private Sub Command1_Click()
ShowTitlebar False
Me.Picture = LoadPicture("C:\Documents and Settings\lubin\桌面\27.gif")
Command1.Visible = False
Command2.Visible = True
End Sub

Private Sub Command2_Click()
Dim msg As String
Dim cl As String
ShowTitlebar True
Me.FontSize = 16
Me.Picture = LoadPicture("")
cl = Chr(13) & Chr(10)
msg = " 日冕山" & cl & " 纱锭哈"
msg = msg & cl & " 三点会反对后" & cl & " 看法大家看见"
Cls
Print: Print: Print
Print msg
Command2.Visible = False
Command1.Visible = True
End Sub

Private Sub Form_Click()
End
End Sub

Private Sub Form_Load()
Command1.Visible = True
Command2.Visible = False
End Sub
我运行后老是说Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long这句是未定义!

计算机都说了


Repeat  Life=Study;Until (death);
2007-09-28 12:32
junxi1
Rank: 1
等 级:新手上路
威 望:1
帖 子:213
专家分:0
注 册:2007-9-17
收藏
得分:0 
Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long

原因是里面的RECT没有进行声明引用

foreach( in ){ }
2007-09-28 13:35
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
太丢人了。
2007-09-28 14:58
随风逐流
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:passerby
等 级:版主
威 望:8
帖 子:4054
专家分:271
注 册:2007-6-13
收藏
得分:0 

[url=http://www./html/6/6694/]极道金丹[/url][url=http://www./html/2/2849/]九阴九阳[/url][url=http://www./html/2/2596/]凡人修仙传[/url]
2007-09-28 15:08
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 

楼主可以去学语文了:“看下怎么程序那里错了”

2007-09-28 15:13
purana
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:广东-广州
等 级:版主
威 望:66
帖 子:6039
专家分:0
注 册:2005-6-17
收藏
得分:0 
不丢人.
所谓"闻道有先后,术业有专攻"
楼主加油.

我的msn: myfend@
2007-09-28 15:22
快速回复:[求助]看下怎么程序那里错了
数据加载中...
 
   



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

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