Over on im-integrations.com we have been looking at ways to find the paltalk controls more reliably and that won’t need to be updated every time they release a new version of paltalk. What we have come up with is using the Win32API WindowFromPoint and scanning the window bottom to top for the desired control.
Above it shows grid lines (spacing not to scale) over the window that I am referring to as SearchQuadrants. The idea is that you pick 1 of the lines that passes through the control you want and then use it to find the control. So for the bottom to top scan I will demo, we have 5 SearchQuadrants:
1 = Left + 10
2 = Left + 1/4 window width
3 = Center
4 = Right – 1/4 window width
5 = Right – 10
So unless the Paltalk interface gets a drastic remake, we can use the following SearchQuadrants and indexs.
SendTextSearchQuadrant = 2
ReadTextSearchQuadrant = 2
NicListSearchQuadrant = 5
SendTextIndex = 1
ReadTextIndex = 2
NicListIndex = 1
@NVYE wrote:
A lot of those still using VB6 are using direct mapping (parent – child) of controls to find the send text and read text windows as well as the nic list. The problem with the direct mapping is that ever since some time in Pal9 black nicks have a different map then paid nics. It also looked like in Pal 10, they were starting to have different maps for black rooms verses paid rooms.
This was making a lot of problems for people to find the control handles reliably. So rather than enum all the controls in the pal room window, i found a way to find the controls by checking the window in a line. So if the line passes through the control, then you can use it to find the control.
You can see the original VB2010 code over on im-integrations.com
I have no idea what you’re trying to do … but it looks like you have done some hard-work here.
Look at the code NVYE. It eliminates all the searching for index(s) and does all the work for you. Quite revolutionary IMO.
The app just needs a single button and the following code: