1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Finding Window Handle..

Discussion in 'C' started by jyc, May 4, 2009.

  1. jyc

    jyc New 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 Sockets..is it possible?

    Many thanks!

  2. shabbir

    shabbir Administrator Staff Member

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

Share This Page