FindWindowW (coredll)
Last changed: -194.213.203.68

.
Summary
The function retrieves the handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows.

C# Signature:

[DllImport("coredll.dll", EntryPoint="FindWindowW", SetLastError=true)]
private static extern IntPtr FindWindowCE(string lpClassName, string lpWindowName);

VB Signature:

Declare Function FindWindowW Lib "coredll.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Taken from openNetCF in OpenNETCF.Win32.Core

Tips & Tricks:

Can be used to hide the start bar and start menu.

Sample Code:

Sample Code:

    public void HideStartBar()
    {
        IntPtr handle;

        try
        {
        // Find the handle to the Start Bar
        handle = FindWindowW("HHTaskBar", null);

        // If the handle is found then hide the start bar
        if (handle != IntPtr.Zero)
        {
            // Hide the start bar
            SetWindowPos(handle, 0, 0, 0, 0, 0, SWP_HIDEWINDOW);
        }
        }
        catch
        {
        MessageBox.Show("Could not hide Start Bar.");
        }
    }

    public void ShowStartBar()
    {
        IntPtr handle;

        try
        {
        // Find the handle to the Start Bar
        handle = FindWindowW("HHTaskBar", null);

        // If the handle is found then show the start bar
        if (handle != IntPtr.Zero)
        {
            // Show the start bar
            SetWindowPos(handle, 0, 0, 0, 240, 26, SWP_SHOWWINDOW);
        }
        }
        catch
        {
        MessageBox.Show("Could not show Start Bar.");
        }
    }

Documentation
FindWindowW on MSDN