Solved

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

Posted on 2000-04-20
7
200 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
ID: 2752580
is there something wrong with this question ?
0
 
LVL 22

Expert Comment

by:nietod
ID: 2755514
I don't think anyone knows what you mean.   I don't.
0
 

Author Comment

by:peter_b
ID: 2755609
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 22

Expert Comment

by:nietod
ID: 2755728
>> 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
ID: 2756334
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
ID: 2757628
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
ID: 2882865
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

823 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