Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Foreign Languages > Other languages > Chinese Forum
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

systray

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-14-2009, 04:12 PM
Newbie
 
Join Date: Jan 2009
Posts: 3
Default systray

下面是一个系统托盘程序代码
Sub Globals
'设备端添加NotifyIcon.dll,dzHW.dll外部库。PC桌面端添加 NotifyIconDesktop.dll,dzHWdesktop.dll外部库.
Dim ExitCondition
AppName ="系统托盘程序演示"
EmailName = "tmxt_fy@qq.com"
CompanyName = "@ 2009 云飞工作室"
VersionNumber = "V 1.0.0-测试版"
End Sub
Sub App_Start
'初始值'初始化类的外部库
ExitCondition = False
dzHW.New1 '创建dzHW组件
ni.New1 '创建NotifyIcon组件
Form1.Text = AppName
ni.IconText = AppName '设置图标文字,设备端设备端不显示
ni.Add
Form1.Show

End Sub
Sub mnuAbout_Click
'关于
Msgbox(AppName & CRLF & VersionNumber & CRLF & CompanyName & CRLF & EmailName, "关于")
End Sub
Sub mnuExit_Click
'退出程序
ExitCondition = True
AppClose
End Sub
Sub Form1_Close
'关闭事件
If ExitCondition = False Then
'要求关闭。不关闭...
form1.CancelClose
'...隐藏窗口 - SW_HIDE
dzHW.ShowWindow(dzHW.GetActiveWindowHandle, 0)
Else
'删除图标
ni.Remove
End If
End Sub
Sub ni_Click
'单击系统托盘图标
Dim hWnd
hWnd = dzHW.GetWindowHandle("null", AppName)'获取窗口句柄名称和类的名称
dzHW.ShowWindow(hWnd, 5)'显示窗口 - SW_SHOW
dzHW.ShowWindow(hWnd, 9)'还原窗口 - SW_RESTORE
dzHW.BringWindowToFront(AppName)'让程序的窗口成为前端窗口
End Sub
Sub mnuHide_Click
'进入后台
dzHW.ShowWindow(dzHW.GetActiveWindowHandle, 0)'隐藏 - SW_HIDE
End Sub

演示文件的使用:去掉zip用winrar解压双击运行开始播放

Last edited by tmxk : 01-14-2009 at 05:06 PM.
Reply With Quote
  #2 (permalink)  
Old 01-26-2009, 11:50 AM
Newbie
 
Join Date: Jan 2009
Posts: 3
Default

编译的时候报错
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


All times are GMT. The time now is 08:09 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0