I haven't got the FindWindow routine to work for me yet, but I tried
another solution.

        private void cmdFindWindow_Click(object sender, EventArgs e)
        {
            Process[] processes = Process.GetProcessesByName("Pocket
Controller-Pro");
            foreach (Process p in processes)
            {
                IntPtr pFoundWindow = p.MainWindowHandle;
                // Do something with the handle...
                MessageBox.Show("Found it!");
                //
            }

        }

It also doesn't work. I'm taking baby steps here, but I keep falling
down :(


On Jun 24, 1:40 am, Cerebrus <[email protected]> wrote:
> You can still use the Win32 API in .NET to access OS handles. Check
> out pinvoke.net, specifically the "FindWindow" function in user32.dll.
>
> I don't know of any commercial products that wrap the Win32 API but
> there is this open source implementation that is a managed wrapper
> around the API along with many other utility classes 
> -http://mwinapi.sourceforge.net/
>
> On Jun 23, 6:43 pm, "Scott M." <[email protected]> wrote:
>
>
>
> > Hi, This is my first post. I have been a VB6 programmer for 10 years
> > and now I am making the switch to C#.Net. I used to use a program
> > called Microsoft Test to control other Windows apps and I would now
> > like to do that with C#.Net. It has been several years since I wrote
> > this type of program, but what I remember is that I had to search for
> > the application, usually by the title and then find out the handle for
> > the control I wanted to access. Right now, I want to write a desktop
> > application to control a really cool application called Pocket
> > Controller-Pro, which will allow me to test a mobile device. Anyways,
> > does anyone know of a product I can purchase to allow me to do this?
>
> > Thanks,
>
> > Scott- Hide quoted text -
>
> - Show quoted text -

Reply via email to