Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Finding Window Handle.. (http://www.go4expert.com/forums/finding-window-handle-t17334/)

jyc 5May2009 01:25

Finding Window Handle..
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 Sockets..is it possible?

Many thanks!


shabbir 5May2009 08:40

Re: Finding Window Handle..
Why do you want to use WSAAsyncSelect to send the messages. I would suggest Use Either SendMessage / PostMessage API to do it.

All times are GMT +5.5. The time now is 09:13.