StrokesPlus.net教程及脚本持续更新

当前窗口信息

显示窗口程序名,标题,类,句柄等,点确定,选中条目结果复制到剪切板

// VARIABLES
    var w_exe = sp.ForegroundWindow().Process.ProcessName;
    var w_title = sp.ForegroundWindow().Title;
    var w_class = sp.ForegroundWindow().ClassName;
    var w_HWnd = sp.ForegroundWindow().HWnd.ToString();
    //var w_handle = action.Window.Process.Handle.ToString();
    var w_id = sp.ForegroundWindow().Process.Id;

// TITLES
    var txt_exe = "Exe:       ";
    var txt_title = "Title:      ";
    var txt_class = "Class:     ";
    var txt_HWnd = "HWnd:   ";
    var txt_id = "Id:          ";

// INPUT BOX
    var inputBoxInfo = new InputBoxInfo();
    inputBoxInfo.Title = "Window Info";
    inputBoxInfo.Message = "Choose parameters:";

// ITEMS
    inputBoxInfo.Items.Add(txt_exe+w_exe);
    inputBoxInfo.Items.Add(txt_title+w_title);
    inputBoxInfo.Items.Add(txt_class+w_class);
    inputBoxInfo.Items.Add(txt_HWnd+w_HWnd);
    inputBoxInfo.Items.Add(txt_id+w_id);

// SELECT ITEM AND COPY TO CLIP
    inputBoxInfo.SelectedValue = txt_exe+w_exe;
    var res = sp.InputBox(inputBoxInfo);
    if(res != null)
    {
        if(res.startsWith(txt_exe) == true)                res = w_exe;
        else if(res.startsWith(txt_title) == true)     res = w_title;
        else if(res.startsWith(txt_class) == true)     res = w_class;
        else if(res.startsWith(txt_HWnd) == true)       res = w_HWnd;
        else if(res.startsWith(txt_id) == true)          res = w_id + ""; // simple conversion into a string by adding an empty string
        clip.SetText(res)
    }
1 Like