Finding Window Handle..

jyc's Avatar, Join Date: May 2009
Newbie Member
Hello there,

I'm new here ! Hello! I'm a student currenlty working on a project (Very rushed) in C++ (i only had JAVA and command-line C programming experience..) Excuse me if the following question sounds trivial, I really need URGENT HELP! Many thanks in advance.

The only window created in my program uses DialogBoxIndirectParam. Is there anyway I can point the WSAAsyncSelect method to send messages to the DialogBox? Following are snippets of the code:

CPP / C++ / C Code:
DialogBoxIndirectParam (GetModuleHandle (0), &t, 0, (DLGPROC)EditorProc, (LPARAM)effect);
WSAAsyncSelect (ListenSocket, FindWindow(NULL, "Editor") , 1000, (FD_ACCEPT | FD_CONNECT | FD_READ | FD_CLOSE));

And the CALLBACK method:

CPP / C++ / C Code:
INT_PTR CALLBACK EditorProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

Basically, I want EditorProc to handle both the dialog loop and the it possible?

Many thanks!

shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Why do you want to use WSAAsyncSelect to send the messages. I would suggest Use Either SendMessage / PostMessage API to do it.