 |
|
|
 |
|
 |
Application has generated an exception that could be handeld.
Process id=0x804(2552), thread id=0x119c(4508).
Nice...
Also i do not, as a user have access to write to myt c: drive.
Makes it intersting HEHE.
Maybe a setup before the program start to say where to put the xml file and what not.
|
|
|
|
 |
|
 |
I want to set a calendar in top left of desktop.
I use my owner calendar control,
you may help me for this problem ?
Thank you.
|
|
|
|
 |
|
 |
I noticed that one cannot change the way in which the wallpaper bitmap is displayed on the desktop (centered or tiled).
Is there a way with the API to switch (toggle) between the centered and tiled wallpaper options ?
|
|
|
|
 |
|
|
 |
|
 |
I actually created a class already. Haven't tested but it's a starter even if it doesn't work. Here ya go:
using Microsoft.Win32;
using System.Runtime.InteropServices;
namespace AlbumViewer
{
static class WallpaperSetup
{
public enum WallpaperStyle
{
Center,
Stretch,
Tile
}
public static void SetWallpaper(string BMPFilename, WallpaperStyle Style)
{
WallpaperSetup.SetWallpaperStyle(Style);
WinAPI.SystemParametersInfo(WinAPI.SPI_SETDESKWALLPAPER, 0, BMPFilename, WinAPI.SPIF_SENDCHANGE);
}
private static void SetWallpaperStyle(WallpaperStyle Style)
{
RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true);
switch( Style )
{
case WallpaperStyle.Center:
key.SetValue("TileWallpaper", "0");
key.SetValue("WallpaperStyle", "0");
break;
case WallpaperStyle.Stretch:
key.SetValue("TileWallpaper", "0");
key.SetValue("WallpaperStyle", "2");
break;
case WallpaperStyle.Tile:
key.SetValue("TileWallpaper", "1");
key.SetValue("WallpaperStyle", "0");
break;
}
key.Close();
}
private static class WinAPI
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
public const int SPI_SETDESKWALLPAPER = 20;
public const int SPIF_SENDCHANGE = 0x2;
}
}
}
-- modified at 14:41 Monday 20th February, 2006
Fixing the code.
|
|
|
|
 |
|
 |
All working now... Enjoy.
|
|
|
|
 |
|
 |
Why does this application take up so much memory? 13mb on average when I compile with VS 2k5 beta 2, and 17mb on average with .Net 2k3 Enterprise. That's alot to ask for a stay-resident program.
Is there any way to optimize this application so it's much less resource intensive? The executable is only 32k... or is C and Win32 API still the only way to not use TONS of resources when writing simple Windows Apps?
Thanks.
|
|
|
|
 |
|
 |
good question. I have no answer. I kept using dispose() whenever but still - i couldn't figure it.
probably something about the Win32APIS
|
|
|
|
 |
|
 |
These all are the blessings of CLR.
The time the application resides on host, CLR has to be loaded. And CLR services like GC runs in a separate process.
Hmm.. for me, its quite intresting decision to think before taking my application into the OS, ESpecially if resident.
Regards,
Santosh Sahoo
|
|
|
|
 |
|
 |
Hi
I know i should not ask here, but I am desperate to contact kfir arbel if you have his e-mail address can you send it to me as odt@askhenry.co.uk I need some help with a wallpaper changing script
thanks
simon
|
|
|
|
 |
|
 |
Looks to be a promising application.
I haven't found so much Wallpaper Changers that work for XP and yours is one of them.
And yours work much better than the one I use at the moment.
Especially I like that it supports not only BMP pictures.
But to be my favorite, it should include at least two things:
1. Recursive directory import (to add each file by hand is quite awful and time consuming). So it should support selection of folders and/or multifile selection. Drag-n-Drop would also be nice.
2. When minimized the window should disappear and only a small icon in the notification area of the taskbar should show up. (I think there was an example of this somewhere on this site).
Greets,
Sven
|
|
|
|
 |
|
 |
. . . in addition there should be an intervall of "infinity" and a command line option to change the wallpaper at startup (for placing it in the auto start folder).
--
Jens Scheidtmann
|
|
|
|
 |
|
 |
. . . and then exit of course.
(Sorry, I was too fast).
--
Jens Scheidtmann
|
|
|
|
 |
|
 |
The code is included, why dont you just make the changes you want and perhapse write an article while you are at it.
|
|
|
|
 |
|
 |
Thanks for the quick remarks. I am happy that you find the application useful.
I will address them the following week
Kfir Arbel
|
|
|
|
 |
|
 |
If you're just looking for a great free wallpaper changer, I recommend the one at: http://jamesgart.com/wallpaperchanger/
Although of course it doesn't include the source code for it
|
|
|
|
 |
|
 |
I wrote such utility for myself. And it does recursive directory import. Changing of wallpaper occurs only at startup - I don't want my program to sit in system tray. It's written in C++ using COM and WTL. Here is the code to change the wallpaper - it support all picture formats, that Windows XP does. IActiveDesktopPtr desktop(CLSID_ActiveDesktop, 0, CLSCTX_INPROC_SERVER); if (desktop->SetWallpaper(wallpaper, 0) == S_OK) desktop->ApplyChanges(AD_APPLY_ALL); That's all.
|
|
|
|
 |