I was given some example code but I can not get the function to show up in the System Platform script.
The dll import is successful but I'm unsure how to reference it in script or if I created it with the wrong Visual Studio template type, Windows Forms Class Library - c#.
This is the dll code:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace WinFormsLibrary1
{
public class ResizableForm
{
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
public Form GetCurrentWindow()
{
IntPtr activeWindowHandle = GetForegroundWindow();
Form f = Control.FromHandle(activeWindowHandle) as Form;
return f;
}
}
}
When I try to use it in script I get the error, Unknown Type.
Also tried "WinFormsLibrary1.ResizableForm"
Dim myLib As ResizableForm;
Dim myGfc As System.Windows.Forms.Form;
myLib = new ResizableForm();
myGfc = myLib.GetCurrentWindow();
myGfc.Width = #;
myGfc.Height = #;
The dll import is successful but I'm unsure how to reference it in script or if I created it with the wrong Visual Studio template type, Windows Forms Class Library - c#.
This is the dll code:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace WinFormsLibrary1
{
public class ResizableForm
{
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
public Form GetCurrentWindow()
{
IntPtr activeWindowHandle = GetForegroundWindow();
Form f = Control.FromHandle(activeWindowHandle) as Form;
return f;
}
}
}
When I try to use it in script I get the error, Unknown Type.
Also tried "WinFormsLibrary1.ResizableForm"
Dim myLib As ResizableForm;
Dim myGfc As System.Windows.Forms.Form;
myLib = new ResizableForm();
myGfc = myLib.GetCurrentWindow();
myGfc.Width = #;
myGfc.Height = #;