Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualDrakken255

Posted 10 September 2012 - 09:21 AM

Hello all, I am starting development of 2.0 of my program, PatchCraft. (go.to/patchcraft) I have been able to launch Minecraft directly without using the launcher, but cannot change the icon from the current Java logo. I am currently using this:
//Class level:
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hwnd, int message, int wParam, IntPtr lParam);
private const int WM_SETICON = 0x80;
private const int ICON_SMALL = 0;
private const int ICON_BIG = 1;
//Method level:
string appData = Environment.GetEnvironmentVariable("APPDATA");


ProcessStartInfo mcStartInfo = new ProcessStartInfo("javaw", "-Xms1G -Xmx1G -cp \"" + appData + "\\.minecraft\\bin\\minecraft.jar;" + appData + "\\.minecraft\\bin\\jinput.jar;" + appData + "\\.minecraft\\bin\\lwjgl.jar;" + appData + "\\.minecraft\\bin\\lwjgl_util.jar;\" -Djava.library.path=\"" + appData + "\\.minecraft\\bin\\natives\" net.minecraft.client.Minecraft" + " " + username + " " + sessionID);
Process minecraft = new Process() { StartInfo = mcStartInfo };

minecraft.Start();
minecraft.WaitForInputIdle();

SendMessage(minecraft.MainWindowHandle, WM_SETICON, ICON_BIG, Icon.FromHandle(this.Handle).Handle);

//Also tried:
//SendMessage(minecraft.MainWindowHandle, WM_SETICON, ICON_SMALL, Icon.FromHandle(this.Handle).Handle);

On a side note, why can't I start it from my program with more than one gigabyte of memory, when my computer is capable of running a legit server and client with 8GB each at the same time?

#3Drakken255

Posted 10 September 2012 - 09:20 AM

Hello all, I am starting development of 2.0 of my program, PatchCraft. (go.to/patchcraft) I have been able to launch Minecraft directly without using the launcher, but cannot change the icon from the current Java logo. I am currently using this:
//Class level:
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hwnd, int message, int wParam, IntPtr lParam);
private const int WM_SETICON = 0x80;
private const int ICON_SMALL = 0;
private const int ICON_BIG = 1;
//Method level:
string appData = Environment.GetEnvironmentVariable("APPDATA");


ProcessStartInfo mcStartInfo = new ProcessStartInfo("javaw", "-Xms1G -Xmx1G -cp \"" + appData + "\\.minecraft\\bin\\minecraft.jar;" + appData + "\\.minecraft\\bin\\jinput.jar;" + appData + "\\.minecraft\\bin\\lwjgl.jar;" + appData + "\\.minecraft\\bin\\lwjgl_util.jar;\" -Djava.library.path=\"" + appData + "\\.minecraft\\bin\\natives\" net.minecraft.client.Minecraft" + " " + username + " " + sessionID);
Process minecraft = new Process() { StartInfo = mcStartInfo };

minecraft.Start();
minecraft.WaitForInputIdle();

SendMessage(minecraft.MainWindowHandle, WM_SETICON, ICON_BIG, Icon.FromHandle(this.Handle).Handle);

//Also tried:
//SendMessage(minecraft.MainWindowHandle, WM_SETICON, ICON_SMALL, Icon.FromHandle(this.Handle).Handle);
On a side note, why can't I start it from my program with more than one gigabyte of memory, when my computer is capable of running a legit server and client with 8GB each at the same time?

#2Drakken255

Posted 10 September 2012 - 09:19 AM

Hello all, I am starting development of 2.0 of my program, PatchCraft. (go.to/patchcraft) I have been able to launch Minecraft directly without using the launcher, but cannot change the icon from the current Java logo. I am currently using this:
//Class level:
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hwnd, int message, int wParam, IntPtr lParam);
private const int WM_SETICON = 0x80;
private const int ICON_SMALL = 0;
private const int ICON_BIG = 1;
//Method level:
minecraft.Start();
minecraft.WaitForInputIdle();
SendMessage(minecraft.MainWindowHandle, WM_SETICON, ICON_BIG, Icon.FromHandle(this.Handle).Handle);
//Also tried:
//SendMessage(minecraft.MainWindowHandle, WM_SETICON, ICON_SMALL, Icon.FromHandle(this.Handle).Handle);
On a side note, why can't I start it from my program with more than one gigabyte of memory, when my computer is capable of running a legit server and client with 8GB each at the same time?

#1Drakken255

Posted 10 September 2012 - 09:18 AM

Hello all, I am starting development of 2.0 of my program, PatchCraft. (go.to/patchcraft) I have been able to launch Minecraft directly without iusing the launcher, but cannot change the icon from the current Java logo. I am currently using this:

//Class level:
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hwnd, int message, int wParam, IntPtr lParam);
private const int WM_SETICON = 0x80;
private const int ICON_SMALL = 0;
private const int ICON_BIG = 1;
//Method level:
minecraft.Start();
minecraft.WaitForInputIdle();
SendMessage(minecraft.MainWindowHandle, WM_SETICON, ICON_BIG, Icon.FromHandle(this.Handle).Handle);
//Also tried:
//SendMessage(minecraft.MainWindowHandle, WM_SETICON, ICON_SMALL, Icon.FromHandle(this.Handle).Handle);

On a side note, why can't I start it from my program with more than one gigabyte of memory, when my computer is capable of running a legit server and client with 8GB each at the same time?

PARTNERS