Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FindWindow()

36 views
Skip to first unread message

Silvia Bellucci

unread,
Feb 12, 1998, 3:00:00 AM2/12/98
to

Hi all!

Is there anyone who could tell me how to get the handle of an invisible
window, e.g. a window created not on the default desktop
(winsta0/default, like a non interactive service). The FindWindow
function fails, but I know the window is created and I need to access
it. One way could be to force it to be created on the default desktop,
but I'd rather find another way.

Thanks

Silvia


Jon Price

unread,
Feb 12, 1998, 3:00:00 AM2/12/98
to

If you know the class name, then pass it to the FindWindow API.

--
Jon Price
To reply remove the spamnot in my address.
.
Silvia Bellucci wrote in message <34E315AB...@tivoli.com>...

Valter Minute

unread,
Feb 13, 1998, 3:00:00 AM2/13/98
to

Silvia Bellucci wrote in message <34E315AB...@tivoli.com>...
>Hi all!
>
>Is there anyone who could tell me how to get the handle of an invisible
>window, e.g. a window created not on the default desktop
>(winsta0/default, like a non interactive service). The FindWindow
>function fails, but I know the window is created and I need to access
>it. One way could be to force it to be created on the default desktop,
>but I'd rather find another way.
>


You can try to use OpenDesktop to retrieve a handle for the window's desktop
and then EnumDesktopWindow to retrieve all top levels windows of the
selected desktop.
If you don't know the desktop name, you can try to loop through all desktops
with EnumDesktops.

Your process should have rights to enumerate and access windows on the
hidden desktop.

---
Valter Minute
min...@fortech.it (the reply address is invalid to avoid spam-mail)
www.fortech.it/english
---
Are you looking for a good freeware ScreenSaver? Try FOYD!
http://www.winsite.com/info/pc/win95/desktop/foyd1295.zip/
And ask me for the free C++ source code.

Silvia Bellucci

unread,
Feb 13, 1998, 3:00:00 AM2/13/98
to Jon Price

I know the class name, but if the window is not created on the default
desktop (winst0/default)FindWindow fails, even though I specify the name.
Any hints?

Thanks
Silvia

Jon Price wrote:

> If you know the class name, then pass it to the FindWindow API.
>
> --
> Jon Price
> To reply remove the spamnot in my address.
> .

> Silvia Bellucci wrote in message <34E315AB...@tivoli.com>...
> >Hi all!
> >
> >Is there anyone who could tell me how to get the handle of an invisible
> >window, e.g. a window created not on the default desktop
> >(winsta0/default, like a non interactive service). The FindWindow
> >function fails, but I know the window is created and I need to access
> >it. One way could be to force it to be created on the default desktop,
> >but I'd rather find another way.
> >

> >Thanks
> >
> >Silvia
> >


Felix Kasza [MVP]

unread,
Feb 14, 1998, 3:00:00 AM2/14/98
to

Silvia,

> Is there anyone who could tell me how to get the handle of an invisible
> window, e.g. a window created not on the default desktop

EnumWindowStations(), EnumDesktops(), FindWindow().

Don't forget to set your default winsta/desktop appropriately before
calling FindWindow. Also, unless you created that winsta/desktop
yourself, you may need to perform surgery on the ACLs of the winstas
and desktops returned.

Cheers,
Felix.

--
If you post a reply, kindly refrain from emailing it, too.
I have killfiled hotmail.com and yahoo.com. If you are legit,
come forth and be recognized -- with a *real* email address.

0 new messages