Jump to content

How to create two windows of diff colour

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
bodhi2016

bodhi2016

    Newbie

  • Members
  • PipPip
  • 29 posts
Well i am new to win32 programming .I haven't learnt muchand i am really confusedabout things like what is the difference between window handle and window class .I have created a single window.Now i am also trying to create two windows of diff. colour.But what i want to ask is that if i want to create two windows should it have two different class name.And what is a TCHAR variable.Like in a book i saw, static TCHAR sz_appname[]="my win class"-should this be different for both the windows.Please i am a learner dont get irritated by my amatuer type questions.
Thank you

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
As far as I remember, you can easily create subwindows without classnames, as long as their parent are the main window. One of the parameters to the create window-functions is the parent window. Lookup the function you're using for creating the window, and check how the parent shall be passed.

I'm not a Windows programmer anymore, so I may remember wrong.

#3
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,720 posts
Here are some excellent tutorials you can use to get started:

Tutorial: Getting Started
Win32 Programming - FunctionX

Explanation of the TCHAR type

If you want to make two windows with the same controls but different window colors, you shouldn't use two classes. Just create two windows of the same class, then repaint their background colors.