Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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

18 Experts available now in Live!

Get 1:1 Help Now