Sunday , 2 April 2023
Home » Tự học Lập Trình » [AutoIt] Hộp thoại thông báo với hiệu ứng trượt

[AutoIt] Hộp thoại thông báo với hiệu ứng trượt

AutoIt

Hộp thoại thông báo với hiệu ứng trượt Chia sẻ mã nguồn AutoIt tham khảo – tạo hộp thoại thông báo với hiệu ứng trượt (từ dưới lên). Đây là hiệu ứng hiển thị thông báo thường gặp trong các trình diệt virus. Hiệu ứng này được tạo ra bằng cách kết hợp vòng lặp, tọa độ và hàm WinMove. Xem demo và tải mã nguồn tham khảo ở dưới nhé!

Code :

#region
#AutoIt3Wrapper_UseUpx=Y
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Icon=E:\wamp\www\favicon.ico
#AutoIt3Wrapper_Res_Comment=Coded by Juno_okyo
#AutoIt3Wrapper_Res_Description=Coded by Juno_okyo
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_ProductVersion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=(c) 2014 by Juno_okyo‘s Blog
#AutoIt3Wrapper_Res_Field=ProductName|Juno_okyo’s Production
#AutoIt3Wrapper_Res_Field=ProductVersion|1.0.0.0
#AutoIt3Wrapper_Res_Field=CompanyName|J2TeaM
#endregion
; Includes
#include <Misc.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
; Only One Instance
_Singleton(@ScriptName)
; Options
#NoTrayIcon
Opt(‘WinTitleMatchMode’, 2)
Opt(‘GUIOnEventMode’, 1)
Opt(‘GUICloseOnESC’, 0)
; Script Start – Add your code below here
slideUp_Dialog(‘Message’, ‘Hello, This is a demo!’)
While 1
        Sleep(100)
WEnd
Func slideUp_Dialog($title, $message)
        Local $desktopH = @DesktopHeight, $desktopW = @DesktopWidth
        Local $width = 285, $height = 236
        Local $x = $desktopW ($width + 12)
        #Region ### START Koda GUI section ### Form=
        Global $MainForm = GUICreate($title, $width, 165, $x, $desktopH, 1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE), WinGetHandle(AutoItWinGetTitle()))
        GUISetFont(12, 400, 0, “Arial”)
        GUISetOnEvent($GUI_EVENT_CLOSE, “slideDown_Dialog”)
        GUISetOnEvent($GUI_EVENT_MINIMIZE, “slideDown_Dialog”)
        Local $Edit = GUICtrlCreateEdit($message, 0, 0, 284, 164, BitOR($GUI_SS_DEFAULT_EDIT,$ES_READONLY))
        GUICtrlSetState(1, $GUI_FOCUS)
        GUISetState(@SW_SHOW)
        #EndRegion ### END Koda GUI section ###
        For $i = 0 To $height Step + 5
                WinMove($MainForm, , $x, $desktopH $i)
                Sleep(1)
        Next
EndFunc
Func slideDown_Dialog()
        For $i = 255 To 0 Step 10
                WinSetTrans($MainForm, , $i)
                Sleep(1)
        Next
        Exit
EndFunc

Lượt xem (725)

About Uzumaki Naruto

Uzumaki Naruto
Sống để nuôi hy vọng . . .

Xem thêm

header in c++

Tách chương trình lớn thành các file riêng

Tại sao cần phải tách Khi lập trình với bất cứ ngôn ngữ nào thì …

Để lại bình luận:

Loading Facebook Comments ...

Leave a Reply

Your email address will not be published. Required fields are marked *