I've a client application which having some tabs in the menu tab as follows.I need to perform some action when the browse tab is selected. how can i get that event in my application. i want to write my own application to perform this action. I tried in this way
int chars = 256;
StringBuilder buff = new StringBuilder(chars);
// Obtain the handle of the active window.
IntPtr handle = GetForegroundWindow();
if (GetWindowText(handle, buff, chars) > 0)
{
if (buff.ToString() == mainWindowName)
{
IntPtr WndToFind = FindWindowByCaption(IntPtr.zero, "Browse");
if(WndToFind != IntPtr.Zero)
{
MessageBox.Show("Inside Browse");
}
}
}
I want to dispaly some message when Browse tab is active. Please help me.