FindWindow API not always working

  • Thread starter Thread starter PBS Productions
  • Start date Start date
P

PBS Productions

Hi,

does anyone know why the FinwWindow API function not always returns a
good result (using P/Invoke)


For instance below function sometimes returns the correct window
handle and sometimes it does not.

hProcess = FindWindow(Nothing, "MyApp")


The function worlks perfectly if called in an eVC++ app.


Thanks.
 
I use FindWindow and have not had any problems. Here is a sample of what I
use in C#:

[DllImport("coredll.dll")]
public static extern int FindWindow(string lpClassName, string
lpWindowName);

int h = FindWindow("HHTaskBar", "");


Regards,
Neville Lang
 
Back
Top