Welcome, Guest. Please login or register.

Author Topic: [VB] Visual Basic  (Read 989 times)

Offline DropShot (Bensta)

  • [eG] Clan Member
  • General
  • ***
  • Posts: 1025
  • www.youtube.com/TheTechyGamer24
    • View Profile
[VB] Visual Basic
« on: February 18, 2012, 04:35:21 am »
Almost finished my program, i just need 3 more wallpapers...
and heres the code for the "setwallpaper" side of things if anyone wants it,

Code: [Select]
Public Shared SPI_SETDESKWALLPAPER As Integer = 20
    Public Shared SPIF_UPDATEINIFILE As Integer = 1
    Public Shared SPIF_SENDWININICHANGE As Integer = 2

  Private Declare Sub SystemParametersInfo Lib "User32.dll" (ByVal action As Integer, _
  ByVal iparam As Integer, ByVal vparam As String, ByVal options As Integer)

Public Function ChangeDesktop(ByVal DownL As String)
  Dim IMG As System.Drawing.Image
  Dim conf As String = DownL.Substring(DownL.Length - 4)
  Dim wc As New System.Net.WebClient()

  '// Make it check if the file already exists for proper a proper working function.
  wc.DownloadFile(DownL, System.IO.Path.GetTempPath + "wallpaper" + conf)

  IMG = IMG.FromFile(System.IO.Path.GetTempPath + "wallpaper" + conf)
  IMG.Save(System.IO.Path.GetTempPath + "\wallpaper.bmp", System.Drawing.Imaging.ImageFormat.Bmp)
  SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, System.IO.Path.GetTempPath + "\wallpaper.bmp", SPIF_UPDATEINIFILE)
Return Nothing
    End Function


i used a button + image box instead of a button + textbox because it looks better but its up to you
« Last Edit: February 22, 2012, 12:51:25 pm by Alex(aMacUser) »
Quote from: Tom on 26 April 2012, 06:06:09
David: Maybe Tom will offer you a position at the Echo-Gaming Headquarters .

Quote from: David on 26 April 2012, 06:07:03
Good idea, the position of co-leader is still available. ;)

Offline Kablamo

  • Colonel
  • ****
  • Posts: 393
    • View Profile
Re: Visual Basic
« Reply #1 on: February 18, 2012, 07:53:14 pm »
Hmm im pretty sure u can write a program for this a lot easier then u did but meh.

Offline Tom

  • Administrator
  • General
  • *****
  • Posts: 4613
  • Clan Founder
    • View Profile
    • Echo-Gaming.co
Re: Visual Basic
« Reply #2 on: February 20, 2012, 12:31:16 am »
Interesting, I was using something I found earlier to set the wallpaper via command line. A thing to add would be a setting for center/tiled/stretched.

Also, I added code tags to make your post look a little cleaner.


Quote from: John F. Kennedy
Mankind must put an end to war or war will put an end to mankind.

Offline Alex(aMacUser)

  • Global Moderator
  • General
  • *****
  • Posts: 1194
  • aMacUser is a name I picked up in High School
    • View Profile
    • eG
Re: Visual Basic
« Reply #3 on: February 21, 2012, 10:56:20 pm »
DUDE add the tiled ,stretched, etc. With three screens I have to use Tiled or else it looks bad lol.

I have a lot of Macs probably 10 <> I do not use them to Game
I use a PC which I have Built myself (check the PC specs topic)

Offline DropShot (Bensta)

  • [eG] Clan Member
  • General
  • ***
  • Posts: 1025
  • www.youtube.com/TheTechyGamer24
    • View Profile
Re: Visual Basic
« Reply #4 on: February 22, 2012, 02:45:38 am »
DUDE add the tiled ,stretched, etc. With three screens I have to use Tiled or else it looks bad lol.
lol ok then you find out how to do it and ill add it xD, jks ill search somewhere for the "personalize" settings
Quote from: Tom on 26 April 2012, 06:06:09
David: Maybe Tom will offer you a position at the Echo-Gaming Headquarters .

Quote from: David on 26 April 2012, 06:07:03
Good idea, the position of co-leader is still available. ;)