- This topic has 24 replies, 7 voices, and was last updated 14 years ago by Admin.
-
AuthorPosts
-
June 7, 2007 at 10:14 pm #187858autopilotMember
In this project, I check the version of pal that is installed and then am able to set up variables based on the version. It does not use ATL so it does not need to be updated with every update of the Pal client.
Take it, use it, change it as you see fit.
autopilot
June 7, 2007 at 11:00 pm #187882AdminAdministratorman ya like readin peeps mind, i was gona try ya code for the new funtext update 🙂
Thanks ya made it a lot easier for me 🙂November 22, 2007 at 10:13 pm #187881intercepter_3MemberThis is awsome.
I am slightly confused as to how to take one step back in the index and get the chat window so can read text. Any suggestions?
November 23, 2007 at 1:15 am #187880ChikeMemberI have found that the text window has unique attributes that identify it.
It is the only RichEdit20A class that is visible, has no OleDrop propertirs, and has WS_EX_NOPARENTNOTIFY extended style.My code in C (sould be easy to port to basic) look like this:
static BOOL CALLBACK EnomRoomTextProps(HWND hwnd, LPCTSTR szProp, HANDLE) { char atom_name[64]; //OleDropTargetInterface //OleDropTargetMarshalHwnd if (is_atom(szProp)) { ATOM atom = LOWORD(szProp); if (!GetAtomName(atom, atom_name, sizeof(atom_name))) return FALSE; szProp = atom_name; } if (!strncmp(szProp, "OleDrop", 7)) { SetLastError(0); return FALSE; } return TRUE; } static BOOL CALLBACK FindRoomTextProc(HWND hwnd, LPARAM lParam) { TCHAR str[128]; if (RealGetWindowClass(hwnd, str, sizeof(str)) == 0) return TRUE; if (strcmp(str, "RichEdit20A")) return TRUE; if (!IsWindowVisible(hwnd)) return TRUE; if (!EnumProps(hwnd, EnomRoomTextProps)) return TRUE; if ((GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_NOPARENTNOTIFY) == 0) return TRUE; *((HWND *)lParam) = hwnd; SetLastError(0); return FALSE; } //... HWND rich20; if (EnumChildWindows(hwnd, (WNDENUMPROC)FindRoomTextProc, PtrToLong(&rich20)) || GetLastError() != 0) { // could not find room text return; } // do whatever with rich20 here
Note that “failur” of EnumChildWindows actually indicats sucess (combined with GetLastError() return of 0)
For those who have diffuculties reading C:
hwnd is the room HWND, EnumChildWindows get the address of rich20 as lParam to FindRoomTextProc callback.
When the callback identify the window, it puts the hwind in the addres that was sent to it, set last error to zero, and returns false (zero in basic), which cuase the enumeration to “fail”.
If the enumeration succeeds it means it hasn’t found the room text.June 15, 2008 at 12:19 am #187879Girly GirlMemberChike 😳
nice and gentel
can u update the source and add ( text size & text color ) coz the send text its same size and color 😀June 15, 2008 at 6:16 am #187878StringMemberOne way might be, to add a richtextbox control to your project. Style the text within as you like and send it.
August 25, 2008 at 9:48 pm #187877autopilotMemberHere is an update…
Pal 9.4 and up, we had to switch how we found the handle of the control.August 26, 2008 at 12:29 pm #187876AdminAdministrator🙂 let me check this out ehheh 😀
Hey in your opinion will it be an easy update for the programs, I am lzy asz hell cause of school starting now heheheAugust 26, 2008 at 3:38 pm #187875autopilotMember@Admin wrote:
I am lzy asz hell cause of school starting now hehehe
whatcha mean… “cause school starting”? That aint why yer lazy!!!!!!!!!!! hehehehe
pm me the a1 code for one of the apps and I will update it to a2 (fix it)… then you can see the change and update the other a1 apps 👿
February 17, 2009 at 7:28 pm #187874intercepter_3Member@autopilot wrote:
Here is an update…
Pal 9.4 and up, we had to switch how we found the handle of the control.Autopilot,
Finally getting around to using this code. And I am having one problem. I am getting an error message.
This is where I get the error:
Private Function getSubForm(ByVal hWnd As Long, _
ByVal TargetSubClass As String, _
ByVal TargetSubClassIndex As Integer) As Long
'set variables in module
mParentHnd = hWnd
mTargetSubClass = TargetSubClass
mTargetSubClassIndex = TargetSubClassIndex
'set variables for EnumWindows function
Dim lRet As Long
Dim lParam As Long
'Enum sub windows to get hnd for target
lRet = FindSubWindsWithwHnd
'return target hnd
getSubForm = mSubFormHnd
End FunctionI get a Compile error “Expected Function or Variable” and it highlights FindSubWindsWithwHnd
When I go to that function, it is just declared as a sub. I am just using your sample project to get familiar with your changes for 9.4 of pal and up.
Is there something I am missing here?
I have vb6 and am on a 9.5 ver of pal.
February 17, 2009 at 10:19 pm #187873intercepter_3MemberAnd I got that to work just fine by changing it to a public function and it works like a charm.
Anyone have any ideas on the autopilot method to get text?
I did a search and could not find anything.
February 17, 2009 at 11:17 pm #187872StringMemberBasically the same way you send it.
Note the following function in your example from autopilot.Private Function ReadTextHnd
This gives you the room text handle. You can then write a function to get the last line of text or whatever you need.
You could easily write your own “get room text” function, or you can find an example in loco’s AdminBot source.February 19, 2009 at 6:21 am #187871autopilotMemberstring you handle the gerber like an expert 🙂
February 19, 2009 at 6:42 am #187870StringMemberWell, the strained peaches were always my favorite 🙂
April 2, 2009 at 11:27 pm #187869methodMember@intercepter_3 wrote:
And I got that to work just fine by changing it to a public function and it works like a charm.
Anyone have any ideas on the autopilot method to get text?
I did a search and could not find anything.
intercepter can tell me how you made autopilot code work. I tried it with paltalk 9.6 build 313 and i get same error. Did you manage to read last line from the rooom too ? Looking forward for your reply.Thanks
-
AuthorPosts
Related
- You must be logged in to reply to this topic.