Solved

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

Posted on 2003-11-17
5
326 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

689 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