You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.5 KiB
56 lines
1.5 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.ComponentModel; |
|
using System.Data; |
|
using System.Drawing; |
|
using System.Linq; |
|
using System.Text; |
|
using System.Threading.Tasks; |
|
using System.Windows.Forms; |
|
|
|
namespace LunaWin |
|
{ |
|
public partial class LunaHidden : Form |
|
{ |
|
private const int WM_WININICHANGE = 0x001A; |
|
public LunaHidden() |
|
{ |
|
InitializeComponent(); |
|
} |
|
protected override void WndProc(ref Message m) |
|
{ |
|
// Listen for operating system messages. |
|
switch (m.Msg) |
|
{ |
|
// The WM_ACTIVATEAPP message occurs when the application |
|
// becomes the active application or becomes inactive. |
|
case WM_WININICHANGE: |
|
// create string |
|
string str; |
|
|
|
|
|
// read string from memory pointer |
|
unsafe |
|
{ |
|
str = new string((char*)m.LParam); |
|
} |
|
|
|
// if string is "ImmersiveColorSet," |
|
// regenerate icon |
|
|
|
if (str == "ImmersiveColorSet") |
|
{ |
|
using (LunaIcon li = new LunaIcon()) |
|
{ |
|
li.Display(); |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
// pass message through |
|
base.WndProc(ref m); |
|
} |
|
} |
|
}
|
|
|