• 自动化ui 保存max场景信息 结构化处理比较好用


    struct  gt_cl_hp_saveMaxinfo (
        pathpp ="" ,
     fn savemaxinfor  =(
        
        DialogMonitorOPS.unRegisterNotification id:#gtMMOscenceEqualname 
        function callSummaryEqualname  = (
            ---收集window句柄
            windowHandle = DialogMonitorOPS.GetWindowHandle()
            windowName = (UIAccessor.GetWindowText  windowHandle) as String 
            
            ----从窗口中找到我想要的窗口的按钮的名称
                if (findstring  windowName  "save file as")!=undefined then (
                    ---- 找到主窗口子控件的名称
                    
                    chwindow = UIAccessor.GetChildWindows windowHandle 
                    if chwindow !=undefined  then (
                        for  i in 1 to  chwindow.count do (
                            if (chwindow[i] !=0) then (
                                kjName = (UIAccessor.GetWindowText (chwindow [i]) as String )
                                --- 保存配置 按下配置按钮
                                --print kjName 
                                if kjName  == "是(&Y)" then (
                                    --UIAccessor.PressButtonByName WindowHandle kjName 
                                    --- 应该不错的话需要在一层监控
                                    UIAccessor.PressButtonByName WindowHandle kjName
                                )
                            )
                        )
                    )
                    --print (UIAccessor.GetWindowText (chwindow [i]) as String 
                )
                
            false
        
        )
        
     
        DialogMonitorOPS.unRegisterNotification id:#gtMMOscenceone 
        function callSummaryonw = (
            ---收集window句柄
            windowHandle = DialogMonitorOPS.GetWindowHandle()
            windowName = (UIAccessor.GetWindowText  windowHandle) as String 
            
            ----从窗口中找到我想要的窗口的按钮的名称
                if (findstring  windowName  "Save File As")!=undefined then
                 (
                    ---- 找到主窗口子控件的名称
                    
                    chwindow = UIAccessor.GetChildWindows windowHandle 
                    --print (windowName +"*****ceshi")
                    if chwindow !=undefined  then (
                        for  i in 1 to  chwindow.count do (
                            if (chwindow[i] !=0) then (
                                kjName = (UIAccessor.GetWindowClassName chwindow[i])
                                --- 保存配置 按下配置按钮
                                --print kjName 
                                findHandle =0
                                if kjName  == "ComboBoxEx32"then (
                                    findHandle = chwindow[i]
                                    ---- 给手柄设置要保存的信息 
                                    savepath =pathpp ---+"\maxinfo"
                                    if (getDirectories savepath).count ==0 then (
                                        ---没有路径创建路径
                                        makeDir savepath     
                                    )    
                                    savepath += "\"+ (getFilenameFile maxfilename)+".txt"
                                    if findHandle  != 0 then (
                                    UIAccessor.SetWindowText findHandle   savepath 
                                    UIAccessor.PressButtonByName WindowHandle "保存(&S)"
                                    
                                    )
                                    --- 应该不错的话需要在一层监控
                                    ---UIAccessor.PressButtonByName WindowHandle kjName
                                )
                            )
                        )
                    )
                    --print (UIAccessor.GetWindowText (chwindow [i]) as String 
                )
                
            
            false ---- 这里应该是最后不返回操作,可以继续的添加钩子 
        
        )
        
        
        
        -----------------------------------------------------------------------
        DialogMonitorOPS.unRegisterNotification id:#gtMMOscence 
        
        function callSummary = (
            ---收集window句柄
            windowHandle = DialogMonitorOPS.GetWindowHandle()
            windowName = (UIAccessor.GetWindowText  windowHandle) as String 
            
            ----从窗口中找到我想要的窗口的按钮的名称
                if (findstring  windowName  "summary Info")!=undefined then (
                    ---- 找到主窗口子控件的名称
                    
                    chwindow = UIAccessor.GetChildWindows windowHandle 
                    if chwindow !=undefined  then (
                        for  i in 1 to  chwindow.count do (
                            if (chwindow[i] !=0) then (
                                kjName = (UIAccessor.GetWindowText (chwindow [i]) as String )
                                --- 保存配置 按下配置按钮
                                if kjName  == "Save to File..." then (
                                    --UIAccessor.PressButtonByName WindowHandle kjName 
                                    --- 应该不错的话需要在一层监控
                                    UIAccessor.PressButtonByName WindowHandle kjName
                                    UIAccessor.PressButtonByName WindowHandle "Ok"
                                )
                            )
                        )
                    )
                    --print (UIAccessor.GetWindowText (chwindow [i]) as String 
        
                )
                
            
            true 
        
        )
        DialogMonitorOPS.RegisterNotification callSummaryonw  id:#gtMMOscenceone 
        DialogMonitorOPS.RegisterNotification callSummaryEqualname  id:#gtMMOscenceEqualname 
        DialogMonitorOPS.RegisterNotification callSummary  id:#gtMMOscence 
    
        
        
        DialogMonitorOPS.Enabled = true 
        max file summary
        
        
        DialogMonitorOPS.Enabled = false 
        DialogMonitorOPS.unRegisterNotification id:#gtMMOscence 
        DialogMonitorOPS.unRegisterNotification id:#gtMMOscenceone 
        DialogMonitorOPS.unRegisterNotification id:#gtMMOscenceEqualname 
    )
    )---end struct 
    
    
    op = gt_cl_hp_saveMaxinfo()
    op.pathpp = "D:pyc-toolsms\newdatemaxinfo"
    op.savemaxinfor()
  • 相关阅读:
    MySQL字符串相加函数如何运行?似曾相识还是记一笔吧
    JQuery使用getJSON跨域调用数据
    匹配中文字符的正则表达式
    php中删除超链接的正则表达式
    win2003系统+IIS6下,经常出现w3wp.exe和sqlserver.exe的内存占用居高不下
    如何添加修改uchome创始人
    JS中Null与Undefined的区别
    错误分析及解决办法MySQL server has gone away
    更改表自动递增值的sql
    mysql如何修改导入数据库文件大小限制
  • 原文地址:https://www.cnblogs.com/gaitian00/p/3535096.html
Copyright © 2020-2023  润新知