DotNet C++ Screensaver Preview Windows

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top