Hi,
I want to create an application that has one main window, and within it I would like to be able to embed two windows, that will be a fixed size, this is so i can display camera feed to it.
Is it possible to achieve this?
Thank you
Hi,
I want to create an application that has one main window, and within it I would like to be able to embed two windows, that will be a fixed size, this is so i can display camera feed to it.
Is it possible to achieve this?
Thank you
Create your two other windows as children of your main window.
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
Do you want the camera feeds to be moveable or just remain where they are on screen?
You can create a control (as a child of the main window) like a frame or rectangle, create it a memory DC and draw to it.
or
create a seperate dialog (as a child if required) and process the size and move messages of the main window to keep it in place. ie if the main window moves you move the video feed window. Create it a memory DC and draw to it.
or
just draw the cameras image directly to the main windows DC, no other controls required. Double buffering will probably be required to prevent flickering. See the recent thread about bitmaps not redrawing for a link to code or search here for many examples.
*DC == device context
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
On a similar topic, how would one go about creating a window that acts and behaves like a dialogue box (pops up and is modal) but is *not* actually a dialogue box ?
Disable the parent window when you show the "fake" dialog window.Originally Posted by @nthony
Then run the following message loop to handle tabbing.Code:EnableWindow( parentWindow, FALSE );
Code:while ( GetMessage( &msg, NULL, 0, 0 ) > 0 ) { if ( !IsDialogMessage( hwndFakeDialog, &msg ) ) { TranslateMessage( &msg ) ; DispatchMessage( &msg ); } }
excellent thanks!
also, will both fake-dialog and parent window maximizie/minimize/restore together and share the same taskbar icon?