Please Help Me Quick!!!!   **C++ Windows Q**

Posted on 2003-11-17
Last Modified: 2010-04-17
I am creating a windows program using gdi.  Besides the main window I need to be able to create a second, smaller window every once in a while.  To display info and stuff...    

I want to interact with the second window in a similar way to the first one.  But I dont want them to get all tangled together and stuff....   Any simple solutions to creating this popup window and working with it?
Question by:Mazrim
  • 3
LVL 22

Expert Comment

ID: 9769108
Just use the normal CreateWindow and switch between them with SetFocus(hwnd).  Don't forget that the message pump gives your WNDPROC the HWND associated with the message.

If you don't want to deal with that, perhaps you can settle for a child dialog window.

Author Comment

ID: 9769125
so how do i tell which message is from which window?
LVL 22

Accepted Solution

cookre earned 40 total points
ID: 9769154
Thats the HWND parameter to your WNDPROC.

Presumably, you have something like:

HWND Window1;
HWND Window2;
then in your WNDPROC, something like

       case WM_PAINT:
            if (hWnd==Window1)...
            else ...
            return 0;


Expert Comment

ID: 9772463
i was just wondering...  whats the diff between a normal window and a child window?
LVL 22

Expert Comment

ID: 9773726

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

22 Experts available now in Live!

Get 1:1 Help Now