Board index » delphi » WINAPI Experts , any help on FindWindow please...

WINAPI Experts , any help on FindWindow please...

Hello People,

I would like to get a handle of another window i.e. like Notepad and
then make it invisible.

I don't know what to fill in with Classname in FindWidow.
I tried 'TApplication' and others, but doesn't work.

WindowFound := FindWindow( ??? Classname ???,'Untitled - Notepad');
ShowWindow(WindowFound,SW_HIDE);

Any help would be appreciated.

 

Re:WINAPI Experts , any help on FindWindow please...


Using winsight32 on win95 I found notepads classname to be 'Notepad'.
--
Jim Boyle
QRI

Mories Kok <mor...@euronet.nl> wrote in article
<01bbaaff$c0e47280$290c86c2@taweb>...

Quote
> Hello People,

> I would like to get a handle of another window i.e. like Notepad and
> then make it invisible.

> I don't know what to fill in with Classname in FindWidow.
> I tried 'TApplication' and others, but doesn't work.

> WindowFound := FindWindow( ??? Classname ???,'Untitled - Notepad');
> ShowWindow(WindowFound,SW_HIDE);

> Any help would be appreciated.

Re:WINAPI Experts , any help on FindWindow please...


Try :

ShowWindow(fFindWindow(nil, 'Untitled - Notepad') , SW_HIDE);

RGDS    Dennis.

Quote
"Mories Kok" <mor...@euronet.nl> wrote:
> I would like to get a handle of another window i.e. like Notepad and
>then make it invisible.
>I don't know what to fill in with Classname in FindWidow.
>I tried 'TApplication' and others, but doesn't work.
>WindowFound := FindWindow( ??? Classname ???,'Untitled - Notepad');
>ShowWindow(WindowFound,SW_HIDE);
>Any help would be appreciated.

Re:WINAPI Experts , any help on FindWindow please...


I would recommend using EnumWindows instead of FindWindow.  EnumWindows
enumerates all of the top-level windows active in Windows and passes the
HWnd to a user-defined function.  You can then use GetWindowText to
retrieve the name of the window associated with the handle.  Once you have
the window handle you can send any message you like.  

If you need more help, contact me.  I also have written a component
(yesterday) that does exactly what I just described.  It finds the window
by title and then allows you to Close, Maximize, Minimize, or Restore that
window.  I'd like to post it on the DSP, but I've had a little trouble
using it on Win95, so I'm going to test it first.

Hope this helps,
Blake Schwendiman

Mories Kok <mor...@euronet.nl> wrote in article
<01bbaaff$c0e47280$290c86c2@taweb>...

Quote
> Hello People,

> I would like to get a handle of another window i.e. like Notepad and
> then make it invisible.

> I don't know what to fill in with Classname in FindWidow.
> I tried 'TApplication' and others, but doesn't work.

> WindowFound := FindWindow( ??? Classname ???,'Untitled - Notepad');
> ShowWindow(WindowFound,SW_HIDE);

> Any help would be appreciated.

Other Threads