?
Solved

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

Posted on 2003-11-17
5
Medium Priority
?
329 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Progress
Suggested Courses

770 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