SWT gets Windows system window color

Source: Internet
Author: User



Many people use the computer to change the color of the system window to a wink (85, 95, 205), in the design of the interface background of the software need to consider that the background color is based on the system's window color to determine.

When using AWT, you can get the Windows System window color through Java.awt.SystemColor.window. When using SWT, you cannot get the system window color if you use Display.getsystemcolor (ID). But through the display of the Getsystemcolor method can inspire us to write a method to get the system window color, the following is the code:

int pixel = Org.eclipse.swt.internal.win32.OS.GetSysColor (OS. Color_window); Color Windowcolor = color.win32_new (Display,pixel);

When there is a problem with the above code, the Checkdevice () procedure when Display.getsystemcolor (ID) is omitted, and the fetch process may have an error.

This article from "Winger" blog, declined reprint!

SWT gets Windows system window color

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.