Popping up Windows and Child Windows

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2007
Posts: 2
Reputation: EnderW4785 is an unknown quantity at this point 
Solved Threads: 0
EnderW4785 EnderW4785 is offline Offline
Newbie Poster

Popping up Windows and Child Windows

 
0
  #1
Oct 2nd, 2007
I'm probably going about this all wrong, but I've written a piece of code that pops of a window, activates a DirectX device within the window, draws the mesh, paints on a texture and then allows me to move around the mesh with the arrow keys until I close the window at which time everything exits.

Now, the next step that I want to make is to put a control button on that original window that will allow me to call a function that controls which texture is painted onto the mesh. Here is how I've been trying to create the button:

// Register the window class
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
"D3D Tutorial", NULL };
RegisterClassEx( &wc );

// Create the application's window
HWND hWnd = CreateWindow( "D3D Tutorial", "D3D Tutorial 06: Meshes",
WS_OVERLAPPEDWINDOW, 200, 100, 450, 450,
NULL, NULL, wc.hInstance, NULL );

HWND hButton = CreateWindow( "button", "Configure",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON ,
540, 440, 100, 100, hWnd, 0, wc.hInstance, 0);

Then the next bit of code shows the hWnd window and the hButton window, draws the mesh etc.

The problem is the hButton window never shows up. If I remove the WS_CHILD option, it does, but then its no longer a child of the original window and I won't be able to see the message it throws when its clicked.

So, again, I'm probably going about this all wrong, but I'd like to attach a control to the original window. Any help would be greatly appreciated.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC