Solved

Is there code or an App to add skins to a program ?

Posted on 2000-04-20
7
197 Views
Last Modified: 2010-04-02
Would like to add a nice skin to an visual C++ 6 source. Possible ?
0
Comment
Question by:peter_b
  • 3
  • 3
7 Comments
 

Author Comment

by:peter_b
Comment Utility
is there something wrong with this question ?
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
I don't think anyone knows what you mean.   I don't.
0
 

Author Comment

by:peter_b
Comment Utility
oh ok then its good you say so. There are applications that dont look like regular windows. The buttons are different or they have different borders and colors. I thought this is called a skin. I think theres a program called windowsblinds that changes theappearance of windows itself.I would like to add such a skin to a program.  
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 22

Expert Comment

by:nietod
Comment Utility
>> I thought this is called a skin.
There is a term "wrapper"  but that still isn't what you are talking about.

Do you wish to write a program that has a different look?  that isn't too hard to do.

Do you wish to write a program that makes all windows look different?  That is hard to do, and strongly discouraged  (It may make other programs crash or work bizzarely.)
0
 

Author Comment

by:peter_b
Comment Utility
hmm am i really so un-understandable :/
I have an App. The app looks ugly, its simple windows style. I would like to "wrap", if thats the right word, its appearance.

>>that isn't too hard to do

for you ! For me as a beginner i need some example code. Dont want to write any for me just point me to a "howto" if you know one.

Thanks

0
 
LVL 22

Accepted Solution

by:
nietod earned 50 total points
Comment Utility
How you go about this depends on what you want to change.  But you either need to write new window classes that have the look you want or you need to sub-class or super-class existing window classes to alter the way the behave  

For example, if you wanted to create a push-botton with a unusual look.  You coudl write a window class from scratch.  (Note in this entire discussion, the word "class" has nothing to so with the C++ term "class", it is used to describe the window classes (window procedures and other information that windows OS records for a windows application.)   You woudl have to write a new window procedure for the class and register the class and window procedure using RegisterClass().  The window procedure would have to do almost everything required of a pushbutton.   i.e. it would have to handle the WM_PAINT message and draw the button at that time.  it woudl have to handle WM_MOUSExxxx messages and make the button respond to the mouse.  it would have to handle keyboard messages so the button could be "presssed" with the keyboard.  etc etc etc.  its not hard to do, but it is a lot of work (I know.)

An easier approach may be to super-class an existing window class.  When you super class, you again register a window new class, but you also use GetClassLong() to get a pointer to the window procedure of an existing window class.  Then you new window procedure handles some messages itself, messages that it wants to have a unique behavior for, and for the rest of the messages, it passes the message onto the window procedure  ot obtained the pointer to.  So for example, for a button with a custom appearance, but that responds to the nmouse just like other buttons, you could super-class the regular windows push button class.  For the WM_PAINT message you could handle the message yourself, but for mouse messages, you could pass the message onto the regular push-botton window procedure so they get handled just like other buttons.  This is theoretically less work, but it doesn't always work well, because you don't always know the behavior of the default window classes well enough to make use of them.

These concepts are covere in most introductory windows programming books.  Like "Programming Windows".  I woudl recommend you get one or two and read them.  (One probably isn't enough and a single read through is probably not enough.)
0
 

Expert Comment

by:aviggio
Comment Utility
Check out ActiveSkin (http://www.softshape.com/activeskin/) or StyleSkin (http://www.pollensoftware.com/styleskin/index.html). Reuse, reuse, reuse. If you do happen to come up with your own set of C++ classes for skinning, please let me know.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now