Skip to content

Commit

Permalink
some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz committed Mar 7, 2016
1 parent b4cc36b commit 41c9255
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Chemistry.vbp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Description="Chemical Tools"
CompatibleMode="0"
MajorVer=2
MinorVer=0
RevisionVer=3
RevisionVer=6
AutoIncrementVer=1
ServerSupportFiles=0
VersionCompanyName="����ʦ����ѧ�Ŷ�һ��"
Expand Down
14 changes: 7 additions & 7 deletions Chemistry.vbw
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
frmMain = 388, 183, 916, 594, , 298, 28, 891, 616, C
frmMain = 388, 158, 916, 594, C, 298, 28, 891, 616, C
modCalculate = -25, 70, 902, 494, C
modData = 180, -16, 1043, 526,
modData = 180, -16, 1043, 526, C
frmElement = 34, 92, 920, 532, C, 104, 104, 990, 544, C
frmMass = 214, 191, 1104, 631, C, 43, 123, 929, 617, C
modUI = 3, 259, 889, 695,
modMain = 194, 289, 1080, 729,
modUI = 157, 25, 1043, 461, C
modMain = 194, 289, 1080, 729, C
modExam = 40, 26, 926, 466, C
frmExam = 162, 158, 1093, 598, C, 133, 77, 1019, 548, C
frmAbout = 104, 104, 989, 544, , 156, 142, 1042, 596, C
frmAbout = 104, 104, 989, 544, C, 156, 142, 1042, 596, C
frmOptions = 160, 118, 1046, 558, C, 108, 6, 994, 564, C
frmLogin = 445, 53, 1001, 477, , 74, 117, 601, 541, C
frmLogin = 445, 53, 1001, 477, C, 74, 117, 600, 541, C
frmSignUp = 0, 0, 527, 424, C, 499, 63, 1026, 487, C
FrmChangePassword = 389, 177, 1274, 617, , 156, 156, 1041, 596, C
FrmChangePassword = 167, 159, 1051, 599, C, 156, 156, 1041, 596, C
6 changes: 3 additions & 3 deletions FrmChangePassword.frm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Begin VB.Form FrmChangePassword
ClientLeft = 0
ClientTop = 0
ClientWidth = 4560
Icon = "FrmChangePassword.frx":0000
LinkTopic = "Form1"
ScaleHeight = 5175
ScaleWidth = 4560
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdPasswordChange
Caption = "修改密码"
Expand Down Expand Up @@ -108,7 +108,7 @@ Begin VB.Form FrmChangePassword
Begin VB.Image imgClose
Height = 450
Left = 4080
Picture = "FrmChangePassword.frx":0000
Picture = "FrmChangePassword.frx":1B692
Stretch = -1 'True
Top = 0
Width = 450
Expand All @@ -117,7 +117,7 @@ Begin VB.Form FrmChangePassword
Appearance = 0 'Flat
Height = 2145
Left = -1440
Picture = "FrmChangePassword.frx":14F4
Picture = "FrmChangePassword.frx":1CB86
Stretch = -1 'True
Top = 0
Width = 7335
Expand Down
Binary file modified FrmChangePassword.frx
Binary file not shown.
1 change: 0 additions & 1 deletion frmAbout.frm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Begin VB.Form frmAbout
ScaleHeight = 3530.464
ScaleMode = 0 'User
ScaleWidth = 5380.766
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.PictureBox picIcon
AutoSize = -1 'True
Expand Down
1 change: 0 additions & 1 deletion frmElement.frm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Begin VB.Form frmElement
LinkTopic = "Form1"
ScaleHeight = 5610
ScaleWidth = 5760
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdCopy
Caption = "复制到剪切板"
Expand Down
1 change: 0 additions & 1 deletion frmExam.frm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Begin VB.Form frmExam
LinkTopic = "Form1"
ScaleHeight = 5970
ScaleWidth = 6165
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdCopyScore
Caption = "分享战绩"
Expand Down
8 changes: 4 additions & 4 deletions frmLogin.frm
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Begin VB.Form frmLogin
ClientTop = 0
ClientWidth = 7335
ForeColor = &H00FFFFFF&
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
ScaleHeight = 4995
ScaleWidth = 7335
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CheckBox chkAutoLogin
BackColor = &H00C0FFFF&
Expand Down Expand Up @@ -106,7 +106,7 @@ Begin VB.Form frmLogin
Begin VB.Image imgClose
Height = 450
Left = 6840
Picture = "frmLogin.frx":0000
Picture = "frmLogin.frx":1B692
Stretch = -1 'True
Top = 0
Width = 450
Expand All @@ -115,7 +115,7 @@ Begin VB.Form frmLogin
Appearance = 0 'Flat
Height = 2145
Left = 0
Picture = "frmLogin.frx":14F4
Picture = "frmLogin.frx":1CB86
Stretch = -1 'True
Top = 0
Width = 7335
Expand All @@ -134,7 +134,7 @@ Private Sub cmdLogin_Click()
If dataLogin(texUsername, texPassword, chkPassword.value, chkAutoLogin.value) = True Then
Me.Hide
frmMain.Show
If UIFormLoad(Me) Then Unload Me
If UIFormLoad(Me) Then Me.Hide
Else
MsgBox "用户名或密码错误!", vbOKOnly, "登陆失败"
End If
Expand Down
Binary file modified frmLogin.frx
Binary file not shown.
1 change: 0 additions & 1 deletion frmMass.frm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Begin VB.Form frmMass
LinkTopic = "Form1"
ScaleHeight = 6240
ScaleWidth = 7785
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdCopy
Caption = "复制到剪切板"
Expand Down
1 change: 0 additions & 1 deletion frmOptions.frm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Begin VB.Form frmOptions
MinButton = 0 'False
ScaleHeight = 7515
ScaleWidth = 6090
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.PictureBox picOptions
BorderStyle = 0 'None
Expand Down
Binary file modified frmOptions.frx
Binary file not shown.
6 changes: 3 additions & 3 deletions frmSignUp.frm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Begin VB.Form frmSignUp
ClientWidth = 4875
FillColor = &H00C0FFFF&
ForeColor = &H00C0FFFF&
Icon = "frmSignUp.frx":0000
LinkTopic = "Form1"
ScaleHeight = 5400
ScaleWidth = 4875
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdSignUp
Caption = "注册!"
Expand Down Expand Up @@ -73,7 +73,7 @@ Begin VB.Form frmSignUp
Begin VB.Image imgClose
Height = 450
Left = 4440
Picture = "frmSignUp.frx":0000
Picture = "frmSignUp.frx":1B692
Stretch = -1 'True
Top = 0
Width = 450
Expand Down Expand Up @@ -136,7 +136,7 @@ Begin VB.Form frmSignUp
Appearance = 0 'Flat
Height = 2145
Left = -1320
Picture = "frmSignUp.frx":14F4
Picture = "frmSignUp.frx":1CB86
Stretch = -1 'True
Top = 0
Width = 7335
Expand Down
Binary file modified frmSignUp.frx
Binary file not shown.
8 changes: 5 additions & 3 deletions main.frm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Begin VB.Form frmMain
MaxButton = 0 'False
ScaleHeight = 4680
ScaleWidth = 7425
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdNewPassword
Caption = "修改密码"
Expand Down Expand Up @@ -47,6 +46,7 @@ Begin VB.Form frmMain
Width = 1455
End
Begin VB.CommandButton cmdfrmElement
BackColor = &H00C0FFFF&
Caption = "元素查询"
Height = 615
Left = 600
Expand Down Expand Up @@ -139,9 +139,11 @@ End Sub

Private Sub Form_Load()
lblWelcome = "欢迎" & DataUsername & "!这是您第" & str(DataUseNumber) & "次使用化学小工具!"
'托盘
Call UIAddIcon
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End Sub
Expand All @@ -150,7 +152,7 @@ Private Sub imgClose_Click()
End
End Sub

Private Sub imgTitle_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
Private Sub imgTitle_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End Sub
Binary file modified mdb/User.mdb
Binary file not shown.
40 changes: 40 additions & 0 deletions modUI.bas
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@ Declare Function ReleaseCapture Lib "user32" () As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const HTCAPTION = 2
Public Const WM_NCLBUTTONDOWN = &HA1
'托盘
Public Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Public Type NOTIFYICONDATA
cbSize As Long 'NOTIFYICONDATA类型的大小,用 Len(变量名)获得即可
hwnd As Long '窗体句柄
uId As Long '图标资源的ID,通常使用 vbNull
uFlags As Long '使哪些参数有效,它是以下枚举类型中的 NIF_INFO Or NIF_ICON Or NIF_TIP Or NIF_MESSAGE 四个数的组合
uCallBackMessage As Long '接受消息的事件
hIcon As Long '图标句柄
szTip As String * 128 '当鼠标停留在托盘上时显示的文本
dwState As Long '通常为 0
dwStateMask As Long '通常为 0
szInfo As String * 256 'Tip 文本正文
uTimeoutOrVersion As Long 'Tip 文本显示时间,由于 VB 没有 Union 类型,只能以 Long 代替
szInfoTitle As String * 64 'Tip 文本标题
dwInfoFlags As Long
End Type
Public Const NIF_INFO = &H10
Public sampleTray As NOTIFYICONDATA
Public Const NIIF_INFO = &H1

Public Function UICopy(x As String)
Clipboard.Clear
Expand All @@ -22,3 +42,23 @@ Public Function UIFormLoad(ByRef frmIn As Form) As Boolean
End If
Next
End Function

Public Function UIAddIcon()
With sampleTray '* 设置托盘属性
.cbSize = Len(sampleTray)
.cbSize = Len(sampleTray)
.hwnd = frmMain.hwnd ''
.uId = vbNull ''
.uFlags = NIF_INFO Or NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.hIcon = frmMain.Icon
.szInfoTitle = "化学小工具" & vbNullChar
.szTip = szTip & vbNullChar
.szInfo = "欢迎使用化学小工具!" & vbNullChar
.dwState = 0
.dwStateMask = 0
.uTimeoutOrVersion = 2000
.dwInfoFlags = NIIF_INFO
.uCallBackMessage = WM_MOUSEMOVE
End With
Call Shell_NotifyIcon(NIM_ADD, sampleTray)
End Function

0 comments on commit 41c9255

Please sign in to comment.