Expand|Select|Wrap|Line Numbers
- public const int GWL_EXSTYLE = -20;
- public const int WS_EX_LAYERED = 0x80000;
- public const int LWA_ALPHA = 0x2;
- public const int LWA_COLORKEY = 0x1;
- static void Main(string[] args){
- IntPtr Handle = Process.GetCurrentProcess().MainWindowHandle;
- Console.WriteLine(SetWindowLong(Handle,GWL_EXSTYLE,(int)GetWindowLong(Handle, GWL_EXSTYLE) ^ WS_EX_LAYERED));
- Console.WriteLine(Marshal.GetLastWin32Error());
- Console.WriteLine(SetLayeredWindowAttributes(Handle,0,64,LWA_ALPHA));
- Console.WriteLine(Marshal.GetLastWin32Error());
- Console.ReadKey();
- }
0 (SetWindowLong() failed)
1008 (ERROR_NO_TOKEN)
False (SetLayeredWindowAttributes() failed)
87 (ERROR_INVALID_PARAMETER)
I tried to find a solution, but I didn't find anything, please help me. (Of course I imported functions from user32.dll, and sorry if I made mistakes in text, I'm still learning English)