<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Two questions about Project Panel and Docked Windows]]></title><description><![CDATA[<p dir="auto">Hi all!</p>
<p dir="auto">Maybe I overlooked something, but I don’t seem to find answers to the following dev questions:</p>
<ol>
<li>
<p dir="auto">The Project Panel / Folder as Workspace.<br />
How can a plugin retrieve the root path to the workspace files?<br />
For an example of what it might be needed for, please look at this feature request:<br />
<a href="https://github.com/d0vgan/nppexec/issues/15" rel="nofollow ugc">https://github.com/d0vgan/nppexec/issues/15</a></p>
</li>
<li>
<p dir="auto">The Docked Panels (Windows) switching/activating.<br />
How can one programmatically activate/switch to a desired docked panel/window?<br />
For an example of what it might be needed for, please look at this feature request:<br />
<a href="https://github.com/d0vgan/nppexec/issues/17" rel="nofollow ugc">https://github.com/d0vgan/nppexec/issues/17</a></p>
</li>
</ol>
<p dir="auto">Thanks,<br />
DV.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18817/two-questions-about-project-panel-and-docked-windows</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 15:02:22 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18817.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Jan 2020 19:28:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Two questions about Project Panel and Docked Windows on Wed, 05 Feb 2020 18:33:34 GMT]]></title><description><![CDATA[<p dir="auto">Thank you, I’ll try it!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/50349</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/50349</guid><dc:creator><![CDATA[Vitalii Dovgan]]></dc:creator><pubDate>Wed, 05 Feb 2020 18:33:34 GMT</pubDate></item><item><title><![CDATA[Reply to Two questions about Project Panel and Docked Windows on Tue, 28 Jan 2020 13:12:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vitalii-dovgan" aria-label="Profile: Vitalii-Dovgan">@<bdi>Vitalii-Dovgan</bdi></a></p>
<p dir="auto">I had some time to do a little experiment and it looks like<br />
you can use something similar like the python scripts I’ve used.</p>
<p dir="auto">to get the path for each root node from File Browser:</p>
<pre><code>def enum_root_pathes(hwnd, lParam):
    if gui.IsWindowVisible(hwnd):
        name = gui.GetWindowText(hwnd)
        if name == 'File Browser':
            h_systreeview32 = gui.FindWindowEx(hwnd, None , 'SysTreeView32', None)
            if h_systreeview32:
                root_nodes = []
                
                hNode = gui.SendMessage(h_systreeview32,
                                        com.TVM_GETNEXTITEM,
                                        com.TVGN_ROOT,
                                        0)
                while hNode:
                    root_nodes.append(hNode)
                    nextNode = gui.SendMessage(h_systreeview32,
                                               com.TVM_GETNEXTITEM,
                                               com.TVGN_NEXT,
                                               hNode)
                    hNode = nextNode

                for node in root_nodes:
                    tvitem, extras = gui_struct.EmptyTVITEM(node)
                    res = gui.SendMessage(h_systreeview32,
                                          com.TVM_GETITEMW,
                                          0,
                                          tvitem)
                    if res:
                        _, _, _, _, _, _, _, param = gui_struct.UnpackTVITEM(tvitem)                
                        x = ctypes.c_wchar_p.from_address(param)
                        print(ctypes.wstring_at(x))
                return
    return True
gui.EnumChildWindows(notepad.hwnd, enum_root_pathes, None)
</code></pre>
<p dir="auto">To switch to a know/active tab in a docked dialog</p>
<pre><code>NPPM_DMMVIEWOTHERTAB = 1024+1000+35
gui.SendMessage(notepad.hwnd,
                NPPM_DMMVIEWOTHERTAB,
                0, 
                'Python',)
</code></pre>
<p dir="auto">to enumerate the current open tabs of docked dialogs,<br />
I had only partial success. It looks like either the docking manager<br />
corrupts the tab structure, there is a bug in SysTabControl or, likely,<br />
I haven’t understood how to use it correctly.</p>
<pre><code>def enum_tabs(hwnd, lParam):
    if gui.IsWindowVisible(hwnd):
        window_name = gui.GetWindowText(hwnd)
        # class_name = gui.GetClassName(hwnd)
        # if class_name != 'Scintilla':
            # print(window_name, class_name)
        if window_name == 'Tab1':
            open_tabs = gui.SendMessage(hwnd, com.TCM_GETITEMCOUNT, 0,0)
            for i in range(open_tabs):
                # tcitem, extras = create_TCITEM_structure()
                tcitem, extras = create_TCITEMHEADER_structure()
                # res = gui.SendMessage(hwnd, com.TCM_SETCURSEL, i, 0) 
                # print('res', res)
                res = gui.SendMessage(hwnd, com.TCM_GETITEMW, i, tcitem)
                if res:
                    _, _, _, pszText, _, _, = struct.unpack('IiiPii', tcitem)
                    print(i, gui.PyGetString(pszText))
            return
    return True

gui.EnumChildWindows(notepad.hwnd, enum_tabs, None)
</code></pre>
<p dir="auto">This correctly identifies the number of tabs used but it only reports<br />
the tab caption for the last dialog attached to the tab control.<br />
Maybe helpful anyway.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/50122</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/50122</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 28 Jan 2020 13:12:22 GMT</pubDate></item><item><title><![CDATA[Reply to Two questions about Project Panel and Docked Windows on Mon, 27 Jan 2020 20:04:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vitalii-dovgan" aria-label="Profile: Vitalii-Dovgan">@<bdi>Vitalii-Dovgan</bdi></a></p>
<p dir="auto">there is no builtin npp message which can be used but for</p>
<ol>
<li>enumerate the child windows for <code>File Browser</code> and then find its SysTreeView32 and us TVM messages to get the needed information<br />
and for</li>
<li>should be the same, enumerate to find your console window and get its associated systabcontrol …</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/50112</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/50112</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 27 Jan 2020 20:04:24 GMT</pubDate></item></channel></rss>