private void GetActiveWindow()
{
try
{
const int nChars = 256;
int handle = 0;
StringBuilder Buff = new StringBuilder(nChars);
handle = GetForegroundWindow();
if ( GetWindowText(handle, Buff, nChars) > 0 )
{
textBox1.Text = Buff.ToString();
}
comboBox1.Visible = false;
button1_Click(null,null);
}
catch(Exception wentWrong)
{
// MessageBox.Show(this,wentWrong.Message);
}
}
> Hello,
> I am trying to do the same thing but have no experience with pinvoke. Can
> you provide a code snippet to help get me started?
> Thanks!