大家好!首先,謝謝編輯把我的第一貼放入頭條拉,不敢當不敢當。。。。
but anyway, 上頭條的感覺是不錯的,大家都說再接再厲呢
話說啊,最近我在我們公司內部 管理系統加入了信息閃動功能,就像 MSN 一樣,Cool 吧
因為我們公司管理系統是 Delphi 編的,所以自己寫的Delphi 碼,然後 VS.Net 的碼是摘的哦(我還是比較喜歡原創的其實)
Delphi 碼如下
FlashValue true 就是閃拉,False 就是停閃,夠簡單吧,不要忘記加 ShellAPI 哦
ucount 是閃幾下,呵呵
.Net 代碼是在這兒挖到的
http://pinvoke.Net/default.ASPx/user32.FlashWindowEx
要尊重一下原作者拉,哈哈,不過代碼我也貼上來
"User32" (ByRef FWInfo As FlashWINFO) As Int32
Private Const FlashW_STOP As Int32 = 0
Private Const FLASHW_ALL As Int32 = FLASHW_CAPTION Or FlashW_TRAY
Private Const FlashW_TIMERNOFG As Int32 = &HC&
Private Structure FLASHWINFOStructure FlashWINFO
Dim dwFlags As Int32
End Structure
BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">Function FlashWindow()Function FlashWindow(ByRef frm As Form) As Int32
pan >End Function
00000"> Boolean, ByVal FlashTray As Boolean) As Int32
Public Shared Function FlashWindow()Function FlashWindow(ByRef frm As Form, ByVal NumTimes2Flash As Integer) As Int32
Return FlashWindow(frm, True, True, NumTimes2Flash)
Public Shared Function FlashWindow()Function FlashWindow(ByRef frm As Form, ByVal FlashTitleBar As Boolean, ByVal FlashTray As Boolean, ByVal NumTimes2Flash As Integer) As Int32
; Try
.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(fwi)
tyle="COLOR: #000000"> FlashW_CAPTION
.dwTimeout = 250
le="COLOR: #000000">-1
用法其實也很簡單,FlashWindow(閃的窗體,要不要閃任務條,要不要閃任務圖標,閃的次數)
基本上其實大家都是調用 user32.dll 參數的WINAPI, 關於這個 WINAPI 大家可以參考一下 MSDN 拉
對了,有空留言哦