Thiệp tặng người iu 20-10 (share code)
sắp đến ngày 20-10 rùi...thấy trong 1Kho mình cũng có mấy bác up mấy chương trình flash rất tình củm để tặng người iu...nhân dây [cocconden] cũng xin post cho anh em file source của một tấm thiệp làm bằng chương trình AutoIT.
Mô tả:
Chương trình sẽ chỉ chạy vào đúng ngày 20-10 (chạy bất kể thời gian nào trong ngày). Khi chạy sẽ tự động phát bài hát When you love someone (để biết bài hát có hay không thì xem Google) và một lời chút nho nhỏ như hình bên dưới, code rất trong sáng, tuy nhiên do viết bằng AutoIT nên một số chương trình nhận lầm là chương trình nguy hiểm. Code này được lấy từ trang chủ của AutoIT và [cocconden] có chỉnh sửa một vài đoạn cho phù hợp với [coccconden] do vậy sẽ không giải đáp các thắc mắc liên quan tới bản quyền http://1kho.com/images/smilies/biggrin.gifhttp://1kho.com/images/smilies/biggrin.gifhttp://1kho.com/images/smilies/biggrin.gif. do chương trình hay bị nhận lầm là gây nguy hại cho máy tính nên [cocconden] sẽ không biên dịch thành file thực thi *.exe mà sẽ nguyệncode như vậy cho người dùng tự ngâm cứu vá tự biên dịch...muốn biên dịch thì phải cài chương trình AutoIT vào máy và mở code lên,, sau đó nhấn F7 để biên dịch....
Sau khi biên dịch thành file thực thi...chỉ cần gửi cho người iu của mấy bác,,,nếu đúng ngày thì nó sẽ tự chạy,,, còn không đúng ngày thì nó sẽ tự cài vào trong ổ cứng và chạy cùng hệ thống...
LƯU Ý: nhắc lại một lần nữa http://1kho.com/images/smilies/biggrin.gifhttp://1kho.com/images/smilies/biggrin.gif code hay bị nhận lầm là chương trình nguy hiểm nên nếu muốn xem thì tắt chương trình AntiVirus trước,,,
Hy vọng giúp mấy bác có được điểm trước người iu và người định iu...còn [cocconden] thì thất bại rùi...http://1kho.com/images/smilies/bawling.gif
Code:
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
; ================================================== ================================================== ===========================
; Khai báo
; ================================================== ================================================== ===========================
Global Const $AC_SRC_ALPHA = 1
Global $Himg[4]
Global $minihearts[2][15]
Global $ll, $lr
;===============
;===============
; ================================================== ================================================== ===========================
; Lệnh kiểm tra ngày tháng, cài đặt hoặc gỡ bỏ chương trình
; ================================================== ================================================== ===========================
If @Compiled <> (@ProgramFilesDir&"\vochuoi\") Then
DirCreate(@ProgramFilesDir&"\vochuoi\")
FileCopy(@ScriptDir&"\5.png",@ProgramFilesDir&"\vo chuoi\")
FileCopy(@ScriptDir&"\22.png",@ProgramFilesDir&"\v ochuoi\")
FileCopy(@ScriptDir&"\1.png",@ProgramFilesDir&"\vo chuoi\")
FileCopy(@ScriptDir&"\love.png",@ProgramFilesDir&" \vochuoi\")
FileCopy(@ScriptDir&"\lbh.exe",@ProgramFilesDir&"\ vochuoi\")
FileCopy(@ScriptDir&"\When you love someone.mp3",@ProgramFilesDir&"\vochuoi\")
FileCopy(@ScriptFullPath,@ProgramFilesDir&"\vochuo i\")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Win dows\CurrentVersion\Run","vochuoi","REG_SZ",@Progr amFilesDir&"\vochuoi\"&@ScriptName)
;RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\W indows\CurrentVersion\Run","vochuoi","REG_SZ",@Pro gramFilesDir&"\vochuoi\"&@ScriptName)
EndIf
If $CmdLine[0] == 0 Then
If @MON=="10" And @MDAY="20" Or Not(@Compiled) Then
Run(@ScriptDir & "\lbh.exe", "", @SW_MAXIMIZE)
Main()
EndIf
ElseIf $CmdLine[1]=="/cai_dat" Then
DirCreate(@ProgramFilesDir&"\vochuoi\")
FileCopy(@ScriptDir&"\5.png",@ProgramFilesDir&"\vo chuoi\")
FileCopy(@ScriptDir&"\22.png",@ProgramFilesDir&"\v ochuoi\")
FileCopy(@ScriptDir&"\1.png",@ProgramFilesDir&"\vo chuoi\")
FileCopy(@ScriptDir&"\love.png",@ProgramFilesDir&" \vochuoi\")
FileCopy(@ScriptDir&"\lbh.exe",@ProgramFilesDir&"\ vochuoi\")
FileCopy(@ScriptDir&"\When you love someone.mp3",@ProgramFilesDir&"\vochuoi\")
FileCopy(@ScriptFullPath,@ProgramFilesDir&"\vochuo i\")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Win dows\CurrentVersion\Run","vochuoi","REG_SZ",@Progr amFilesDir&"\vochuoi\"&@ScriptName)
;RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\W indows\CurrentVersion\Run","vochuoi","REG_SZ",@Pro gramFilesDir&"\vochuoi\"&@ScriptName)
ElseIf $CmdLine[1]=="/go_bo" Then
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Wi ndows\CurrentVersion\Run","vochuoi")
;RegDelete("HKEY_LOCAL_MACHINE\Software\Microsoft\ Windows\CurrentVersion\Run","vochuoi")
DirRemove(@ProgramFilesDir&"\vochuoi\",1)
DirRemove(@ProgramFilesDir&"\vochuoi\",0)
ElseIf $CmdLine[1]=="/chay" Then
Run(@ScriptDir & "\lbh.exe", "", @SW_MAXIMIZE)
Main()
EndIf
; ================================================== ================================================== ===========================
; Here lies the romantic magic
; ================================================== ================================================== ===========================
Func main()
Anh()
SoundSetWaveVolume(100)
SoundPlay(@ScriptDir&"\When you love someone.mp3")
Local $gui = GUICreate("đừng Kill [vỏ chuối]...(tội nghiệp lắm...)",811,750,-1,-1,-1,BitOR($WS_EX_LAYERED,$WS_EX_TOPMOST))
Local $guiimg = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\love.png")
SetBitMap($gui, $guiimg, 255)
PopulateMiniHearts($gui)
GUISetState(@SW_SHOW,$gui)
;loibaihat()
;ToolTip("")
Local $msg
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
EndSwitch
Sleep(50)
UpdateMiniHearts()
WEnd
Denit()
EndFunc
; ================================================== ================================================== ===========================
; Xác định vị trí đặt trái tim, hình
; ================================================== ================================================== ===========================
Func PlaceHeart(ByRef $last, $left, $right)
Local $place = $last
While $last-40<$place And $last+40>$place
$place = Random($left,$right,1)
WEnd
$last = $place
Return $place
EndFunc
; ================================================== ================================================== ===========================
; Khởi tạo giá trị xem toàn màn hình cho hình trái tim
; ================================================== ================================================== ===========================
Func PopulateMiniHearts($gui)
$ll = -100
$lr = -100
Local $left = (@DesktopWidth-811)/2
Local $right = (@DesktopWidth+811)/2-49
For $i=0 To 9
$minihearts[0][$i]=CreateOverlayGui(PlaceHeart($ll,0,$left),$i*((@De sktopHeight+63)/10),Random(0,3,1),$gui,"0"&$i)
$minihearts[1][$i]=CreateOverlayGui(PlaceHeart($lr,$right,@DesktopWi dth-49),$i*((@DesktopHeight+63)/10),Random(0,3,1),$gui,"1"&$i)
Next
EndFunc
; ================================================== ================================================== ===========================
; ================================================== ================================================== ===========================
; Tạo hiệu ứng chuyển tiếp!
; ================================================== ================================================== ===========================
Func UpdateMiniHearts()
Local $pos
For $i=0 To 9
For $j=0 To 1
$pos = WinGetPos($minihearts[$j][$i])
$pos[1]-=1
If $pos[1]<-63 Then
$pos[1] = @DesktopHeight
If $j=0 Then
$pos[0]=PlaceHeart($ll,0,(@DesktopWidth-811)/2)
Else
$pos[0]=PlaceHeart($lr,(@DesktopWidth+811)/2,@DesktopWidth-49)
EndIf
EndIf
WinMove($minihearts[$j][$i],"",$pos[0],$pos[1])
Next
Next
EndFunc
; ================================================== ================================================== ===========================
; Create overlay gui
; ================================================== ================================================== ===========================
Func CreateOverlayGUI($x,$y,$img=-1,$master=-1,$title="OLgui")
Local $retgui = GUICreate("OLgui",49,63,$x,$y,$WS_POPUP,$WS_EX_LAY ERED,$master)
If $img==-1 Then
SetBitMap($retgui, $Himg[Random(0,2,1)], 128)
Else
SetBitMap($retgui, $Himg[$img], 128)
EndIf
GUISetState(@SW_SHOW,$retgui)
Return $retgui
EndFunc
; ================================================== ================================================== ===========================
; Chuẩn bị ảnh từ thư mục chương trình
; ================================================== ================================================== ===========================
Func Anh()
; Nạp ảnh từ thư mục chương trình
_GDIPlus_Startup()
;ToolTip("XIN VUI LÒNG BẬT LỚN LOA HOẶC ĐEO PHONE...",((@DesktopWidth/2)-20), @DesktopHeight/2, "Thân tặng [chuối]", 2, 2)
;Sleep(3000)
$Himg[0] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\5.png")
$Himg[1] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\22.png")
$Himg[2] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\22.png")
$Himg[3] = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\1.png")
EndFunc
; ================================================== ================================================== ===========================
; denit
; ================================================== ================================================== ===========================
Func denit()
; Release resources
_GDIPlus_ImageDispose($Himg[0])
_GDIPlus_ImageDispose($Himg[1])
_GDIPlus_ImageDispose($Himg[2])
_GDIPlus_ImageDispose($Himg[3])
_GDIPlus_Shutdown()
EndFunc