UNKNOWN '************************************** 'Windows API/Global Declarations for :Da ' ily Dilbert '************************************** Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long '************************************** ' Name: Daily Dilbert ' Description:This program Downloads the ' archive page from ' http://www.unitedmedia.com/comics/dilb ' ert ' extracts the file name of the picture. ' Download it. Convert it to bitmap. ' Changes the desktop wallpaper to the n ' ew dilbert strip. ' By: Bjorn Larsson ' ' ' Inputs:None ' ' Returns:2 files on c:\ dilbert.gif and ' dilbert.bmp ' A changed wallpaper. ' 'Assumes:You must have an internet conne ' ction.. ' 'Side Effects:Sometimes the desktop wall ' paper is not visible ' unless you refresh the desktop yoursel ' f ' or select it manually. I don't know wh ' y this happends... 'This code is copyrighted and has limite ' d warranties. 'Please see http://www.Planet-Source-Cod ' e.com/xq/ASP/txtCodeId.3201/lngWId.1/qx/ ' vb/scripts/ShowCode.htm 'for details. '************************************** ' 1. Create a new form. ' 2. Add a Textbox,a pictureBox and an I ' net control. ' 3. Let them all have their default nam ' e. ' 4. Put all the code expect the global ' decleration in the "form load procedure" ' Dim Pos As Integer Dim Pos2 As Integer Dim Bilden() As Byte Dim NrString As String Text1.Text = Inet1.OpenURL ("http://www.unitedmedia.com/comics/dilbert/archive/") 'Download the page. Pos = InStr(1, Text1.Text, "/comics/dilbert/archive/images/dilbert") Pos2 = InStr(Pos, Text1.Text, ".gif") NrString = Mid(Text1.Text, Pos, Pos2 - Pos) Text1.Text = "http://www.unitedmedia.com" + NrString + ".gif" ' Debug filename Bilden() = Inet1.OpenURL("http://www.unitedmedia.com" + NrString + ".gif", icByteArray) ' Download picture. Open "C:\dilbert.gif" For Binary Access Write As #1 ' Save the file. Put #1, , Bilden() Close #1 Picture1.Picture = LoadPicture("c:\dilbert.gif") 'Reload it to PictureBox SavePicture Picture1.Picture, "c:\dilbert.bmp"'Converted to bmp.. Call SystemParametersInfo(20, 0, "c:\dilbert.bmp", 1) 'Change the wallpaper. Unload Me ' Exit program