DotNet C++ Screensaver Preview Windows

  • Thread starter Thread starter barnold
  • Start date Start date
B

barnold

Goal: lets place a form inside the screensaver preview window.
Step1-
Parse the command line....
. . . . .
else if (0==arg->CompareTo("/p")) // Preview in small window.
{
Application::Run(gcnew Form2(IntPtr(int::Parse(args[1]))));
}

Step2-
Form2(IntPtr PreviewHandle)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
this->Parent = (Form ^)FromHandle(PreviewHandle);
}

Step3-
private: System::Void Form2_Load(System::Object^ sender,
System::EventArgs^ e) {
this->Location = Point(0,0);
this->Refresh();
}
Results-
Form2 is positioned in the upper left corner of the desktop
instead of inside the screensaver preview window.
Tests-
Try adjusting any and all MDI parameters. No help.
I noticed that some C# code uses SetParent(). This is not
available with C++ CLI.
Here's another problem: I will need a method to automatically
close Form2.
Does anyone have any ideas?
 
Back
Top