Search
Module:
Directory

Desktop Functions:

Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
FindWindowW (coredll)

coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for FindWindowW in other DLLs exists, click on Find References to the right.

.
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:

Public Declare Function FindWindow Lib "Coredll" Alias "FindWindowW" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr

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 = FindWindowCE("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 = FindWindowCE("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

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).


NEW: ANTS Memory Profiler 5 just released!

Memory Profiling made simple!

Download your free trial now. This download also contains the FREE PInvoke.net VS Add-in

Download Now
 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions