Skip to content

Instantly share code, notes, and snippets.

@norman-bauer
Created April 13, 2018 06:36
Show Gist options
  • Save norman-bauer/c61d32bb2f34b95e6eac35180cdc47e5 to your computer and use it in GitHub Desktop.
Save norman-bauer/c61d32bb2f34b95e6eac35180cdc47e5 to your computer and use it in GitHub Desktop.
UserAccountPicture.exe C# version
using System;
using System.Runtime.InteropServices;
namespace useraccountpicture
{
class Program
{
[DllImport("shell32.dll", EntryPoint = "#262", CharSet = CharSet.Unicode, PreserveSig = false)]
public static extern void SetUserTile(string username, int notneeded, string picturefilename);
[STAThread]
static void Main(string[] args)
{
if (args.Length == 2)
{
SetUserTile(args[0], 0, args[1]);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment