About the top of a system software, the top of the system software

Source: Internet
Author: User
Tags windows 10 enterprise

About the top of a system software, the top of the system software

A new project requires the system top-down function. This is a simple task, but the more you discover it, the more you record it:

System Environment: 64-bit win7 flagship version;

IDE: VS2013;

WPF + C # development.

1. Set Topmost attribute to true.

There is a problem with running wood, which is very easy. Open osk.exe at the same time.

After checking the information, people also use the top function, and both are sticking to the top, and the old man's house (osk.exe) won't be able to get down any more.

2. Use a stupid method to set Topmost = true cyclically;

While (true)
{
Try
{
Thread. Sleep (2 );
Lock (_ thisLock)
{
This. Dispatcher. Invoke (new Action () =>
{
This. Topmost = false;
}), Null );
}
}
Catch (Exception ex)
{

MessageBox. Show (ex. Message );
}

}

 

Hey, let's get it done. Then various functions are implemented on Windows 7. Finally, the development is complete, and then the test is performed.

One problem found:

Windows 7 has a preview window under the areo topic. For example, in the above case, my window cannot be topped.

I posted a post on the Microsoft forum to find the solution. The answer is as follows:

"

Hi,

Simply put, no. The Windows 7 taskbar (thumbnail) preview itself is a window, and you want to directly set a WPF window setparent to the preview window, equivalent to the current wpf form, there must be two instances of the same form, one on the desktop and the other on the preview window.

If you want to directly interact with your program in this preview window, the Windows API Code Pack thumbnail button and jump list may be what you want, you cannot directly preview the taskbar thumbnails of Windows 7.

"

Okay! Leave this problem aside first. If the garden has a solution, leave a message.

Then the test of the win7 system came to an end;

========================================================== ============================================

System Environment: Windows 10 Enterprise Edition 64-bit;

IDE: VS2013;

WPF + C # development.

During win10 system testing, it is okay to stick to the top of other software layers, but it cannot be set on the Start Menu, for example:

Then, various materials were found and tested. The methods used were as follows:

HwndSource source = (HwndSource) PresentationSource. FromVisual (this );
IntPtr handle = source. Handle;
Bool b1 = BringWindowToTop (handle );

------------------------------------------------------------

IntPtr CustomBar = FindWindow (null, "MainWindow"); // name of the form to be topped in the program
IntPtr desktop = GetDesktopWindow ();
If (CustomBar! = Null)
{
SetWindowPos (CustomBar, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );

SetParent (desktop, CustomBar );
}

------------------------------------------------

It's just a variety of win32 APIs! Do you have a solution? What is the starting menu of win10?

However, I tested sogou's input method.

  Are there sogou engineers in the garden? How to implement it? How to implement it? How to implement it?Then compare them with my own window and sogou input method, as shown below: My window is on sogou input method again. Where is the real? Where is the great god? Where is the great god?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.