Solved

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

Posted on 2003-11-17
5
320 Views
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?
0
Comment
Question by:Mazrim
  • 3
5 Comments
 
LVL 22

Expert Comment

by:cookre
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.
0
 

Author Comment

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

Accepted Solution

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

Presumably, you have something like:

HWND Window1;
HWND Window2;
...
Window1=CreateWindow();
...
Window2=CreateWindow();
...
then in your WNDPROC, something like

       case WM_PAINT:
            hdc=BeginPaint(hWnd,&ps);
            if (hWnd==Window1)...
            else ...
            EndPaint(hWnd,&ps);
            return 0;



0
 

Expert Comment

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

Expert Comment

by:cookre
ID: 9773726
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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 …

749 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