Get the class and handle of any window?

Archives Forums/BlitzPlus Programming/Get the class and handle of any window?

Idiot(Posted 2004) [#1]
A buddy of mine works at a call center and wants this machine they have to auto-swap cleanly between a few different programs. I figured it would be easy with Blitz+, but not without the window class and handle. I can find these with Spy++ but he doesn't have access to that. Is there anyway for blitz to figure this out?

The only thing I can find only is this terribly written incomprehensible post:

"hell ya it can be done.

you can make CWnds for windows that arnt even in your app. ive done it.

I wanted to make an app that would push key strokes at a dumb terminal emulator..

so stop how would you go bout this. well the way i use lifted a page from Spy++. i let you drag an icon to a window. then i got the hwnd to that window. note its not even in my app. its anyones window. then i constructed a CWnd object round the hwnd. now you got all of CWnds functionality. i sent keyboard messages via CWnd:ostmessage.

note that this is phat i didnt need that but i dint know it at the time. you can just use the APIs postmessage after you have the hwnd."

While I do note that this is "phat," I don't know what exactly he did or if it's possible in Blitz. If I could write or find a program I could give him that woudl check what classes and handles these windows have, I could write the app he needs.


Eikon(Posted 2004) [#2]
You can try this program of mine I found collecting dust somewhere

http://s93151849.onlinehome.us/allwin.exe

The format is Class | hWnd | Title.

Once you know that you can use FindWindow(class$, title$) from blitz.