WinForm Within Start Menu Area

Posted on 2011-10-27
Last Modified: 2012-05-12
Hi - I need some help with winforms within c# using VS 2010.

i am creating a kiosk application and my desktop size is 1024 x 600.

i need to have my winform take the screen area that the start menu typically uses - or some how limiting the users ability to click inside of the "blank" area cause by the missing portion of the start menu.

 i remove the start menu area by using the following commands:

        private static extern IntPtr FindWindowEx(IntPtr parentHwnd, IntPtr childAfterHwnd, IntPtr className, string windowText);

        [DllImport("user32.dll", SetLastError = true)]
        private static extern System.IntPtr FindWindow(string lpClassName, string lpWindowName);

        private static extern int ShowWindow(IntPtr hwnd, int command);

        public const int SW_HIDE = 0;
        public const int SW_SHOW = 1;

        public static void ToggleTaskbar(int setting, out string Error)
            Error = string.Empty;
                IntPtr taskBarWnd = FindWindow("Shell_TrayWnd", null);
                IntPtr hwndOrb = FindWindowEx(IntPtr.Zero, IntPtr.Zero, (IntPtr)0xC017, "Start");   //0xC017 forces element to be treated as ATOM
                ShowWindow(hwndOrb, setting);
                ShowWindow(taskBarWnd, setting);

            catch (Exception ex)
                Error = ex.Message;

any help would be appreciated.... thanks
Question by:freezingHot
    1 Comment
    LVL 1

    Accepted Solution

    fixed by setting the start menu (taskbar) to "auto-hide."  once i did that, the form expanded over the taskbar area.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now