- This topic has 9 replies, 3 voices, and was last updated 11 years ago by Chike.
-
AuthorPosts
-
January 18, 2013 at 11:48 am #186689light 2012Member
happy new year
January 18, 2013 at 8:20 pm #186698ChikeMemberA bit on that no?
January 19, 2013 at 3:21 am #186697light 2012MemberI don’t understand Chike :(!
What is wrong with this code? plz
Function NickGet() Dim dlggroupchatwindowclass As Long, splitterwindowex As Long, classcpanecontainerex As Long Dim atlaae As Long, atlaaed As Long, syslistview As Long dlggroupchatwindowclass = FindWindow("dlggroupchat window class", Form1.Combo1.Text) splitterwindowex = FindWindowEx(dlggroupchatwindowclass, 0&, "splitterwindowex", vbNullString) splitterwindowex = FindWindowEx(splitterwindowex, 0&, "splitterwindowex", vbNullString) splitterwindowex = FindWindowEx(splitterwindowex, 0&, "splitterwindowex", vbNullString) splitterwindowex = FindWindowEx(splitterwindowex, 0&, "splitterwindowex", vbNullString) splitterwindowex = FindWindowEx(splitterwindowex, 0&, "splitterwindowex", vbNullString) classcpanecontainerex = FindWindowEx(splitterwindowex, 0&, "classcpanecontainerex", vbNullString) classcpanecontainerex = FindWindowEx(splitterwindowex, classcpanecontainerex, "classcpanecontainerex", vbNullString) atlaae = FindWindowEx(classcpanecontainerex, 0&, "atl:00a1ae40", vbNullString) atlaaed = FindWindowEx(atlaae, 0&, "atl:00a1aed0", vbNullString) atlaaed = GetWindow(atlaaed, GW_CHILD) syslistview = FindWindowEx(atlaaed, 0&, "syslistview32", vbNullString) Call GetListviewItem(syslistview) End Function
January 19, 2013 at 3:29 am #186696ChikeMemberYou have a debugger? Use it.
January 19, 2013 at 3:42 am #186695light 2012MemberWhat do you mean debugger?
January 19, 2013 at 3:59 am #186694ChikeMemberYour IDE wether its VB6 or VB.NET has an integrated debugger.
You set a breakpoint where you want the program to stop execution and examin variables, and then you can walk by steps each line untill you find where the problem is.If you are looking for syslistview42 a much better way to look for it is with EnumChildWindows.
Since it’s there is only one window with this class its very easy to find.January 19, 2013 at 8:39 am #186693light 2012Memberi know ,but this code don’t work with pal build 485
Private Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As String) As Long Dim strCaption As String Dim lLen As Long Dim syslistview As Long, cwndmembertree As Long Dim dlggroupchatwindowclass As Long, splitterwindowex As Long, classcpanecontainerex As Long Dim atlaae As Long, atlaaed As Long dlggroupchatwindowclass = FindWindow("dlggroupchat window class", Form1.Combo1.Text) splitterwindowex = FindWindowEx(dlggroupchatwindowclass, 0&, "splitterwindowex", vbNullString) splitterwindowex = FindWindowEx(splitterwindowex, 0&, "splitterwindowex", vbNullString) splitterwindowex = FindWindowEx(splitterwindowex, 0&, "splitterwindowex", vbNullString) splitterwindowex = FindWindowEx(splitterwindowex, 0&, "splitterwindowex", vbNullString) splitterwindowex = FindWindowEx(splitterwindowex, 0&, "splitterwindowex", vbNullString) classcpanecontainerex = FindWindowEx(splitterwindowex, 0&, "classcpanecontainerex", vbNullString) classcpanecontainerex = FindWindowEx(splitterwindowex, classcpanecontainerex, "classcpanecontainerex", vbNullString) atlaae = FindWindowEx(classcpanecontainerex, 0&, "atl:00a1ae40", vbNullString) atlaaed = FindWindowEx(atlaae, 0&, "atl:00a1aed0", vbNullString) hWndlvw = FindWindowEx(atlaaed, 0&, "syslistview32", vbNullString) ' If we've found a window with the SysListView32 class ' check to see if parent window caption is the one we are looking for If hWndlvw 0 Then lLen = GetWindowTextLength(hwnd) If lLen > 0 Then strCaption = Space(lLen) GetWindowText hwnd, strCaption, lLen + 1 End If End If EnumWindowsProc = (hWndlvw = 0 And strCaption lParam) End Function
January 19, 2013 at 10:32 am #186692StringMember@light 2012 wrote:
What is wrong with this code? plz
If you have a programming question, start a new thread in the programming section.
January 19, 2013 at 1:14 pm #186691ChikeMemberHe did, just was no programing question in it when he first posted, i’ll move it back.
And that code doesn’t work for the same reason the first one doesn’t, they both depend on the order and arrangment of child windows.
EnumWindoesProc function should not have FindWindow or FindWindowEx in it at all.
All you need to do is
a. find the room window
b. enumerate child windows, stop enumeration when windows class SysListView32 is found, oe not.The EnumChildProc should pass the window handle via the lParam (should be address of a pointer), don’t use global variables.
January 20, 2013 at 3:12 pm #186690 -
AuthorPosts
Related
- You must be logged in to reply to this topic.