Jump to content

Need VB or C++ Coder to Help


urbestfreind

Recommended Posts

Yeah, as the title says, I'm looking for someone with a decent knowledge of C++ or VB (I use VB 2008 Express, and VB.NET at school) to help me with a small project of mine. Preferably, someone good with working the registry (as I believe some changes may need to be made in there).

 

 

 

Now, that my seem pretty bad, but my intents are completely innocent. What I'm looking for is help with an idea I've had for awhile. It's a background rotator.

 

 

 

What I want is that after a certain time interval, the background will change from one picture to another. The pictures will be in one folder. It's similar to the windows screensaver, where you set an interval and the location of the folder, and it cycles through them, preferrably randomly. It's similar to the webshots program, but that seems to mess with my computer, so I don't like to use it. Also, I was hoping to include support for multiple file types (jpeg, bmp, png), which I don't know how easy it would be to implement.

 

 

 

I have an idea on how this might work, but I would like an experienced coder's advice. If anyone is interested, post here or PM me.

 

 

 

Also, please don't tell me to "google it" because I did, and I didn't like the few results I found. And, I'm not interested in someone just handing me code and telling me to compile it. That's not the point. I'm trying to learn C++ and get some real-world practice with VB, but I need some guidance on both.

[hide=Funny Quotes]

So you sucker punched a kid in the back of the head? Good job.
What scares me is that you're like 10 years old.
-.- im not that freaking young
You were a couple years ago.
It's not racist if its true.
Hmm... I wonder how one goes about throwing someone out a window in a mystic fashion :-k

 

The mental image for that is freaking awesome.

[/hide]

- I dont need to "get a life." I'm a gamer - I have LOTS of lives!

Link to comment
Share on other sites

Use this class

 

Imports System.Drawing

Imports System.Drawing.Drawing2D

Imports System.Drawing.Imaging



Public Class WallpaperTweaker

   Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer



   'constants to be used with the above api

   Private Const SPI_SETDESKWALLPAPER = 20

   Private Const SPIF_UPDATEINIFILE = &H1

   Private pic As Image

   Public Function ChangeWallpaper(ByVal sImage As String)

       pic = Image.FromFile(sImage)

       Dim Output As Boolean = False

       Dim imagePath As String = Application.StartupPath & "\myNewWallpaper.bmp"

       Try

           pic.Save(imagePath, ImageFormat.Bmp)

           'set the parameters to change the wallpaper to the image you selected

           SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, imagePath, SPIF_UPDATEINIFILE)

           Output = True

       Catch ex As Exception

           Output = False

       End Try

       Return Output

   End Function



End Class

 

 

 

Then declare it in your main form using Dim Something as WallpaperTweaker

 

Then use

if Something.changewallpaper(image path) then

   msgbox("Wallpaper Changed")

end if

 

If you want a whole project doing though you'll have to wait till Monday, but I can give you snipets and advice on how to do it all weekend.

[hide=Drops]

  • Dragon Axe x11
    Berserker Ring x9
    Warrior Ring x8
    Seercull
    Dragon Med
    Dragon Boots x4 - all less then 30 kc
    Godsword Shard (bandos)
    Granite Maul x 3

Solo only - doesn't include barrows[/hide][hide=Stats]

joe_da_studd.png[/hide]

Link to comment
Share on other sites

I would love that. If you could comment it out so I know what does what, that would be great. I've been using VB for over a year now, doing business applications and now DirectX games, so I know what some things do, but I've never tried anything of this scope before.

 

 

 

Although I would love to just have an outline, if you would like to post a whole project, that would be fine. I can play with it after that. If you do make one, would you mind if I installed it on a few friend's computers? I know a few people who want it as well, which is why I finally got around to asking for help.

 

 

 

What I really want thorough help with is reading from a folder and picking the files randomly, because I wanted to use that for some different applications. If you could help me with that part, that would be great. Just from a quick look, it appears that you can only have one file? That's what I didn't like about the other programs, it was mainly for one file. I wanted it to do multiple files over a set interval, probably by running in the background and doing sleep for a user-defined set of time. This would probably be saved in a file so that the time interval wouldn't have to be entered every time. I would also do this if there was an option for centered, stretch, etc, store that preference in a file and read from it. I can do IO, but would I just do an if statement? If the file = "centered" then chkCentered.Checked = True, inside the form load event? I wanted registry help to get the program to load at login.

 

 

 

I know it's possible to do, because I've used WebShots, and it does exactly this. I just don't like the bloat and everything that comes with Webshots. Plus, by writing my own program, I get to customize the look and workings however I want.

[hide=Funny Quotes]

So you sucker punched a kid in the back of the head? Good job.
What scares me is that you're like 10 years old.
-.- im not that freaking young
You were a couple years ago.
It's not racist if its true.
Hmm... I wonder how one goes about throwing someone out a window in a mystic fashion :-k

 

The mental image for that is freaking awesome.

[/hide]

- I dont need to "get a life." I'm a gamer - I have LOTS of lives!

Link to comment
Share on other sites

That bit of code (I changed a few documents I picked up) is for a include file (right lick your project add file then copy and paste it into the file).

 

The joy of that is you can reuse that function as much as you want.

 

All as you have to do is to use the function is use the item.changewallpaper(pathfile) that's it. The if statement simply to show that the function gives a true or false response based on if the change worked.

 

Just think of it as a nice little function which changes the wallpaper based on the filepath you send to it.

 

Use it as you see fit.

 

 

 

I'll get you a quick project done sometime soon.

[hide=Drops]

  • Dragon Axe x11
    Berserker Ring x9
    Warrior Ring x8
    Seercull
    Dragon Med
    Dragon Boots x4 - all less then 30 kc
    Godsword Shard (bandos)
    Granite Maul x 3

Solo only - doesn't include barrows[/hide][hide=Stats]

joe_da_studd.png[/hide]

Link to comment
Share on other sites

I still don't have a working version of my own yet, but I'm getting closer. I think I'm aiming too high trying to get it to load from a folder right now. Maybe I'll just go to an array of pre-defined images saved in the release folder...At least until Joe comes through (or anyone else).

[hide=Funny Quotes]

So you sucker punched a kid in the back of the head? Good job.
What scares me is that you're like 10 years old.
-.- im not that freaking young
You were a couple years ago.
It's not racist if its true.
Hmm... I wonder how one goes about throwing someone out a window in a mystic fashion :-k

 

The mental image for that is freaking awesome.

[/hide]

- I dont need to "get a life." I'm a gamer - I have LOTS of lives!

Link to comment
Share on other sites

This is a quick mock up (literally took 30 minutes using that code I gave up)

 

http://www.joedastudd.co.uk/files/BGChanger.zip

 

 

 

You create a list of files (using the add button) to loop through set the delay between changes (in seconds) then press start.

 

 

 

Looking at how easy it is to do and the possible number of upgrades/additions I think I'll start putting some real effort into it.

[hide=Drops]

  • Dragon Axe x11
    Berserker Ring x9
    Warrior Ring x8
    Seercull
    Dragon Med
    Dragon Boots x4 - all less then 30 kc
    Godsword Shard (bandos)
    Granite Maul x 3

Solo only - doesn't include barrows[/hide][hide=Stats]

joe_da_studd.png[/hide]

Link to comment
Share on other sites

Actually that's similar to what I had, except I had the images hard-coded in, not in the listbox (was going to do that this weekend).

 

 

 

Although the project is really nice (seriously, good job, thanks), it doesn't complete the major goal I had in mind. That was to read a folder and automatically get the images, which is what I had trouble with. Although, with this new listbox thing, I may be able to mod it to that, if you could work on it as well (since you said you wouldn't mind putting more effort into it), that would be great.

 

 

 

If you've ever used the windows screensaver one, it's the same thing. Idk if I can get it to read subfolders too, since the folder I was thinking of scrolling through has 1,411 files in 63 folders (I should probably go through and clean that out lol), not to mention the other folders I would like to go through (I take pride in my large image collection).

 

 

 

Thanks for the base project though, I'm really happy with it, and it gives me a great starting point for upgrades.

[hide=Funny Quotes]

So you sucker punched a kid in the back of the head? Good job.
What scares me is that you're like 10 years old.
-.- im not that freaking young
You were a couple years ago.
It's not racist if its true.
Hmm... I wonder how one goes about throwing someone out a window in a mystic fashion :-k

 

The mental image for that is freaking awesome.

[/hide]

- I dont need to "get a life." I'm a gamer - I have LOTS of lives!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.