I want to make a telnet console program like the one that comes with win2000 but to use WSAAsyncSelect you need a handle to a window to that receives messages telling it when there is data to read from a socket. is there any way around this?
Posted on 2000-12-27 16:02:00 by Satrukaan
A windows app might be defined as one you didn't define with a console window, ie, any windows app may also have a console. I use this trick all the time for debugging. There is also nothing keeping you from creating a window inside a console app to receive messages. You'll probably want to keep it invisible, but its message loop and hwnd will still be quite valid. Mind you, I do not know nor care about sockets. There may be another windowless callback method available without the overhead of creating the window.
Posted on 2000-12-27 17:24:00 by Ernie
I thought about sticking in a window in the console application but I'm worried about what extra messages I would have to handle along side it. Would the invisible window get keyboard messages that I want my console to get? I figured there must be a way of creating a procedure that only gets socket messages.
Posted on 2000-12-27 17:40:00 by Satrukaan
Yes there is a method of using an winsock callback instead of a windows message loop. Mind you I've never done it, but I've read it in the documentaion... take look through your documentation for a winsock callback routine... Good luck! See ya, Ben
Posted on 2000-12-28 00:58:00 by cyberben
The only way the invisible window can get the keyboard messages is if it has focus, and it ain't gettin that while it's invisible. It will do just what you need. However, if as Satrukaan noted, if there is a windowless callback API, that is preferable (less sys resources needed)
Posted on 2000-12-29 14:04:00 by Ernie