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
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... :ehh:
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:
Dim parent As Long, Child1 As Long, Child2 As Long
Dim Child3 As Long, Child4 As Long, Child5 As Long
Dim child6 As Long, child7 As Long, child8 As Long
parent& = FindWindow("AIM_IMessage", vbNullString)
call postmessage(parent, wm_keydown, vbaltmask, 0&)
call postmessagE(parent, wm_keydown, vbkeyk, 0&)
call postmessage(parent, wm_keyup, vbaltmask, 0&)
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)
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.
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?
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
Re: Please help me...im having some trouble. [not resolved]
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
Re: Please help me...im having some trouble. [not resolved]