Leaderboard
Popular Content
Showing content with the highest reputation on 12/23/2012 in all areas
-
Zip file for this is here #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <String.au3> Opt("GUIOnEventMode", 1) $Wid = 960 $Hgt = 720 Global $StringX, $StringY Global $flakes = 25, $Min = 5, $Max = 20 Global $particles[$flakes][5] Global $santaX = $wid, $santaY = 100 Global $sc_hBrush, $sc_hFormat, $sc_hFamily, $sc_hFont, $sc_text_color, $text_scroller, $sc_tLayout, $sc_pen, $sc_brush Global $letter_distance, $x, $y, $lenght, $end, $scroller_length, $sc_k Global $shadowBrush, $shadowFormat, $shadowFamily, $shadowFont, $shadowFamily, $shadowLayout Global $tshadow, $shadowtext ,$shadowtLayout, $shadowColor = 0xFFABA9BA Global $sc_text = "*** Merry Christmas and Happy New Year to all Autoit Users! ***" Global $sc_font_size = 48, $Font = "Times New Roman", $Fontoffset = 3 Global $bassdll = DllOpen(@ScriptDir & "\BASSMOD.dll"), $Play, $Pause, $stop Global $Titlestart = " " Global $Title = $Titlestart &" *** Merry Christmas! *** " $hGUI = GUICreate($Title, $Wid, $Hgt, -1, -1); -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE)) $menu = GUICtrlCreateMenu("Music") $Play = GUICtrlCreateMenuItem("Play", $menu) GUICtrlSetState(-1, $GUI_CHECKED) $Pause = GUICtrlCreateMenuItem("Pause", $menu) GUICtrlSetState(-1, $GUI_UNCHECKED) $Exit = GUICtrlCreateMenuItem("Exit", $menu) GUICtrlSetState(-1, $GUI_UNCHECKED) If @OSBuild < 7600 Then WinSetTrans($hGUI,"", 0xFF) ; only use this if solid background GUISetState(@SW_SHOW) GUISetOnEvent(-3, "close") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") ; =========================================== _GDIPlus_Startup() ;Window BckBuffer $graphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) $bitmap = _GDIPlus_BitmapCreateFromGraphics($Wid, $Hgt, $graphics) $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) ; BackBuffer for static image $bitmap1 = _GDIPlus_BitmapCreateFromGraphics($Wid, $Hgt, $graphics) $backbuffer1 = _GDIPlus_ImageGetGraphicsContext($bitmap1) $Background = _GDIPlus_ImageLoadFromFile("SnowScene.png") #Region Load Images $santa = _GDIPlus_ImageLoadFromFile("Santa.png") $santaW = _GDIPlus_ImageGetWidth($santa) $santaH = _GDIPlus_ImageGetHeight($santa) $Flake1 = _GDIPlus_ImageLoadFromFile("Flake1.png") $Flake1W = _GDIPlus_ImageGetWidth($Flake1)/4 $Flake1H = _GDIPlus_ImageGetHeight($Flake1)/4 $F1eX = $Flake1W/2 $F1eY = $Flake1H/2 $Flake2 = _GDIPlus_ImageLoadFromFile("Flake2.png") $Flake2W = _GDIPlus_ImageGetWidth($Flake2)/4 $Flake2H = _GDIPlus_ImageGetHeight($Flake2)/4 $F2eX = $Flake2W/2 $F2eY = $Flake2H/2 $Flake3 = _GDIPlus_ImageLoadFromFile("Flake3.png") $Flake3W = _GDIPlus_ImageGetWidth($Flake3)/4 $Flake3H = _GDIPlus_ImageGetHeight($Flake3)/4 $F3eX = $Flake3W/2 $F3eY = $Flake3H/2 #endregion #Region Setup Scroll Font $sc_text_color = 0xFFffffff $sc_htextBrush = _GDIPlus_BrushCreateSolid($sc_text_color) $sc_hFormat = _GDIPlus_StringFormatCreate() $sc_hFamily = _GDIPlus_FontFamilyCreate($Font) $sc_hFont = _GDIPlus_FontCreate($sc_hFamily, $sc_font_size, 2) $sc_pen = _GDIPlus_PenCreate(0) $sc_brush = _GDIPlus_BrushCreateSolid(0) $tLayout = _GDIPlus_RectFCreate(0, 0) ;shadow ;$T_Fontoffset = 5 $ShadowBrush = _GDIPlus_BrushCreateSolid($shadowColor) $ShadowFormat = _GDIPlus_StringFormatCreate() $ShadowFamily = _GDIPlus_FontFamilyCreate($Font) $ShadowFont = _GDIPlus_FontCreate($shadowFamily, $sc_font_size, 2) $ShadowLayout = _GDIPlus_RectFCreate(0, 0) ;Text Ini $sc_letter_distance = $sc_font_size $sc_length = $sc_font_size * 1.666 * 0.36 $sc_k = $wid $end = 0 $scroller_length = StringLen($sc_text) * $sc_length $sc_FontY = $Hgt - $Hgt/4 + 40 #endregion For $i = 0 To UBound($particles) - 1 $particles[$i][0] = Random(0, $wid, 1) ;X pos $particles[$i][1] = Random(0, $hgt, 1) ;Y pos $particles[$i][2] = 0 $particles[$i][3] = Random($min, $max) $particles[$i][4] = Random($min, $max, 1) ;size Next Play_Audio() Do _GDIPlus_GraphicsClear($backbuffer, 0x00FFFFFF) _GDIPlus_GraphicsDrawImageRect($backbuffer1, $Background, 0, 0, $Wid, $Hgt) ;Static Image _Draw() ScrollText() _GDIPlus_GraphicsDrawImageRect($backbuffer1, $bitmap, 0, 0, $Wid, $Hgt) _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap1, 0, 0, $Wid, $Hgt) Sleep(20) Until 0 Func _Draw() _GDIPlus_GraphicsDrawImageRect($backbuffer1, $santa, $santaX, $santaY, $santaW, $santaH) For $i = 0 To UBound($particles) - 1 If $particles[$i][1] > $hgt Then $particles[$i][0] = Random(-50, $wid+50, 1) ; X pos $particles[$i][1] = 0 ; y Pos $particles[$i][2] = 0 $particles[$i][3] = Random($min, $max) ;min, max, [int] $particles[$i][4] = Random($min, $max, 1) ; size EndIf $particles[$i][0] += $particles[$i][2] $particles[$i][1] += $particles[$i][3] ; X y width Height _GDIPlus_GraphicsDrawImageRect($backbuffer1, $Flake1, $particles[$i][0], $particles[$i][1], $Flake1W +$particles[$i][4], $Flake1H + $particles[$i][4]) _GDIPlus_GraphicsDrawImageRect($backbuffer1, $Flake2, $particles[$i][0] + 50 , $particles[$i][1] + 50, $Flake1W +$particles[$i][4], $Flake1H + $particles[$i][4]) _GDIPlus_GraphicsDrawImageRect($backbuffer1, $Flake3, $particles[$i][0] - 25 , $particles[$i][1] - 25, $Flake1W +$particles[$i][4], $Flake1H + $particles[$i][4]) Next $santaX -= 8 If -$SantaW >= $santaX Then $santaX = $Wid EndIf EndFunc ; ========= Handle WM_COMMAND messages ======================= Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) Switch $iwParam Case $Play Play() Case $Pause Pause() Case $Exit Close() EndSwitch EndFunc ;==>WM_COMMAND ;============================================================= ; ================ SCROLL TEXT ==================== Func ScrollText() $sc_FontX = $sc_k + $sc_letter_distance DllStructSetData($tLayout, "x", $sc_FontX) DllStructSetData($tLayout, "y", $sc_FontY) _GDIPlus_GraphicsDrawStringEx($BackBuffer, $sc_text, $sc_hFont, $tLayout, $sc_hFormat, $sc_htextBrush) ;Shadow DllStructSetData($ShadowLayout, "X", $sc_FontX + $FontOffset) DllStructSetData($ShadowLayout, "Y", $sc_FontY + $FontOffset) _GDIPlus_GraphicsDrawStringEx($Backbuffer1, $sc_text, $shadowFont, $shadowLayout, $shadowFormat, $shadowBrush) ;Text DllStructSetData($tLayout, "X", $sc_FontX) DllStructSetData($tLayout, "Y", $sc_FontY) _GDIPlus_GraphicsDrawStringEx($Backbuffer1, $sc_text, $sc_hFont, $tLayout, $sc_hFormat, $sc_htextBrush) $sc_k -= 5 If -$scroller_length >= $sc_k Then $sc_k = $Wid EndFunc Func Play_Audio() $Init = DllCall($bassdll, "int", "BASSMOD_Init", "int", -1, "int", 44100, "int", 0) $string= DllStructCreate("char[255]") DllStructSetData($string, 1, @ScriptDir & "\christmas_silence.xm") $load = DllCall($bassdll, "int", "BASSMOD_MusicLoad", _ "int", 0, _ "ptr", DllStructGetPtr($string), _ "int", 0, _ "int", 0, _ "int", 4 + 1024) $VolLevel = 100 $Volume = DllCall($bassdll, "int", "BASSMOD_SetVolume", "int", $VolLevel) DllCall($bassdll, "int", "BASSMOD_MusicPlay") EndFunc Func Play() ;consolewrite("You selected Play" &@CRLF) GUICtrlSetState($Play, $GUI_CHECKED) DllCall($bassdll, "int", "BASSMOD_MusicPlay") GUICtrlSetState($Pause, $GUI_UNCHECKED) GUICtrlSetState($Stop, $GUI_UNCHECKED) EndFunc Func Pause() ;consolewrite("You selected Pause" &@CRLF) GUICtrlSetState($Pause, $GUI_CHECKED) DllCall($bassdll, "int", "BASSMOD_MusicPause") GUICtrlSetState($Play, $GUI_UNCHECKED) GUICtrlSetState($Stop, $GUI_UNCHECKED) EndFunc Func close() _GDIPlus_FontDispose($SC_hFont) _GDIPlus_FontFamilyDispose($SC_hFamily) _GDIPlus_StringFormatDispose($SC_hFormat) _GDIPlus_GraphicsDispose($graphics) _GDIPlus_BrushDispose($sc_hBrush) _GDIPlus_FontFamilyDispose($shadowFamily) _GDIPlus_StringFormatDispose($shadowFormat) _GDIPlus_BrushDispose($shadowBrush) _WinAPI_DeleteObject($bitmap) _WinAPI_DeleteObject($bitmap1) _GDIPlus_GraphicsDispose($backbuffer) _GDIPlus_GraphicsDispose($backbuffer1) _GDIPlus_Shutdown() Exit EndFunc ;==>close ; Happy Holidays!1 point
-
Getting Last Section From .ini
Darkz0r reacted to chesstiger for a topic
You can use something like that to norm the version numbers: $sVersionNumber = "1.2.03.4" $aNumbers = StringSplit($sVersionNumber, ".") $sFormatedVersionNumber = StringFormat("%.2d.%.2d.%.2d.%.2d", $aNumbers[1], $aNumbers[2], $aNumbers[3], $aNumbers[4]) MsgBox(0, "", $sFormatedVersionNumber) Or you can compare the parts of the version number mathematical... Then "01" is "1". chess1 point -
Can I click a Javascript object?
mikesmith reacted to chesstiger for a topic
Maybe you can call the JS-Function manually? You can call it like this: $sCall = 'javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("$main$ArticleControl$lnkLogin", "", true, "Details", "", false, true))' _IENavigate($oIE, $sCall) chess1 point -
look for udf ie3 under helpfile within user defined functions IE Management1 point
-
If I understand you correctly: You don't want the "last" section you want the section with the "highest" number. As the section names are strings you need to make sure that all elements of the version number are in the same format. Means: "2.1.1.8" has to become "02.01.01.08" so you can sort the array of section names and then grab the last = highest one.1 point
-
Example Global $var = IniReadSection(@ScriptDir & '\Configuration.ini', "install") If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Else If UBound($var) < 2 Then Exit -1 ; For $i = 1 To $var[0][0] ;If ($var[$i][1] = 1) Then ; MsgBox(4096, "", $var[$i][0] & ' = ' & $var[$i][1]) ;EndIf ; Next EndIf ;Lets Create the GUI GUICreate(@ScriptName & ' | Phoenix XL') Local $sParam For $i = 2 To $var[0][0] $sParam &= $var[$i][1] & ',' Next ;Trim the Last Comma and Add Parenthesis $sParam = '(' & StringTrimRight($sParam, 1) & ')' ;Lets Create the Element Execute('GUICtrlCreate' & $var[1][1] & $sParam) ;Call is more appropriate but requires more code ;) GUISetState() While GUIGetMsg() <> -3 Sleep(10) WEnd #cs Configuration.ini [install] El= CheckBox Txt = "This is an Example" 1 =10 2 = 10 #ceThumbs up if it helped1 point
-
You can always try a good function which solves 99% of the problems. It's called SEARCH BUTTON.1 point
-
Yes No Cancel MSGbox
Xandy reacted to hasoon2000 for a topic
I FINALLY got it to work! I guess I did a stupid mistake. I changed this $sideload = "adb.exe sideload" into this $ADBside = @ComSpec & " /K " & '"' & @ScriptDir & "dataadb.exe sideload " I then changed the command to this RunWait($ADBside & " " &$file1, @ScriptDir & "data", @SW_SHOW) Issue was the $Sideload. I looked at my other commands and it had the directly to run the command. Example: $4EXT = @ComSpec & " /K " & '"' & @ScriptDir & "datafastboot.exe flash recovery Recoveries/4EXT.img""" I tweaked it out and did trial and error. It FINALLY worked! This is a great tool for new and experienced Android users. I can fully root my phone with my tool in 5 mins. Manually (for me) will take no more than 15 minutes. Imagine new users who are not tech savvy at all! lol. However, thank you for ALL your help. I really enjoy the community here and the help I get. Xandy, thank you for taking time out to help me. I really do appreciate it!! Merry Christmas and Happy Holidays to you guys1 point -
Yes, it is possible with GDI+. You can use this function to create it: Func _GDIPlus_LineBrushCreate($nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2, $iWrapMode = 0) Local $tPointF1, $pPointF1 Local $tPointF2, $pPointF2 Local $aResult $tPointF1 = DllStructCreate("float;float") $pPointF1 = DllStructGetPtr($tPointF1) $tPointF2 = DllStructCreate("float;float") $pPointF2 = DllStructGetPtr($tPointF2) DllStructSetData($tPointF1, 1, $nX1) DllStructSetData($tPointF1, 2, $nY1) DllStructSetData($tPointF2, 1, $nX2) DllStructSetData($tPointF2, 2, $nY2) $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", $iARGBClr1, "uint", $iARGBClr2, "int", $iWrapMode, "int*", 0) If @error Then Return SetError(@error, @extended, 0) Return $aResult[6] EndFunc ;==>_GDIPlus_LineBrushCreate This function returns a brush handle which can be used with _GDIPlus_GraphicsFillRect() function to create the header you want. Br, UEZ1 point