Translate Window Style to strings

In many cases, the programmer needs to understand what a value means. It's about window styles. For him 0x500000C2 means nothing as window styles. Of course, Spy++ solve this problem, but you must lookup for a window with that styles. It's easy, to drag a cursor over the window, and then windows style can be founded from one of the properties pages. Spy++ do not recognize the latest styles of some windows. For sample let take a header control with styles set to 0x500000C2. Spy++ will give you the styles WS_CHILD | WS_VISIBLE | HDS_HORZ | HDS_BUTTONS | 0xC0. It's right. What 0xC0 represent. The 0xC0 style's sysheader32 control represent HDS_DRAGDROP | HDS_FULLDRAG. So, I designed a short class for translate style, extended styles, and class styles to strings. Let's see a short snippet code for using this class:
CTranslateWindowStyle tws;		// declare a tws member for translation styles

tws.SetStyle(pWnd);			// prepare a styles of window pWnd for translate
CString sStyles = tws.Translate();	// In sStyle will be retrieve the string as window style.

tws.SetExStyle(pWnd);
CString sExStyles = tws.Translate();	// in sExStyles, will have the extended window style.

tws.SetClassStyle(pWnd);
CString sClassStyles = tws.Translate();	// in sClassStyles, will have the class window style.

Translate(), public function of CTranslateWindowStyle class, will translate the latest styles set (by calling one of the following functions: SetStyle, SetExStyle, SetClassStyle.) as normal, extended, class window style.
If you have a new window control, you can add your own style. Just see into the header file of CTranslateWindowStyle class.

Download demo project - 46KB

Download source - 5KB

Date Posted: 09/29/98


Comments

  • The project files are not complete!

    Posted by Legacy on 11/19/1998 12:00am

    Originally posted by: Ming

    Hi,

    I like your this cool work. But when I want to build the project,
    I found that there were not FloorObject.cpp, FloorPageObject.cpp
    and FloorWnd.cpp in your Zip file.

    Would you please add them again?

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Live Event Date: October 28, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT The Financial Services industry is a target today like never before, as attackers leverage different techniques to breach and exploit IT security. In recent months, there have been a number of high profile data breaches and attacks that have impacted the Financial Services industry. By examining the recent attacks, several key trends emerge about what attackers are targeting and how organizations can bolster their defenses. Join us for this …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds