这个网吧桌面是怎么写的?恳请高手
像这个桌面右边的那几处框是怎么做的呀。我想了半天也搞不明白,请教高手指点一二,谢谢 还有上面显示的机器号。都是用什么方法做的。太郁闷了 一个透明Gui上几个控件 是啊 知道的兄弟说下吧 实现方式AFAN版主已说了啊论坛里破帽做的网吧桌面已很成熟了,非常漂亮,可以去他空间和论坛瞅瞅 帽子的那个桌面是很成熟,但里面有一个致命的弹窗插件,动不动就是IE错误,搞的我都不想用了 本帖最后由 djzero 于 2010-6-3 22:49 编辑
本网吧在用的 还在修改中
编程序中的一部份,下面有部份可删可不删
调用AspJpeg.dll
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Fileversion=0.0.0.0
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <IE.au3>
#include <Array.au3>
#include <GDIPlus.au3>
#include <Misc.au3>
#Include <String.au3>
Global $WallPaper="1.JPG";桌面背景图片
Global $TemPPath=@TempDir&"\ZeroWal"
Global $PicR="Y"
_Panel()
Func _Panel()
$WallPaper_Old=$WallPaper
$PicR_Tem=$PicR
Local $Url="http://www.thinkpage.cn/weather/weather.aspx?uid=djzero&c=9291&l=zh-CHS&p=MSN&a=1&u=C&s=1&m=0&x=1&d=3&fc=&bgc=&bc=&ti=1&in=1&li=22"
If Not FileExists(@TempDir&"\jywbWal") Then DirCreate(@TempDir&"\jywbWal")
If Not FileExists($WallPaper) Then
$PicR="N"
EndIf
Local $TempPICPath=$TemPPath&"\"&StringTrimLeft($WallPaper,StringInStr($WallPaper,"\",0,-1)-1)
If $PicR = "Y" Then
If Not FileExists ($TemPPath) Then DirCreate($TemPPath)
If Not FileExists($TemPPath&"\AspJpeg.dll") Then FileInstall("AspJpeg.dll",$TemPPath&"\AspJpeg.dll", 1)
If Not FileExists($TemPPath&"\2.png") Then FileInstall("2.png", $TemPPath&"\2.png", 1)
If Not FileExists($WallPaper) Then
$PicR="N"
_Panel()
Return
EndIf
Global $Png=$TemPPath&"\2.png"
If FileExists($WallPaper) Then
WRPic($WallPaper,_IEGetImgAndText($Url),$TempPICPath&".jpg",$TemPPath&"\2.png",800,-10)
If FileExists($TempPICPath&".jpg") Then _JpgToBmp($TempPICPath&".jpg", @WindowsDir&"\Web\Wallpaper\jywb.bmp")
EndIf
Else
If FileExists($WallPaper) Then
If StringTrimLeft($WallPaper,StringInStr($WallPaper,".",0,-1))="bmp" Then
FileCopy($WallPaper, @WindowsDir&"\Web\Wallpaper\jywb.bmp")
Else
FileCopy($WallPaper,$TempPICPath)
If FileExists ($TempPICPath) Then _JpgToBmp($TempPICPath, @WindowsDir&"\Web\Wallpaper\jywb.bmp")
EndIf
EndIf
EndIf
Local $sFile = @WindowsDir&"\Web\Wallpaper\jywb.bmp"
RegWrite('HKCU\Control Panel\Desktop','Wallpaper','reg_sz',$sFile)
DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 1, "str", $sFile, "int", 1)
EndFunc
Func _IEGetImgAndText($URL)
Local $httpObj = ObjCreate("winhttp.winhttprequest.5.1")
$httpObj.open("GET",$URL)
$httpObj.send()
Local $Text_Arr=_GetweatherString($httpObj.Responsetext)
If $Text_Arr<>"" Then $Text_Arr=_InETGetPng($Text_Arr)
Return $Text_Arr
EndFunc
Func _GetweatherString($WHtml)
Local $Return
If StringLen($WHtml)>0 Then
$GetPNG=_StringRegExp($WHtml,'src="(.*?.png)"')
$GetTitle=_StringRegExp($WHtml, '<span id="ctl00_ltlText">(.*)</span>')&" 气温:"&_StringRegExp($WHtml, ">气温: <span class='temp'>(.*)</span>°")&"℃"
$GetDay=_StringRegExp($WHtml, '<div class="forecastDay" style="font-weight:bold;">(.*)</div>')
$GetDayAlt=_StringRegExp($WHtml, 'alt="(.*)"')
$GetDaytemp=StringReplace(_StringRegExp($WHtml, '<span class="temp high">(.*)</span>(.*)<span class="temp low">(.*)</span>°<span class="unit">C</span>'),",/,","/")
$Return=$GetPNG&","&$GetTitle&@CRLF
$GetDay=StringSplit($GetDay,",")
$GetDayAlt=StringSplit($GetDayAlt,",")
$GetDaytemp=StringSplit($GetDaytemp,",")
If $GetDay<4 Then ReDim $GetDay
If $GetDayAlt<4 Then ReDim $GetDayAlt
If $GetDaytemp<4 Then ReDim $GetDaytemp
For $i=1 To 3
$Return&=$GetDay[$i]&$GetDayAlt[$i]&$GetDaytemp[$i]&"℃"
If $i<>3 Then $Return&=@CRLF
Next
Else
$Return=",请保管个人财物不要把手机、钱包放在桌面上,以免丢失。"
EndIf
Return StringSplit($Return,",")
EndFunc
Func _StringRegExp($WText,$Pattern,$Flag=1,$nOffset = 1)
Local $Return
If StringLen($Flag)>0 Then
Local $Return,$GetPNG
While 1
Local $GetString = StringRegExp($WText, $Pattern,$Flag, $nOffset)
If @error = 0 Then
$nOffset = @extended
Else
ExitLoop
EndIf
for $i = 0 to UBound($GetString) - 1
$Return&=$GetString[$i]&","
Next
WEnd
If StringRight($Return,1)="," Then $Return=StringTrimRight($Return,1)
Else
$Return=""
EndIf
Return $Return
EndFunc
Func _InETGetPng($Http)
Local $Temp_PNG_Path=$TemPPath&"\"&StringTrimLeft($Http,StringInStr($Http,"/",0,-1))
If FileExists($Temp_PNG_Path) Then Return $Temp_PNG_Path
Local $hDownload = InetGet($Http, $Temp_PNG_Path, 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2)
InetClose($hDownload)
Return $Temp_PNG_Path
EndFunc
Func _JQ()
If StringLeft(@ComputerName,1) ="A" ThenReturn "会员3元/小时"&@CR&"非会员4元/小时"
If StringLeft(@ComputerName,1) ="B" ThenReturn "会员4元/小时"&@CR&"非会员5元/小时"
If StringLeft(@ComputerName,1) ="C" ThenReturn "会员2.5元/小时"&@CR&"非会员3元/小时"
If StringLeft(@ComputerName,1) ="F" ThenReturn "会员2.5元/小时"&@CR&"非会员3元/小时"
If StringLeft(@ComputerName,1) ="D" ThenReturn "会员4元/小时"&@CR&"非会员5元/小时"
If StringLeft(@ComputerName,1) ="E" Then
If Int(StringTrimLeft(@ComputerName,1))>13 Then
Return "会员4元/小时"&@CR&"非会员5元/小时"
Else
Return "会员2.5元/小时"&@CR&"非会员3元/小时"
EndIf
EndIf
If StringLeft(@ComputerName,1) ="G" Then
If Int(StringTrimLeft(@ComputerName,1))>128 Then
Return "会员3元/小时"&@CR&"非会员4元/小时"
Else
Return "会员4元/小时"&@CR&"非会员5元/小时"
EndIf
EndIf
EndFunc
Func _JpgToBmp($Jpg,$Bmp)
Local $hImage, $CLSID
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($Jpg)
$CLSID = _GDIPlus_EncodersGetCLSID("BMP")
_GDIPlus_ImageSaveToFileEx($hImage,$Bmp, $CLSID)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_ShutDown()
EndFunc
Func _WBArea()
If StringLeft(@ComputerName,1) ="A" ThenReturn "游戏区"
If StringLeft(@ComputerName,1) ="B" ThenReturn "VIP区"
If StringLeft(@ComputerName,1) ="C" ThenReturn "普通区"
If StringLeft(@ComputerName,1) ="F" ThenReturn "普通区"
If StringLeft(@ComputerName,1) ="D" ThenReturn "情侣区"
If StringLeft(@ComputerName,1) ="E" Then
If Int(StringTrimLeft(@ComputerName,1))>13 Then
Return "情侣区"
Else
Return "普通区"
EndIf
EndIf
If StringLeft(@ComputerName,1) ="G" Then
If Int(StringTrimLeft(@ComputerName,1))>128 Then
Return "游戏区"
Else
Return "VIP区"
EndIf
EndIf
EndFunc
Func WRPic($D_WallPaper,$Arr_str,$SavePath="jywb.jpg",$D_Png="",$DX=800,$DY=-10)
If $Arr_str<3 Then ReDim $Arr_str
Local $FontPath=@WindowsDir&"\Fonts\Font.ttf"
Local $SimHei=@WindowsDir&"\Fonts\simhei.ttf"
If Not FileExists($FontPath) Then
If Not FileExists($TemPPath&"\Font.ttf") Then
If FileExists("\\192.168.0.251\zerotem$\wel\Font.ttf") Then
FileCopy("\\192.168.0.251\zerotem$\wel\Font.ttf",$TemPPath&"\Font.ttf")
$FontPath=$TemPPath&"\Font.ttf"
Else
$FontPath=@WindowsDir&"\Fonts\simhei.ttf"
EndIf
Else
$FontPath=$TemPPath&"\Font.ttf"
EndIf
EndIf
If Not FileExists($FontPath) Then $FontPath=@WindowsDir&"\Fonts\simhei.ttf"
$Jpeg=_Photo_OpenCalss($D_WallPaper)
With $Jpeg
If $D_Png<>"" Then .Canvas.DrawPNG($DX,$DY,$D_Png);;;;背景2
If $Arr_str<>"" Then .Canvas.DrawPNG($DX+40,$DY+73,$Arr_str);;;气候图标
.Canvas.Font.Size = 32
.Canvas.Font.Color = 0x000000
.Canvas.Font.Width = 200
.Canvas.Font.Align = 2
.Canvas.Font.Spacing = 1
.Canvas.Font.Opacity = 0.8
.Canvas.PrintTextEx(_WBArea(), $DX+32, $DY+50,$FontPath) ;;;区域
.Canvas.Font.Size = 30
.Canvas.Font.Width = 125
.Canvas.PrintTextEx(@ComputerName, $DX+12, $DY+81,@WindowsDir&"\Fonts\tahomabd.TTF");;;;机号
.Canvas.Font.Size = 12
.Canvas.Font.Width = 120
.Canvas.Font.Align = 0
.Canvas.Font.Color = 0x000000
.Canvas.PrintTextEx($Arr_str[$Arr_str], $DX+93, $DY+100,$SimHei);;;;天气报告
.Canvas.Font.Color = 0xBC6E2F
.Canvas.PrintTextEx(_JQ(), $DX+93, $DY+156,$SimHei);;;;价格
.Canvas.Font.Size = 14
.Canvas.PrintTextEx("欢迎光临聚缘网吧", $DX+93, $DY+183,$SimHei)
.Save ($SavePath)
EndWith
$Jpeg.Close
EndFunc
Func _Photo_OpenCalss($Path)
If Not FileExists($Path) Then Return -1
$Jpeg = ObjCreate("Persits.Jpeg")
If Not IsObj($Jpeg) Then
If Not FileExists(@SystemDir & "\aspjpeg.dll") Then FileCopy($TemPPath&"\aspjpeg.dll",@SystemDir,1)
RunWait("Regsvr32 /s "& @SystemDir & "\aspjpeg.dll")
RegWrite("HKLM\SOFTWARE\Persits Software\AspJpeg\RegKey","","REG_SZ","48958-77556-02411")
$Jpeg = ObjCreate("Persits.Jpeg")
EndIf
If $Jpeg.Version = "1.9.0.0" Then $Jpeg.PreserveMetadata = True
$Jpeg.Interpolation=2
$Jpeg.Quality=100
$Jpeg.Open ($Path)
Return $Jpeg
EndFunc
好东西。仔细研究一下。谢谢回贴
!!! 好东西。仔细研究一下。谢谢回贴 不太容易,但是一定要好好的看看 回复 7# djzero
执行了,桌面没显示呀? 最好给个地址我们就不用找了 最好给个地址我们就不用找了 1.JPG和2.png自己改
没有的话不会显示 2.png用PS修改透明就可以做到那个效果