StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Yuichi  
#1 Posted : Wednesday, September 19, 2018 9:05:09 AM(UTC)
Yuichi

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 9/13/2018(UTC)
Posts: 44
Poland

Thanks: 14 times
Was thanked: 10 time(s) in 9 post(s)
This script helps in retrieving window information such as:
*exe name
*title name
*class name
*HWnd of a window

Put it in a gesture and do it on the window.
Remember that the script gets data from where you started the gesture.

Code:
// VARIABLES
    var w_exe = action.Window.Process.ProcessName;
    var w_title = action.Window.Title;
    var w_class = action.Window.ClassName;
    var w_HWnd = action.Window.HWnd.ToString();
    //var w_handle = action.Window.Process.Handle.ToString();
    var w_id = action.Window.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)
    }
thanks 1 user thanked Yuichi for this useful post.
Rob on 4/28/2019(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.