Skip to content

help me getting a specific control (using api)

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #190993
    nooob
    Member

    hi to all
    thanks to you guys and loco buddy who gave an insight into another world – the world of api thingy 😛

    encouraged by you guys – i am trying to make a paltalk program that does the following:

    Condition: a user has admin rights in a room, but does not want to be admin all the time. so when this user joins that room – the program asks for the room owner name and admin code (the user joins the room as a normal user ). now if the this user wants to bounce someone, he just clicks the “Bounce” button and the program takes the following steps:

    1 – exits the room [here i get the caption of the room for re-joining the room]
    2- joins the this user as admin
    3- bounces the selected user
    4- exists the room again
    5- joins the room again as a normal user

    my problem: when the admin bounces the user and comes back again, the program clicks on the following submenu:
    Actions -> Join a Chat Room
    so the Rooms List window appears…now i want to search that room by putting the caption of the room into the search textfield and clicking the Go button and then when the room is found i want to join it by clicking the Join button on the same Rooms List window…BU I FAIL TO DO SO

    HEL ME OUT…GUYS
    thanks

    noob[/b]

    #191001
    method
    Member

    upload u app so we look at it !

    #191000
    nooob
    Member

    method..dude..its only half of the code that i have written so far – when i am done with it i will upload it

    what i want you guys to help me with is:
    -how to get handles of the searchfield (and finally set a string to it), Go and Join buttons on the Rooms List window, which is opened by:
    Actions -> Join a Chat Room

    HELP 😥

    nooob

    #190999
    Ponies
    Member

    erm. reshack?

    #190998

    I dont have code in vb6 but here is the code in visual c++

    first to display the room search do this

    HWND parent =::FindWindow(“SEINFELD_SUPERMAN”,NULL);
    ::PostMessage(parent, WM_COMMAND,(WPARAM) 32834,(LPARAM) 0);
    Sleep(100); //here let the time room dialog search list to be loaded

    HWND WTL_SplitterWindow,hdlg,hedit,button;
    HWND parent =::FindWindow(“ATL:0053D390”,NULL);
    WTL_SplitterWindow=::FindWindowEx(parent,0,”WTL_SplitterWindow”,NULL);
    WTL_SplitterWindow=::FindWindowEx(WTL_SplitterWindow,0,”WTL_SplitterWindow”,NULL);
    WTL_SplitterWindow=::FindWindowEx(WTL_SplitterWindow,0,”WTL_SplitterWindow”,NULL);
    hdlg=::FindWindowEx(WTL_SplitterWindow,0,”#32770″,NULL);
    hedit=::FindWindowEx(hdlg,0,”Edit”,NULL); //here is the search field
    button=::FindWindowEx(hdlg,0,”Button”,NULL); //here is the button go

    //here simulate mouse down mouse up before send room name to field search room
    ::SendMessage((HWND)hedit,WM_LBUTTONDOWN,1,1);
    ::SendMessage((HWND)hedit,WM_LBUTTONUP,1,1);

    Sleep(100);
    ::SendMessage(hedit,WM_SETTEXT,(WPARAM)0,(LPARAM)”myroom”);

    //here simulate mouse down mouse up on button go
    ::SendMessage((HWND)button,WM_LBUTTONDOWN,1,1);
    ::SendMessage((HWND)button,WM_LBUTTONUP,1,1);

    like method said, we dont know what is your code, so we cannot guessing. u can convert that code to your vb6 code. I get sick with vb6 so i dont code with vb6 or vbnet no more 😆

    #190997
    nooob
    Member

    nanomachine…ty that was a great help..coz i was on a complete wrong track lol

    just to see if i could click the Go button – i have this code (with ur help):

    pwh = FindWindow("seinfeld_superman", vbNullString)
    PostMessage pwh, WM_COMMAND, 32834, 0& 'Join a Chat Room


    pwh = FindWindow("ATL:0053D390", vbNullString)
    wtlsplitterwindow = FindWindowEx(pwh, 0&, "WTL_SplitterWindow", vbNullString)
    wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "WTL_SplitterWindow", vbNullString)
    wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "WTL_SplitterWindow", vbNullString)

    hdlg = FindWindowEx(wtlsplitterwindow, 0, "#32770", vbNullString)
    hedit = FindWindowEx(hdlg, 0, "Edit", vbNullString) 'serach field
    button = FindWindowEx(hdlg, 0, "Button", "Go") ' button go


    Call SendMessageLong(button, WM_KEYDOWN, VK_SPACE, 0&)
    Call SendMessageLong(button, WM_KEYUP, VK_SPACE, 0&)

    but the button does not get clicked….:shock:
    CAN U SEE WHATS WRONG WITH IT

    ty for ur time

    nooob

    #190996

    here is my example onclicked on that button

    /here simulate mouse down mouse up on button go
    ::SendMessage((HWND)button,WM_LBUTTONDOWN,1,1);
    ::SendMessage((HWND)button,WM_LBUTTONUP,1,1);

    send message mousedown mouseup to that button and the two last parameters 1,1 are the pos x,y of the mouse on that button. I dont try with vb but maybe someone here has tried it. let see if someone has done it. loco maybe…

    bwt do you find the correct button handle.

    #190995
    nooob
    Member

    nanomachine….i think thats the problem i.e. maybe my handle of the button isn’t correct …

    using the same call i.e. :
    Call SendMessageLong(button, WM_KEYDOWN, VK_SPACE, 0&)
    Call SendMessageLong(button, WM_KEYUP, VK_SPACE, 0&)

    …works for another button.

    come on vb gurus….HELP ME

    nanomachine…ty once again .. 🙂

    where is loco…lol

    nooob

    #190994
    autopilot
    Member

    @nooob wrote:

    using the same call i.e. :
    Call SendMessageLong(button, WM_KEYDOWN, VK_SPACE, 0&)
    Call SendMessageLong(button, WM_KEYUP, VK_SPACE, 0&)

    i use this in VB2005:

    Dim status as Integer
    status = SendMessage(button, WM_KEYDOWN, VK_SPACE, 0)
    status = SendMessage(button, WM_KEYUP, VK_SPACE, 0)

    But this is like you said, used for a different button (but you would think that it would work for the button you want as long as you get “button” to equel the correct handle).

    autopilot

    edit: didn’t notice date on post… lmao

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.