<?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[Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot;]]></title><description><![CDATA[<p dir="auto">I use the “Customize Toolbar” plugin to add favorite commands to the toolbar.  One button I’ve added is to split my windows.  The way the plugin works, I define the N++ menu path to the command in the Customize Toolbar config file, along with a 16x16 icon to show on the toolbar i.e. “View,Move/Clone Current Document,Move to Other View,split.bmp”.</p>
<p dir="auto">I now want to add a button to rotate the view between horizontal and vertical.  Unfortunately, those commands (“Rotate to right” and “Rotate to left”) are on the window splitter/grabber, not in the main menu structure.  Is there a menu path or keyboard shortcut to those two rotate commands that I’ve missed somewhere?</p>
<p dir="auto">I’m obviously looking for a single-click rotate, instead of a right-click on the grabber followed by a left click on the rotate command.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18615/shortcut-or-menu-path-to-rotate-to-right-left</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 14:16:04 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18615.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 12 Dec 2019 15:51:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Sun, 24 Nov 2024 07:01:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> said in <a href="/post/97978">Shortcut or menu path to "Rotate to right/left"</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/deleelee" aria-label="Profile: deleelee">@<bdi>deleelee</bdi></a></p>
<p dir="auto">UPDATED VERSION</p>
<pre><code class="language-python">from ctypes import wintypes, WinDLL
from Npp import notepad

class ViewRotator():
    def __init__(self):
        self.LOWORD_LEFT = 2000
        self.LOWORD_RIGHT = 2001
        self.WM_COMMAND = 0x111
        self.toggle_rotating_direction = False
        self.npp_hwnd = WinDLL("user32").FindWindowW(u'Notepad++', None)
        self.splitter_hwnd = WinDLL("user32").FindWindowExW(self.npp_hwnd, None, u'splitterContainer', None)
        self.send = WinDLL("user32").SendMessageW
        self.send.argtypes = [wintypes.HWND, wintypes.UINT, wintypes.WPARAM, wintypes.LPARAM]
        self.send.restype = wintypes.LPARAM  # LRESULT

    def rotate(self):
        if not notepad.isSingleView():
            if self.toggle_rotating_direction:
                self.send(self.splitter_hwnd, self.WM_COMMAND, self.LOWORD_RIGHT, 0)
            else:
                self.send(self.splitter_hwnd, self.WM_COMMAND, self.LOWORD_LEFT, 0)
            self.toggle_rotating_direction = not self.toggle_rotating_direction


if not hasattr(notepad, "rotateSplitView"):
    notepad.rotateSplitView = ViewRotator().rotate

notepad.rotateSplitView()
</code></pre>
</blockquote>
<p dir="auto">Wowsers!!! That is perfect. Thank you so much.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98144</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98144</guid><dc:creator><![CDATA[deleelee]]></dc:creator><pubDate>Sun, 24 Nov 2024 07:01:07 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Thu, 21 Nov 2024 11:18:21 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">IMO the name of that variable could have been better</p>
</blockquote>
<p dir="auto">The reason <code>toggle_rotating_direction</code> isn’t good IMO is because, every time the code runs a toggle happens, and not just when <code>toggle_rotating_direction</code> is true.</p>
<blockquote>
<p dir="auto">what would be your choice?</p>
</blockquote>
<p dir="auto">Hmm, for this one, since it is a boolean, I might go with <code>next_rotate_is_to_the_right</code>.</p>
<p dir="auto">With something like that, true/false makes sense.</p>
<p dir="auto">Of course, this is all up to individual taste.</p>
<hr />
<blockquote>
<p dir="auto">I’m constantly struggling to name things.</p>
</blockquote>
<p dir="auto">Yes, it is hard sometimes.  Often what I do is to name something <code>zz</code> or <code>zzz</code> and just barrel ahead coding with that.  Later, like when I’ve completed the local block of code, a good name surfaces and a rename fixes things.</p>
<p dir="auto">I find that if I spend the time up front to come up with a great name, the code to be written changes the meaning somewhat and the great name is no longer great.  So I end up taking the time to come up with 2 good names instead of just 1.  Naming after the fact seems a viable technique, at least for me.</p>
<p dir="auto">Of course I don’t do this 100% of the time, just when a suitable name doesn’t immediately come to mind.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98040</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98040</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 21 Nov 2024 11:18:21 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Thu, 21 Nov 2024 08:16:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said in <a href="/post/98024">Shortcut or menu path to "Rotate to right/left"</a>:</p>
<blockquote>
<p dir="auto">IMO the name of that variable could have been better</p>
</blockquote>
<p dir="auto">Sure, but I’m constantly struggling to name things.<br />
What would be your choice? change_rotating_direction?</p>
<blockquote>
<p dir="auto">…</p>
</blockquote>
<p dir="auto">I had the same thoughts and decided to use a function because it can easily be modified to use a parameter to get either a split landscape or portrait view.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98036</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98036</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 21 Nov 2024 08:16:51 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Wed, 20 Nov 2024 12:49:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a></p>
<p dir="auto">This is an interesting approach to remembering <code>toggle_rotating_direction</code> from run to run of the script.  Side note: IMO the <em>name</em> of that variable could have been better.</p>
<p dir="auto">If I were writing that script, I might have remembered only the variable in the notepad variable (i.e., <code>notepad.toggle_rotating_direction =</code> …) instead of the function.</p>
<p dir="auto">Your way has the advantage that you’ve added a general purpose function (<code>notepad.rotateSplitView()</code>) that could also easily be called by other scripts.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/98024</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/98024</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 20 Nov 2024 12:49:59 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Mon, 18 Nov 2024 16:08:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/deleelee" aria-label="Profile: deleelee">@<bdi>deleelee</bdi></a></p>
<p dir="auto">UPDATED VERSION</p>
<pre><code class="language-python">from ctypes import wintypes, WinDLL
from Npp import notepad

class ViewRotator():
    def __init__(self):
        self.LOWORD_LEFT = 2000
        self.LOWORD_RIGHT = 2001
        self.WM_COMMAND = 0x111
        self.toggle_rotating_direction = False
        self.npp_hwnd = WinDLL("user32").FindWindowW(u'Notepad++', None)
        self.splitter_hwnd = WinDLL("user32").FindWindowExW(self.npp_hwnd, None, u'splitterContainer', None)
        self.send = WinDLL("user32").SendMessageW
        self.send.argtypes = [wintypes.HWND, wintypes.UINT, wintypes.WPARAM, wintypes.LPARAM]
        self.send.restype = wintypes.LPARAM  # LRESULT

    def rotate(self):
        if not notepad.isSingleView():
            if self.toggle_rotating_direction:
                self.send(self.splitter_hwnd, self.WM_COMMAND, self.LOWORD_RIGHT, 0)
            else:
                self.send(self.splitter_hwnd, self.WM_COMMAND, self.LOWORD_LEFT, 0)
            self.toggle_rotating_direction = not self.toggle_rotating_direction


if not hasattr(notepad, "rotateSplitView"):
    notepad.rotateSplitView = ViewRotator().rotate

notepad.rotateSplitView()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/97978</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97978</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 18 Nov 2024 16:08:19 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Mon, 18 Nov 2024 16:01:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said in <a href="/post/97971">Shortcut or menu path to "Rotate to right/left"</a>:</p>
<blockquote>
<p dir="auto">I think you mean restype</p>
</blockquote>
<p dir="auto">Yes, I do, thanks for pointing that out.</p>
<blockquote>
<p dir="auto">Any reason not to use notepad.isSingleView() instead of writing a custom function?</p>
</blockquote>
<p dir="auto">No, I just hadn’t thought about whether there were any builtin methods.</p>
<blockquote>
<p dir="auto">Yep, we all feel this way about our own old code. :-)<br />
It’s because we’ve learned so much since the time of original writing.</p>
</blockquote>
<p dir="auto">… and still learning … :-D that’s the beauty of this work, at least for me.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97977</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97977</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 18 Nov 2024 16:01:26 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Mon, 18 Nov 2024 15:17:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a></p>
<blockquote>
<p dir="auto">self.send.resttype = wintypes.LPARAM  # LRESULT</p>
</blockquote>
<p dir="auto">I think you mean <code>restype</code></p>
<blockquote>
<p dir="auto">def isSingleView(self):<br />
…<br />
if not self.isSingleView():</p>
</blockquote>
<p dir="auto">Any reason not to use <code>notepad.isSingleView()</code> instead of writing a custom function?</p>
<hr />
<blockquote>
<p dir="auto">Oh dear … When I see this old code, what was I thinking? :-D</p>
</blockquote>
<p dir="auto">Yep, we all feel this way about our own old code.  :-)<br />
It’s because we’ve learned so much since the time of original writing.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97971</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97971</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 18 Nov 2024 15:17:28 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Mon, 18 Nov 2024 11:27:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/deleelee" aria-label="Profile: deleelee">@<bdi>deleelee</bdi></a></p>
<p dir="auto">Oh dear … When I see this old code, what was I thinking? :-D</p>
<p dir="auto">let’s create a new property of the notepad class and store the state there.</p>
<pre><code class="language-python">import ctypes

ROTATION_A_LEFT = 2000
ROTATION_A_RIGHT = 2001
WM_COMMAND = 0x111

def isSingleView():
    npp_hwnd = ctypes.windll.user32.FindWindowW(u'Notepad++', None)
    splitter_hwnd = ctypes.windll.user32.FindWindowExW(npp_hwnd, None, u'splitterContainer', None)
    return (not bool(ctypes.windll.user32.IsWindowVisible(splitter_hwnd)), splitter_hwnd)

def LOWORD(value): return value &amp; 0xFFFF

if not hasattr(notepad, "rotateSplitView"):
    notepad.rotateSplitView = False

single_view, hwnd = isSingleView()
if not single_view:
    if notepad.rotateSplitView:
        ctypes.windll.user32.SendMessageW(hwnd, WM_COMMAND, LOWORD(ROTATION_A_LEFT), 0)
    else:
        ctypes.windll.user32.SendMessageW(hwnd, WM_COMMAND, LOWORD(ROTATION_A_RIGHT), 0)
    notepad.rotateSplitView = not notepad.rotateSplitView
</code></pre>
<p dir="auto">But nowadays I guess I would do something like</p>
<pre><code class="language-python">from ctypes import wintypes, WinDLL
from Npp import notepad

class ViewRotator():
    def __init__(self):
        self.LOWORD_LEFT = 2000
        self.LOWORD_RIGHT = 2001
        self.WM_COMMAND = 0x111
        self.toggle_rotating_direction = False
        self.npp_hwnd = WinDLL("user32").FindWindowW(u'Notepad++', None)
        self.splitter_hwnd = WinDLL("user32").FindWindowExW(self.npp_hwnd, None, u'splitterContainer', None)
        self.send = WinDLL("user32").SendMessageW
        self.send.argtypes = [wintypes.HWND, wintypes.UINT, wintypes.WPARAM, wintypes.LPARAM]
        self.send.resttype = wintypes.LPARAM  # LRESULT

    def isSingleView(self):
        return not bool(WinDLL("user32").IsWindowVisible(self.splitter_hwnd))

    def rotate(self):
        if not self.isSingleView():
            if self.toggle_rotating_direction:
                self.send(self.splitter_hwnd, self.WM_COMMAND, self.LOWORD_RIGHT, 0)
            else:
                self.send(self.splitter_hwnd, self.WM_COMMAND, self.LOWORD_LEFT, 0)
            self.toggle_rotating_direction = not self.toggle_rotating_direction


if not hasattr(notepad, "rotateSplitView"):
    notepad.rotateSplitView = ViewRotator().rotate

notepad.rotateSplitView()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/97970</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97970</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 18 Nov 2024 11:27:42 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Mon, 18 Nov 2024 00:29:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> said in <a href="/post/49173">Shortcut or menu path to "Rotate to right/left"</a>:</p>
<blockquote>
<p dir="auto">A python script might look like this</p>
<pre><code>import ctypes

ROTATION_A_LEFT = 2000
ROTATION_A_RIGHT = 2001
WM_COMMAND = 0x111

def isSingleView():
    npp_hwnd = ctypes.windll.user32.FindWindowW(u'Notepad++', None)
    splitter_hwnd = ctypes.windll.user32.FindWindowExW(npp_hwnd, None, u'splitterContainer', None)
    return (not bool(ctypes.windll.user32.IsWindowVisible(splitter_hwnd)), splitter_hwnd)

def LOWORD(value): return value &amp; 0xFFFF

single_view, hwnd = isSingleView()
if not single_view:
    ctypes.windll.user32.SendMessageW(hwnd, WM_COMMAND, LOWORD(ROTATION_A_LEFT), 0)
</code></pre>
</blockquote>
<p dir="auto">A few years old but it still works!!! I’ve been wanting a toolbar button for rotating the panes and this is great. Do you know if it would be possible to have the script toggle so that it rotates one way on the first click and back the other way on the next click? As it is, the first click rotates in the desired direction but the next click rotates once more in the same direction which doesn’t return the panes to the order they were in, so it requires three clicks to do that. Obviously, I could just have two buttons, one for right and one for left, but it would save toolbar space if they were combined into one button.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97969</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97969</guid><dc:creator><![CDATA[deleelee]]></dc:creator><pubDate>Mon, 18 Nov 2024 00:29:07 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Fri, 13 Dec 2019 14:40:30 GMT]]></title><description><![CDATA[<p dir="auto">What I think the problem was is that a newly created script hasn’t been assigned<br />
an ID known to npp. This is normally done during plugin initialization where npp<br />
asks for functions to register, hence the restart of npp solved it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49195</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49195</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Fri, 13 Dec 2019 14:40:30 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Fri, 13 Dec 2019 14:25:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a> said in <a href="/post/49193">Shortcut or menu path to "Rotate to right/left"</a>:</p>
<blockquote>
<p dir="auto">tool we’re using to talk decides</p>
</blockquote>
<p dir="auto">Yes, it uses markdown format – though I’ve never seen it eat commas before; I guess it depends on what other markdown you’re using.</p>
<p dir="auto">If you ever want text to come through literally, the best is to highlight the literal then press the <code>&lt;/&gt;</code> toolbar button at the top:</p>
<pre><code>Edit,Line Operations,Sort Lines Lexicographically Ascending,,sort.bmp
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/49194</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49194</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 13 Dec 2019 14:25:39 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Fri, 13 Dec 2019 14:23:01 GMT]]></title><description><![CDATA[<p dir="auto">I don’t know how to explain what happened, but I restarted N++ one more time, and now the button works as expected.<br />
Very odd, as I’d done that a couple of times already.  Thanks to everyone for the assistance!</p>
<p dir="auto">And regarding the same number of levels comment, it appears that tool we’re using to talk decides that back-to-back commas should be displayed as a single comma.   In all but the last config line above, there are 2 commas before the .bmp.  The second comma just didn’t render in my post.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49193</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49193</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Fri, 13 Dec 2019 14:23:01 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Fri, 13 Dec 2019 14:14:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vtgroupgithub" aria-label="Profile: VTGroupGitHub">@<bdi>VTGroupGitHub</bdi></a> ,</p>
<p dir="auto">I don’t use Customize Toolbar.  However, something does jump out at me: the first 5 rows of your config have 3 levels of menu (main menu, submenu, command) followed by the icon/bmp; the last has 4 levels of menu (main, submenu, submenu, command) before the icon/bmp.  It may be that Customize Toolbar cannot go that deep (I don’t know).</p>
<p dir="auto">PythonScript plugin has <strong>Plugins &gt; Python Script &gt; Configuration…</strong>, which allows you to add a script into the Menu Items list on the left – this is a prerequisite to configuring a <strong>Settings &gt; Shortcut Mapper</strong> keyboard shortcut to a script, and it might also be necessary for the script to work with Customize Toolbar as well – because if the <strong>Rotate</strong> script were in the left-hand list, it would show up in <strong>Plugins &gt; Python Script &gt; Rotate</strong> – which could be accessed using:</p>
<pre><code>Plugins,Python Script,Rotate,rotate.bmp
</code></pre>
<p dir="auto">… which then has the same number of levels as your other commands.</p>
<p dir="auto">Aside from that, there’s also the right-hand pane in the same <strong>Configuration…</strong> dialog, which allows you do add a PythonScript script directly into the toolbar (complete with icon) without needing the Customize Toolbar plugin at all.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49191</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49191</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 13 Dec 2019 14:14:28 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Fri, 13 Dec 2019 14:06:11 GMT]]></title><description><![CDATA[<p dir="auto">Thank you!   I’ve not done Python before, but with such clear code, I figured I’d give it a shot.  :)  Your code worked perfectly.</p>
<p dir="auto">Unfortunately, while I can run the script from the menu, when I try to assign it to “Customize Toolbar”, nothing happens when I press the new toolbar button.  In case anyone sees something wrong with my last config line below, or knows something about a step I’m missing, I thought I’d post.  All of the other commands below work as expected, it’s just that Rotate does nothing when the button is pressed.</p>
<p dir="auto"><strong>Edit,Line Operations,Sort Lines Lexicographically Ascending,sort.bmp<br />
Edit,Line Operations,Remove Consecutive Duplicate Lines,dedup.bmp<br />
Plugins,XML Tools,Pretty print (XML only),xml.bmp<br />
Plugins,JSON Viewer,Format JSON,json.bmp<br />
View,Move/Clone Current Document,Move to Other View,split.bmp<br />
Plugins,Python Script,Scripts,Rotate,rotate.bmp</strong></p>
<p dir="auto">Thank you again.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49189</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49189</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Fri, 13 Dec 2019 14:06:11 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Thu, 12 Dec 2019 19:08:37 GMT]]></title><description><![CDATA[<p dir="auto">A python script might look like this</p>
<pre><code>import ctypes

ROTATION_A_LEFT = 2000
ROTATION_A_RIGHT = 2001
WM_COMMAND = 0x111

def isSingleView():
    npp_hwnd = ctypes.windll.user32.FindWindowW(u'Notepad++', None)
    splitter_hwnd = ctypes.windll.user32.FindWindowExW(npp_hwnd, None, u'splitterContainer', None)
    return (not bool(ctypes.windll.user32.IsWindowVisible(splitter_hwnd)), splitter_hwnd)

def LOWORD(value): return value &amp; 0xFFFF

single_view, hwnd = isSingleView()
if not single_view:
    ctypes.windll.user32.SendMessageW(hwnd, WM_COMMAND, LOWORD(ROTATION_A_LEFT), 0)
</code></pre>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> - thx - explanation was perfect - I did not even had to check the source :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49173</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49173</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Thu, 12 Dec 2019 19:08:37 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Thu, 12 Dec 2019 18:51:48 GMT]]></title><description><![CDATA[<p dir="auto">Very much appreciated.  It’s obviously not a major issue, but I wanted to make sure I wasn’t missing something obvious.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49171</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49171</guid><dc:creator><![CDATA[VTGroupGitHub]]></dc:creator><pubDate>Thu, 12 Dec 2019 18:51:48 GMT</pubDate></item><item><title><![CDATA[Reply to Shortcut or menu path to &quot;Rotate to right&#x2F;left&quot; on Thu, 12 Dec 2019 18:12:38 GMT]]></title><description><![CDATA[<p dir="auto">Unfortunately, looking at the <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/ef13902206f80e00dcfd7d85b342066ed6f86d66/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp#L254" rel="nofollow ugc">source code</a>, it appears that the splitter-container hardcode-generates those commands, and I don’t think even the <a href="https://npp-user-manual.org/docs/plugin-communication/" rel="nofollow ugc">plugins communication system</a> has any <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h" rel="nofollow ugc">messages</a> which talk directly with the SplitterContainer’s object.  I couldn’t find any <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/menuCmdID.h" rel="nofollow ugc">menu command ID’s</a> which affect that either (though the move and clone to other view <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/menuCmdID.h#L359-L362" rel="nofollow ugc">are there</a>).</p>
<p dir="auto">Without a command ID or main menu position, you cannot record it in a macro.  Without a published message ID, you’re not supposed to access those internal messages to manipulate it via a plugin.</p>
<p dir="auto">However, a clever PythonScript programmer could probably <a href="https://community.notepad-plus-plus.org/topic/17992/how-to-get-the-scintilla-view0-view1-hwnds">search through the child-windows</a> of the main Notepad++ GUI window, until they found the SplitterContainer object’s HWND, and then SendMessage to that HWND to send a <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/ef13902206f80e00dcfd7d85b342066ed6f86d66/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp#L189-L205" rel="nofollow ugc"><code>WM_COMMAND</code> message to the SplitterContainer</a>, with the lword as the <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/blob/ef13902206f80e00dcfd7d85b342066ed6f86d66/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.h#L34-L35" rel="nofollow ugc">left and right constants</a>.  Not that I would recommend someone do that 😉, since sending unpublished messages to internal hwnd objects is <a href="https://community.notepad-plus-plus.org/post/47860">not guaranteed to stay consistently working</a> from one version to the next (which is a risk you take by going beyond the published API).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49170</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49170</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 12 Dec 2019 18:12:38 GMT</pubDate></item></channel></rss>