Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2003-11-17
5
Medium Priority
?
337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 160 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Make the most of your online learning experience.
Simple Linear Regression
Introduction to Processes

610 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