?
Hallo,
so habs jetzt auch mit VCL hinbekommen sodaß 2 Fenster im Vordergrund stehen.
Es klappt sogar mit der Funktion ShowModal() zum anzeigen des zweiten fensters
obwohl ich desöfteren gelesen habe es ginge nur mit CreateWindowEx
und ShowModal wäre da sowieso fehl am Platze und auch ich irgendwann davon überzeugt war.
Ich poste hier mal den Code des 2ten Fensters er ist eigentlich sehr Simpel
sobald das 2 Fenster angezeigt wird steht die gesamte Application im Vordergrund.
Öffnet das 2te Fenster mit Form2->ShowModal();.
(ja ich weiss kein WinApi)
Fenster 2 (unit1.cpp)
#include <vcl.h>
#pragma hdrstop
#include "Unit2.cpp"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::FormShow(TObject *Sender)
{
SetWindowPos(Application->Handle, HWND_TOPMOST, Left,Top, Width,
Height, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
Fenster 2 (unit2.h)
#ifndef Unit2H
#define Unit2H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TForm2 : public TForm
{
__published: // Von der IDE verwaltete Komponenten
TButton *Button1;
void __fastcall FormShow(TObject *Sender);
private: // Anwender-Deklarationen
protected:
void __fastcall CreateParams(TCreateParams &Params)
{
TForm::CreateParams(Params);
Params.WndParent = Application->MainForm->Handle;
}
public: // Anwender-Deklarationen
__fastcall TForm2(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm2 *Form2;
//---------------------------------------------------------------------------
#endif