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
 

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

Back
Top