azaad2004
April 19th, 2006, 09:57 PM
hi fellow programmers!
I am doing a project with direct3d and win32 API. Part of this project has to have a "dynamic" monitor, which displays changing info in 3d space.
I have attached a screen-shot of the program( the black screen is where the dynamic display has to be added... but at the moment it is just a texture).
The dynamic display itself is a dynamic Graphics .exe file which I managed to open using CreateProcess method.
using BitBlt method I have managed to capture the contents of .exe file in another window but that window was not using direct3d; it was just an empty window.
how can I display this updating Bitmap using direct3d? Can I store the data on a buffer of some sort and then display it?
can this then be transformed?
Bear in mind this program is not only a bitmap; it's also displaying some text and numbers and some graphs which varry with time.
Here's the actual code so far:
CreateProcess(NULL,"play20m.bat",
NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE,
NULL,NULL,sim,prostruc) )
EnumWindows(&EnumWindowsProc,prostruc->dwThreadId);
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lparam)
{
DWORD ThreadId= GetWindowThreadProcessId(hwnd,NULL);
HWND EXEhandle,WindowHandle;
if( ThreadId == (DWORD)lparam)
{
EXEhandle=hwnd;
HDC DChandle=GetDC(EXEhandle);
HDC DCHandleDest;
if (DChandle!=NULL)
{
BitMapHwd= CreateCompatibleBitmap(DChandle,200,200);
Object= SelectObject(DChandle, BitMapHwd);
DCHandleDest=GetDC(g_hWnd);
BitBlt(DCHandleDest, 0, 0, 300,300, DChandle, 0, 0, SRCCOPY);
return true;
}
else MessageBox(0,"failed DC","failed DC",MB_OK);
return true;
}
return false;
}
I have posted this question here too, because this program ultimately needs to be implemented with direct3d.
This is where I asked the question before.. it's just a bit more detailed:
http://www.codeguru.com/forum/showthread.php?t=384188
Thanks,
I am doing a project with direct3d and win32 API. Part of this project has to have a "dynamic" monitor, which displays changing info in 3d space.
I have attached a screen-shot of the program( the black screen is where the dynamic display has to be added... but at the moment it is just a texture).
The dynamic display itself is a dynamic Graphics .exe file which I managed to open using CreateProcess method.
using BitBlt method I have managed to capture the contents of .exe file in another window but that window was not using direct3d; it was just an empty window.
how can I display this updating Bitmap using direct3d? Can I store the data on a buffer of some sort and then display it?
can this then be transformed?
Bear in mind this program is not only a bitmap; it's also displaying some text and numbers and some graphs which varry with time.
Here's the actual code so far:
CreateProcess(NULL,"play20m.bat",
NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE,
NULL,NULL,sim,prostruc) )
EnumWindows(&EnumWindowsProc,prostruc->dwThreadId);
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lparam)
{
DWORD ThreadId= GetWindowThreadProcessId(hwnd,NULL);
HWND EXEhandle,WindowHandle;
if( ThreadId == (DWORD)lparam)
{
EXEhandle=hwnd;
HDC DChandle=GetDC(EXEhandle);
HDC DCHandleDest;
if (DChandle!=NULL)
{
BitMapHwd= CreateCompatibleBitmap(DChandle,200,200);
Object= SelectObject(DChandle, BitMapHwd);
DCHandleDest=GetDC(g_hWnd);
BitBlt(DCHandleDest, 0, 0, 300,300, DChandle, 0, 0, SRCCOPY);
return true;
}
else MessageBox(0,"failed DC","failed DC",MB_OK);
return true;
}
return false;
}
I have posted this question here too, because this program ultimately needs to be implemented with direct3d.
This is where I asked the question before.. it's just a bit more detailed:
http://www.codeguru.com/forum/showthread.php?t=384188
Thanks,