我在各位高手的指点下已经能够用findwindow()找到我要的程序.现有两个问题.1,我手里有一个程序,但是它的窗口标题老自动在变,怎么用hwnd = FindWindow(vbNullString, "****")找得到它啊?
2,它是一个有子窗口的程序,它的子窗口标题也在变,我怎么找得到这个子窗口,并且操作它?
在线急等

解决方案 »

  1.   

    看看我的这个贴,不知道能不能帮到你
    http://community.csdn.net/Expert/topic/4538/4538959.xml?temp=.7043115
      

  2.   

    是局部变还是全部变????如果是局部变则不用findwindow而用enumnwindows列举所有顶级窗口标题来判断如果是全部变而且没有规律就要想其他办法了。。
      

  3.   

    Finally, use EnumWindows. The window enumerator function uses GetWindowText to get each window's title. If the title matches the target window name, then it has found the target. This is the most complex method but also the most flexible. For example, you could look for a window when you know only part of its title or you could take action on all windows with the same or similar titles. http://www.vb-helper.com/howto_find_window_three_ways.html