T
Hallo miteinander!
Mit unten stehenden Listing läßt sich wunderbar die komplette Form eines
Renderprogrammes(Terragen) auf mein eigenes Form übertragen, auch wenn dabei alle darüber liegenden Forms mitgezeichnet werden(mein eigenes Programm z.B.).
Nun zu meiner Frage...
Wäre es möglich, da man Terragen "auch im Hintergrund" laufen lassen kann, dieses besagte Fenster auf meine Form zu bekommen, ohne Grafiken und Forms, die man auf dem Desktop sieht?
Oder besteht überhaupt keine Möglichkeit?
Mit unten stehenden Programm funzt es auf jeden Fall nicht, obwohl der Fenstertitel noch gefunden wird!
Für welchen Gebrauch?
Ich habe ein kleines Programm für Terragen geschrieben, mit dem man die Wolken verschieben kann.
Es wäre doch schön und nicht ganz so langweilig, wenn man noch den Renderfortschritt sehen könnte.
Für diejenigen, die es interresiert www.terradreamer.de
Dort kann man den Cloudmover herunterladen.
Danke schon mal für eure Antworten
void __fastcall TForm1::Button1Click(TObject *Sender)
{
HWND hWnd;
AnsiString FensterTitel;
for(hWnd = GetWindow(GetDesktopWindow(), GW_CHILD); hWnd; hWnd = GetNextWindow(hWnd, GW_HWNDNEXT))
{
GetWindowText(hWnd, FensterTitel.c_str(), 100);
Edit1->Text=FensterTitel.c_str(); // Ohne Übergabe an Edit1
// funktioniert's nicht
if (Edit1->Text=="Image - [NEW]")
HWND BCBHandle = hWnd;
if(BCBHandle)
{
//SetForegroundWindow(hWnd);
// Create a TCanvas for the BCB IDE window. GetWindowDC returns a DC for the
// whole window, including the menu, title bar and border.
HDC dc = GetWindowDC(hWnd);
Graphics::TCanvas *ScreenCanvas = new Graphics::TCanvas;
ScreenCanvas->Handle = dc;
// need to create a TRect that is the same width and height as the ClipRect
// of the Canvas, but whose left and top members are zero.
TRect rect = ScreenCanvas->ClipRect;
rect.Right = rect.Right - rect.Left;
rect.Bottom = rect.Bottom - rect.Top;
rect.Top = 0;
rect.Left = 0;
// resize the bitmap of the Image, and then copy the contents of the
// BCB ide canvas to the bitmap's canvas. Then clean up the canvas and DC
Image1->Picture->Bitmap->Width = rect.Right;
Image1->Picture->Bitmap->Height= rect.Bottom;
Image1->Picture->Bitmap->Canvas->CopyRect(rect,
ScreenCanvas,
ScreenCanvas->ClipRect);
delete ScreenCanvas;
ReleaseDC(BCBHandle,dc);
}
}
}
}
Edit:
Bitte die Code-Tags benutzen. Danke!