Hello.
I try to create animated wallpaper like HyperSpace 3D.
But I've got a problem:
What I do(code snippet):
[DllImport("user32.dll")]
public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
[DllImport("User32.DLL")]
public static extern int SendMessage(IntPtr hWnd, UInt32 Msg, Int32 wParam, Int32 lParam);
[DllImport("user32.dll", SetLastError = true)]
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern long SetWindowLong(IntPtr hWnd, int nIndex, long dwNewLong);
public long WS_CHILD = 0x40000000L, WS_VISIBLE = 0x10000000L,
WS_DISABLED = 0x08000000L,
WS_CLIPSIBLINGS = 0x04000000L,
WS_CLIPCHILDREN = 0x02000000L,
WS_EX_TRANSPARENT = 0x00000020L, WS_EX_RIGHTSCROLLBAR = 0x00000000L, WS_EX_LEFT = 0x00000000L,
WS_EX_LTRREADING = 0x00000000L,
SWP_NOSIZE = 0x0001,
SWP_NOMOVE = 0x0002;
public int LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1000 + 54, GWL_STYLE = (-16),
GWL_EXSTYLE = (-20), LVS_EX_REGIONAL = 0x00000200;
IntPtr SysListView32;
private void button1_Click(object sender, EventArgs e)
{
IntPtr Progman = FindWindow("Progman",null);
IntPtr ShellDll = FindWindowEx(Progman, IntPtr.Zero, "SHELLDLL_DefView",null);
SysListView32 = FindWindowEx(ShellDll, IntPtr.Zero,"SysListView32",null);
Form TestForm = new Form();
TestForm.FormBorderStyle = FormBorderStyle.None;
TestForm.Width = Screen.PrimaryScreen.WorkingArea.Width;
TestForm.Height = Screen.PrimaryScreen.WorkingArea.Height;
TestForm.Top = 0; TestForm.Left = 0;
TestForm.Text = "TestApp";
SetWindowLong(TestForm.Handle, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | WS_DISABLED | WS_VISIBLE);
SetWindowLong(TestForm.Handle, GWL_EXSTYLE, WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR /*| WS_EX_TRANSPARENT*/);
SetParent(TestForm.Handle, ShellDll);
SendMessage(SysListView32, (uint)LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_REGIONAL, LVS_EX_REGIONAL);
bool ret = SetWindowPos(TestForm.Handle, SysListView32, 0, 0, 0, 0, (uint)(SWP_NOSIZE));
}
If you will run this code, you see many differences between my window and 'HyperSpace 3D' window. These differences are in visual style and behaviour. I want get the same behaviour and visual style like HyperSpace 3D. Please, help me.
Sorry for my English:)