1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Finding Window Handle..

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

  1. jyc

    jyc New Member

    Joined:
    May 4, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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!

    Jyc.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    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