| | |
Popping up Windows and Child Windows
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2007
Posts: 2
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- Parent/Child Windows References (JavaScript / DHTML / AJAX)
- Windows 2000 - Windows Explorer folder view is gone (Windows NT / 2000 / XP)
- Javascript: Child windows talking to each other??? (JavaScript / DHTML / AJAX)
- Windows cannot find C:\WINDOWS\system 32\rhhgmsb\winlogon.exe (IT Professionals' Lounge)
- installing windows xp on existing windows 2003 server system. (Windows NT / 2000 / XP)
- Upgrading From Windows 2000 to Windows XP (Windows NT / 2000 / XP)
- Displaying a different bitmap in different child windows? - win32 in C (C)
- Obtain Remote Assistance Using Windows Messenger in Windows XP (Windows tips 'n' tweaks)
Other Threads in the C++ Forum
- Previous Thread: HELP ! Adding Numbers in A range
- Next Thread: NEED A HELP! please in code read the largest number
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock wordfrequency wxwidgets





