Thread: Getting the desktip window

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    76

    Getting the desktip window

    Hi fellas ,

    I intend to know how to get desktop window with C#.I do know I will have to
    use [DllImport] technic but don't really know which windows Api.I want to
    do fun with desktop for ex : tearing away the status bar,splashing the desktop screen.

    best regards,
    Chakra
    Last edited by CChakra; 02-01-2009 at 08:40 AM.

  2. #2
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Probably GetDesktopWindow.

    Code:
    using System;
    using System.Text;
    using System.Runtime.InteropServices;
    
    namespace Test
    {
        public class MyTest
        {
            [DllImport("user32")]
                 public static extern IntPtr  GetDesktopWindow();
            static void Main()
         {
                IntPtr  hDesktop = GetDesktopWindow();
    			System.Console.WriteLine("Desktop Handle  is {0,4:X}", hDesktop.ToInt32());
         }
       }
    }

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    76
    thanks buddy

    I have been looking for this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  4. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  5. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM