Results 1 to 9 of 9

Thread: Please help me...im having some trouble. [not resolved]

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    26

    Please help me...im having some trouble. [not resolved]

    Hello...

    I have recently been trying to send the keys alt+k to my AIM instant message window...Im not quite sure if im going about this correct, so im not even going to bother posting the code I already have.
    I switched to trying do this from trying to click a button in the IM window...I had no success..i tried for at least a week...For some reason the api would not pick up the buttons....

    The name for the im window is "AIM_IMessage"...Im pretty sure I could somehow send the keys to it and have it do what its supposed to do (block the person)....vbaltmask? I tried it, Im doing SOMETHING wrong...Any Ideas?


    Please help!

    Mitch
    Last edited by DeathDay; Feb 3rd, 2005 at 12:06 PM.

  2. #2
    Lively Member
    Join Date
    Jan 2005
    Posts
    76

    Re: Please help me...im having some trouble.

    That sounded extremely scattered...could you be more specific? Clicking buttons is easy though. Findwindow and Findwindowex then postmessage using the VK_space. I think that is all the API's you need. Read up on that stuff and I think you might have a better clue of whatever you were talking about...

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    26

    Re: Please help me...im having some trouble.

    Sorry...lol...im extremely tired and frustrated...the thing is i know how postmessage, findwindow, findwindowex work...but they just wont do it like i want them to


    This is how i thought it wuld work:

    VB Code:
    1. Dim parent As Long, Child1 As Long, Child2 As Long
    2.  Dim Child3 As Long, Child4 As Long, Child5 As Long
    3.  Dim child6 As Long, child7 As Long, child8 As Long
    4.  
    5.     parent& = FindWindow("AIM_IMessage", vbNullString)
    6. call postmessage(parent, wm_keydown, vbaltmask, 0&)
    7. call postmessagE(parent, wm_keydown, vbkeyk, 0&)
    8. call postmessage(parent, wm_keyup, vbaltmask, 0&)
    9. call postmessage(parent, wm_keyup, vbkeyk, 0&)


    Ive tried the same thing with sendmessage and sendmessagelong, neither will work...


    does that help?




    (children are in there bc ive been fooling around with the code so much, i know i odnt need em)
    Last edited by DeathDay; Feb 3rd, 2005 at 11:01 AM.

  4. #4
    Lively Member
    Join Date
    Jan 2005
    Posts
    76

    Re: Please help me...im having some trouble. [not resolved]

    Are you actually getting the correct Hwnd with that findwindow?

    not to mention you didnt use findwindowex and get the handle of the button you want to press. your sending messages to a parent which is like yelling at the side of building that you want the 3rd story window 2nd from the left opened.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    26

    Re: Please help me...im having some trouble. [not resolved]

    Yes, i know im finding the right parent if thats what your asking. I know this since it well press child3 with nearly the same exact code.

    Is the code for pressing the buttons correct?

  6. #6
    Lively Member
    Join Date
    Jan 2005
    Posts
    76

    Re: Please help me...im having some trouble. [not resolved]

    obviously you didnt get it...I dont have aim so i will write a 2 second app to click a button on the calculator and you can make whatever you want from that. gimme a min

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    26

    Re: Please help me...im having some trouble. [not resolved]

    oh ok...sorry obut that.

  8. #8
    Lively Member
    Join Date
    Jan 2005
    Posts
    76

    Re: Please help me...im having some trouble. [not resolved]

    OK no clue and I have to leave...but i would swear this should work...sry bro

    in button on form

    Dim hwnd As Long
    Dim button As Long

    hwnd = FindWindow(vbNullString, "Calculator")
    button = FindWindowEx(hwnd, 0, "Button", "8")

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



    in .bas
    Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long

    Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" ( _
    ByVal hWnd1 As Long, _
    ByVal hWnd2 As Long, _
    ByVal lpsz1 As String, _
    ByVal lpsz2 As String) As Long

    Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" ( _
    ByVal hwnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    ByVal lParam As Long) As Long

    Const VK_SPACE As Long = &H20
    Const WM_KEYDOWN As Long = &H100
    Const WM_KEYUP As Long = &H101

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    26

    Re: Please help me...im having some trouble. [not resolved]

    alright, thanks man....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width