Notepad2: get path

Post your working scripts, libraries and tools
User avatar
jeeswg
Posts: 5136
Joined: 19 Dec 2016, 01:58
Location: UK

Notepad2: get path

Post by jeeswg » 18 Aug 2018, 14:29

- Here is a script to retrieve the path of the text file from Notepad2.

Code: Select all

;Get Info from Context Menu (x64/x32 compatible) - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=31971
;40430	Filename Only
;40431	Filename and Directory
;40432	Full Pathname
;40433	Text Excerpt

#IfWinActive ahk_class Notepad2
q:: ;notepad2 - get path
WinGet, hWnd, ID, A
SendMessage, 0xB, 0,,, % "ahk_id " hWnd ;WM_SETREDRAW := 0xB
SendMessage, 0x111, 40432,,, % "ahk_id " hWnd ;WM_COMMAND := 0x111 ;Full Pathname
WinGetTitle, vWinTitle, % "ahk_id " hWnd
SendMessage, 0xB, 1,,, % "ahk_id " hWnd ;WM_SETREDRAW := 0xB
PostMessage, 0x111, 40430,,, % "ahk_id " hWnd ;WM_COMMAND := 0x111 ;Filename Only
vPath := RegExReplace(vWinTitle, " - Notepad2$")
if (SubStr(vPath, 1, 2) = "* ")
	vPath := SubStr(vPath, 3)
;Clipboard := vPath
MsgBox, % vPath
return
#IfWinActive
- To set the path, see the JEE_NotepadSetPath function here. It emulates a drag-and-drop to set the file path. (A technique that works on about half of the programs I use.)
notepad get/set path (get/set text file path) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=30050

- See also:
Notepad++: get path - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=54267
drozdman
Posts: 68
Joined: 05 Dec 2015, 01:07

Re: Notepad2: get path

Post by drozdman » 30 Aug 2018, 11:25

@jeeswg
Thanks for the idea. The message for Notepad++ works perfectly, though the Notepad2 version doesn't work for me and creates some problems.
I needed something like that for Notepad2. I found in the help file "Shift+F9" shortcut for copying path in Notepad2. And that's how I got the message from Resource Hacker in menu (If I remember correctly it was your tip about the method).
Edit: Correction: I used "Resource Hacker" for Scite, but for Notepad2 I used "Winspector Spy".

Code: Select all

SendMessage,0x0111,20032,,, ahk_class Notepad2U ;copy path
MsgBox,4096,, %  clipboard
I got something like that also for Scite:

Code: Select all

SendMessage,0x0111,118,,, ahk_class SciTEWindow  ;copy path  ;Shift+F9 
MsgBox,4096,, %   clipboard
Last edited by drozdman on 30 Aug 2018, 14:12, edited 1 time in total.
User avatar
jeeswg
Posts: 5136
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Notepad2: get path

Post by jeeswg » 30 Aug 2018, 12:45

- Great find, cheers.
- The Shift+F9 shortcut does not appear in the menus AFAICS.
- So, like you said, noticing 'Shift+F9' in the help file and then using Resource Hacker, would be a way to get the PostMessage/SendMessage ID.
- Other tools would be HotkeyP and Microsoft Spy++.
- If you're able to explain why the technique in the OP isn't working for you, that would be good to know.
- Here's a link to the help:
Notepad2.txt
http://www.flos-freeware.ch/doc/Notepad2.txt
- Here's a list of menu constants:

Code: Select all

;Notepad2 v4.2.25 menu constants

;using JEE_MenuGetTextAll from:
;GUIs via DllCall: get/set internal/external control text - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=40514

-1	&File
-1	&Edit
-1	&View
-1	&Settings
-1	&?

	[&File]
	40000	&New	Ctrl+N
	40001	&Open...	Ctrl+O
	40002	Re&vert	F5
	40004	&Save	Ctrl+S
	40005	Save &As...	F6
	40006	Save &Copy...	Ctrl+F6
	40007	&Read Only
	0
	-1	&Launch
	0
	-1	&Encoding
	-1	Line Endin&gs
	0
	40013	Page Se&tup...
	40014	&Print...	Ctrl+P
	0
	40015	Propert&ies...
	40016	Create &Desktop Link
	0
	-1	&Favorites
	40020	Recent (&History)...	Alt+H
	0
	40021	E&xit	Alt+F4

		[&Launch]
		40011	&New Window	Alt+N
		40012	&Empty Window	Alt+0
		0
		40008	Execute &Document	Ctrl+L
		40009	&Open with...	Alt+L
		40010	&Command...	Ctrl+R

		[&Encoding]
		40100	&ANSI
		40101	&Unicode
		40102	Unicode &Big Endian
		40103	UTF-&8
		40104	UTF-8 with &Signature
		40105	&More...	F9
		0
		40106	&Recode...	F8
		0
		40107	&Default...

		[Line Endin&gs]
		40200	&Windows (CR+LF)
		40201	&Unix (LF)
		40202	&Mac (CR)
		0
		40203	&Default...

		[&Favorites]
		40017	&Open Favorites...	Alt+I
		40018	&Add Current File...	Alt+K
		40019	&Manage...	Alt+F9

	[&Edit]
	40300	&Undo	Ctrl+Z
	40301	&Redo	Ctrl+Y
	0
	40302	Cu&t	Ctrl+X
	40303	&Copy	Ctrl+C
	40304	Copy A&ll	Alt+C
	40305	Copy &Add	Ctrl+E
	40306	&Paste	Ctrl+V
	40307	S&wap	Ctrl+K
	40308	Clear	Del
	40309	Clear Clipboar&d
	40310	&Select All	Ctrl+A
	0
	-1	L&ines
	-1	&Block
	-1	C&onvert
	-1	I&nsert
	-1	Spec&ial
	0
	40364	&Find...	Ctrl+F
	40365	Sa&ve Find Text	Alt+F3
	40366	Find Ne&xt	F3
	40367	Find Pre&vious	Shift+F3
	40368	R&eplace...	Ctrl+H
	40369	Replace Ne&xt	F4
	40370	&Goto...	Ctrl+G

		[L&ines]
		40313	Move &Up	Ctrl+Shift+Up
		40314	&Move Down	Ctrl+Shift+Down
		0
		40315	&Duplicate Line	Ctrl+D
		40316	&Cut Line	Ctrl+Shift+X
		40317	C&opy Line	Ctrl+Shift+C
		40318	D&elete Line	Ctrl+Shift+D
		0
		40321	Column &Wrap...	Ctrl+Shift+W
		40322	&Split Lines	Ctrl+I
		40323	&Join Lines	Ctrl+J
		40324	Join &Paragraphs	Ctrl+Shift+J

		[&Block]
		40325	&Indent	Tab
		40326	&Unindent	Shift+Tab
		0
		40327	&Enclose Selection...	Alt+Q
		40328	&Duplicate Selection	Alt+D
		0
		40329	&Pad With Spaces	Alt+B
		40330	Strip &First Character	Alt+Z
		40331	Strip &Last Character	Alt+U
		40332	Strip &Trailing Blanks	Alt+W
		40333	Compress &Whitespace	Alt+P
		40334	Merge &Blank Lines	Alt+Y
		40335	&Remove Blank Lines	Alt+R
		0
		40336	&Modify Lines...	Alt+M
		40338	Alig&n Lines...	Alt+J
		40337	S&ort Lines...	Alt+O

		[C&onvert]
		40339	&Uppercase	Ctrl+Shift+U
		40340	&Lowercase	Ctrl+U
		0
		40341	&Invert Case	Ctrl+Alt+U
		40342	Title &Case	Ctrl+Alt+I
		40343	&Sentence Case	Ctrl+Alt+O
		0
		40345	&Tabify Selection	Ctrl+Shift+T
		40344	U&ntabify Selection	Ctrl+Shift+S
		0
		40347	Ta&bify Indent	Ctrl+Alt+T
		40346	Untabi&fy Indent	Ctrl+Alt+S

		[I&nsert]
		40348	&HTML/XML Tag...	Alt+X
		0
		40349	&Encoding Identifier	Ctrl+F8
		0
		40350	Time/Date (&Short Form)	Ctrl+F5
		40351	Time/Date (&Long Form)	Ctrl+Shift+F5
		0
		40352	&Filename	Ctrl+F9
		40353	&Path and Filename	Ctrl+Shift+F9

		[Spec&ial]
		40354	Line Comment (&Toggle)	Ctrl+Q
		40355	Stream &Comment	Ctrl+Shift+Q
		0
		40356	URL &Encode	Ctrl+Shift+E
		40357	URL &Decode	Ctrl+Shift+R
		0
		40358	Esca&pe C Chars	Ctrl+Alt+E
		40359	&Unescape C Chars	Ctrl+Alt+R
		0
		40360	C&har To Hex	Ctrl+Alt+X
		40361	Hex To Cha&r	Ctrl+Alt+C
		0
		40362	&Find Matching Brace	Ctrl+B
		40363	&Select To Matching Brace	Ctrl+Shift+B
		0
		40371	Select To Ne&xt	F2
		40372	Select To Pre&vious	Shift+F2

	[&View]
	40400	&Syntax Scheme...	F12
	40401	&2nd Default Scheme	Shift+F12
	40402	&Customize Schemes...	Ctrl+F12
	40403	&Default Font...	Alt+F12
	0
	40404	Word W&rap	Ctrl+W
	40405	&Long Line Marker	Ctrl+Shift+L
	40406	Indentation &Guides	Ctrl+Shift+G
	0
	40407	Show &Whitespace	Ctrl+Shift+8
	40408	Show Line &Endings	Ctrl+Shift+9
	40409	Show Wrap S&ymbols	Ctrl+Shift+0
	0
	40410	Visual &Brace Matching	Ctrl+Shift+V
	40411	Highlight C&urrent Line	Ctrl+Shift+I
	0
	40412	Line &Numbers	Ctrl+Shift+N
	40413	Selection &Margin	Ctrl+Shift+M
	0
	40414	Zoom &In	Ctrl++
	40415	Zoom &Out	Ctrl+-
	40416	Reset &Zoom	Ctrl+/

	[&Settings]
	40417	Insert Tabs as &Spaces
	40418	&Tab Settings...	Ctrl+T
	40419	&Word Wrap Settings...
	40420	&Long Line Settings...
	40421	Auto In&dent Text
	40422	Auto Close &HTML/XML	Ctrl+Shift+H
	0
	40423	&Reuse Window
	40424	Sticky Window &Position
	40425	&Always On Top	Alt+T
	40426	Minimi&ze To Tray
	40427	Transparent &Mode	Ctrl+0
	0
	40428	Single &File Instance
	40429	File &Change Notification...	Alt+F5
	-1	Window Title Displa&y
	-1	Esc &Key Function
	40437	Sa&ve Before Running Tools
	40438	Remember Recent F&iles
	40439	Remember S&earch Strings
	0
	40440	Sh&ow Toolbar
	40441	C&ustomize Toolbar...
	40442	Sh&ow Statusbar
	0
	40443	Save Settings On E&xit
	40444	Save Settings &Now	F7

		[Window Title Displa&y]
		40430	Filename &Only
		40431	Filename and &Directory
		40432	Full &Pathname
		40433	&Text Excerpt	Ctrl+9

		[Esc &Key Function]
		40434	&None
		40435	&Minimize Notepad2
		40436	E&xit Notepad2

	[&?]
	40500	&About...	F1

==================================================

;using Resource Hacker

100 ACCELERATORS
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
	VK_0, 40427, NOINVERT, CONTROL, VIRTKEY
	VK_0, 40012, NOINVERT, ALT, VIRTKEY
	VK_0, 40409, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_1, 20021, NOINVERT, CONTROL, VIRTKEY
	VK_1, 20015, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_2, 20022, NOINVERT, CONTROL, VIRTKEY
	VK_2, 20016, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_3, 20023, NOINVERT, CONTROL, VIRTKEY
	VK_4, 20024, NOINVERT, CONTROL, VIRTKEY
	VK_5, 20025, NOINVERT, CONTROL, VIRTKEY
	VK_6, 20026, NOINVERT, CONTROL, VIRTKEY
	VK_8, 40407, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_9, 20029, NOINVERT, CONTROL, VIRTKEY
	VK_9, 40408, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_A, 40310, NOINVERT, CONTROL, VIRTKEY
	VK_A, 20007, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_B, 40362, NOINVERT, CONTROL, VIRTKEY
	VK_B, 40329, NOINVERT, ALT, VIRTKEY
	VK_B, 40363, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_C, 40303, NOINVERT, CONTROL, VIRTKEY
	VK_C, 40304, NOINVERT, ALT, VIRTKEY
	VK_C, 40361, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_C, 40317, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_D, 40315, NOINVERT, CONTROL, VIRTKEY
	VK_D, 40328, NOINVERT, ALT, VIRTKEY
	VK_D, 40318, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_E, 40305, NOINVERT, CONTROL, VIRTKEY
	VK_E, 40358, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_E, 40356, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_F, 40364, NOINVERT, CONTROL, VIRTKEY
	VK_F, 20006, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_G, 40370, NOINVERT, CONTROL, VIRTKEY
	VK_G, 40406, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_H, 40368, NOINVERT, CONTROL, VIRTKEY
	VK_H, 40020, NOINVERT, ALT, VIRTKEY
	VK_H, 40422, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_I, 40322, NOINVERT, CONTROL, VIRTKEY
	VK_I, 40017, NOINVERT, ALT, VIRTKEY
	VK_I, 40342, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_I, 40411, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_J, 40323, NOINVERT, CONTROL, VIRTKEY
	VK_J, 40338, NOINVERT, ALT, VIRTKEY
	VK_J, 40324, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_K, 40307, NOINVERT, CONTROL, VIRTKEY
	VK_K, 40018, NOINVERT, ALT, VIRTKEY
	VK_K, 20033, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_L, 40008, NOINVERT, CONTROL, VIRTKEY
	VK_L, 40009, NOINVERT, ALT, VIRTKEY
	VK_L, 40405, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_M, 40003, NOINVERT, CONTROL, VIRTKEY
	VK_M, 40336, NOINVERT, ALT, VIRTKEY
	VK_M, 40413, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_N, 40000, NOINVERT, CONTROL, VIRTKEY
	VK_N, 40011, NOINVERT, ALT, VIRTKEY
	VK_N, 40412, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_O, 40001, NOINVERT, CONTROL, VIRTKEY
	VK_O, 40337, NOINVERT, ALT, VIRTKEY
	VK_O, 40343, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_O, 20008, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_P, 40014, NOINVERT, CONTROL, VIRTKEY
	VK_P, 40333, NOINVERT, ALT, VIRTKEY
	VK_P, 20034, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_Q, 40354, NOINVERT, CONTROL, VIRTKEY
	VK_Q, 40327, NOINVERT, ALT, VIRTKEY
	VK_Q, 40355, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_R, 40010, NOINVERT, CONTROL, VIRTKEY
	VK_R, 40335, NOINVERT, ALT, VIRTKEY
	VK_R, 40359, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_R, 40357, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_S, 40004, NOINVERT, CONTROL, VIRTKEY
	VK_S, 40346, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_S, 40344, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_T, 40418, NOINVERT, CONTROL, VIRTKEY
	VK_T, 40425, NOINVERT, ALT, VIRTKEY
	VK_T, 40347, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_T, 40345, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_U, 40340, NOINVERT, CONTROL, VIRTKEY
	VK_U, 40331, NOINVERT, ALT, VIRTKEY
	VK_U, 40341, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_U, 40339, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_V, 40306, NOINVERT, CONTROL, VIRTKEY
	VK_V, 40410, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_ADD, 40414, NOINVERT, CONTROL, VIRTKEY
	VK_ADD, 20019, NOINVERT, ALT, VIRTKEY
	VK_ADD, 20027, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_BACK, 20003, NOINVERT, CONTROL, VIRTKEY
	VK_BACK, 40300, NOINVERT, ALT, VIRTKEY
	VK_BACK, 40319, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_DELETE, 20004, NOINVERT, CONTROL, VIRTKEY
	VK_DELETE, 40302, NOINVERT, SHIFT, VIRTKEY
	VK_DELETE, 40320, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_DIVIDE, 40416, NOINVERT, CONTROL, VIRTKEY
	VK_DOWN, 40314, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_ESCAPE, 20000, NOINVERT, VIRTKEY
	VK_ESCAPE, 20001, NOINVERT, SHIFT, VIRTKEY
	VK_F1, 40500, NOINVERT, VIRTKEY
	VK_F11, 20011, NOINVERT, VIRTKEY
	VK_F11, 20012, NOINVERT, CONTROL, VIRTKEY
	VK_F11, 20013, NOINVERT, SHIFT, VIRTKEY
	VK_F12, 40400, NOINVERT, VIRTKEY
	VK_F12, 40402, NOINVERT, CONTROL, VIRTKEY
	VK_F12, 40403, NOINVERT, ALT, VIRTKEY
	VK_F12, 40401, NOINVERT, SHIFT, VIRTKEY
	VK_F2, 40371, NOINVERT, VIRTKEY
	VK_F2, 40372, NOINVERT, SHIFT, VIRTKEY
	VK_F3, 40366, NOINVERT, VIRTKEY
	VK_F3, 20017, NOINVERT, CONTROL, VIRTKEY
	VK_F3, 40365, NOINVERT, ALT, VIRTKEY
	VK_F3, 40367, NOINVERT, SHIFT, VIRTKEY
	VK_F3, 20018, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_F4, 40369, NOINVERT, VIRTKEY
	VK_F4, 40000, NOINVERT, CONTROL, VIRTKEY
	VK_F4, 40000, NOINVERT, CONTROL, VIRTKEY
	VK_F5, 40002, NOINVERT, VIRTKEY
	VK_F5, 40350, NOINVERT, CONTROL, VIRTKEY
	VK_F5, 40429, NOINVERT, ALT, VIRTKEY
	VK_F5, 20014, NOINVERT, SHIFT, VIRTKEY
	VK_F5, 40351, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_F6, 40005, NOINVERT, VIRTKEY
	VK_F6, 40006, NOINVERT, CONTROL, VIRTKEY
	VK_F7, 40444, NOINVERT, VIRTKEY
	VK_F7, 20035, NOINVERT, CONTROL, VIRTKEY
	VK_F8, 40106, NOINVERT, VIRTKEY
	VK_F8, 40349, NOINVERT, CONTROL, VIRTKEY
	VK_F8, 20010, NOINVERT, ALT, VIRTKEY
	VK_F8, 20009, NOINVERT, SHIFT, VIRTKEY
	VK_F9, 40105, NOINVERT, VIRTKEY
	VK_F9, 40352, NOINVERT, CONTROL, VIRTKEY
	VK_F9, 40019, NOINVERT, ALT, VIRTKEY
	VK_F9, 20032, NOINVERT, SHIFT, VIRTKEY
	VK_F9, 40353, NOINVERT, CONTROL, SHIFT, VIRTKEY
	191, 40416, NOINVERT, CONTROL, VIRTKEY
	188, 20030, NOINVERT, CONTROL, VIRTKEY
	189, 40415, NOINVERT, CONTROL, VIRTKEY
	189, 20028, NOINVERT, ALT, CONTROL, VIRTKEY
	190, 20031, NOINVERT, CONTROL, VIRTKEY
	187, 40414, NOINVERT, CONTROL, VIRTKEY
	187, 20027, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_RETURN, 20002, NOINVERT, CONTROL, VIRTKEY
	VK_SPACE, 40311, NOINVERT, CONTROL, VIRTKEY
	VK_SPACE, 40312, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_SUBTRACT, 40415, NOINVERT, CONTROL, VIRTKEY
	VK_SUBTRACT, 20020, NOINVERT, ALT, VIRTKEY
	VK_SUBTRACT, 20028, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_TAB, 20005, NOINVERT, CONTROL, VIRTKEY
	VK_UP, 40313, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_W, 40404, NOINVERT, CONTROL, VIRTKEY
	VK_W, 40332, NOINVERT, ALT, VIRTKEY
	VK_W, 40321, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_X, 40302, NOINVERT, CONTROL, VIRTKEY
	VK_X, 40348, NOINVERT, ALT, VIRTKEY
	VK_X, 40360, NOINVERT, ALT, CONTROL, VIRTKEY
	VK_X, 40316, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_Y, 40301, NOINVERT, CONTROL, VIRTKEY
	VK_Y, 40334, NOINVERT, ALT, VIRTKEY
	VK_Y, 40300, NOINVERT, CONTROL, SHIFT, VIRTKEY
	VK_Z, 40300, NOINVERT, CONTROL, VIRTKEY
	VK_Z, 40330, NOINVERT, ALT, VIRTKEY
	VK_Z, 40301, NOINVERT, CONTROL, SHIFT, VIRTKEY
}

101 ACCELERATORS
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
	VK_F, 200, NOINVERT, CONTROL, VIRTKEY
	VK_H, 201, NOINVERT, CONTROL, VIRTKEY
	VK_O, 202, NOINVERT, CONTROL, VIRTKEY
	VK_P, 203, NOINVERT, CONTROL, VIRTKEY
	VK_F2, 208, NOINVERT, VIRTKEY
	VK_F2, 209, NOINVERT, SHIFT, VIRTKEY
	VK_F3, 204, NOINVERT, VIRTKEY
	VK_F3, 207, NOINVERT, ALT, VIRTKEY
	VK_F3, 205, NOINVERT, SHIFT, VIRTKEY
	VK_F4, 206, NOINVERT, VIRTKEY
}
- I really like Notepad2, and like to see when other people use it. One thing I like is simply that it doesn't do odd indentation by default like Notepad++.
Last edited by jeeswg on 30 Aug 2018, 20:20, edited 2 times in total.
drozdman
Posts: 68
Joined: 05 Dec 2015, 01:07

Re: Notepad2: get path

Post by drozdman » 30 Aug 2018, 14:04

● It doesn't show anything. And I got drawing problems.
● I wrote it incorrectly, because I mingled Notepad2 and Scite. I used "Resource Hacker" for Scite, but for Notepad2 I used simply "Winspector Spy".
● Thanks for the tip about HotkeyP and Microsoft Spy++. They can spy on WM_COMMAND? I used at times "API Monitor". Though, I can't intercept much in "Save dialogs" or even "Windows Explorer".
User avatar
jeeswg
Posts: 5136
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Notepad2: get path

Post by jeeswg » 30 Aug 2018, 14:14

- HotkeyP can only spy on WM_COMMAND. Microsoft Spy++ is similar to Winspector.
- IIRC I've managed to get every bit of automation I would like from Open/Save As dialogs/Explorer. With Explorer, sometimes I use messages, but a lot of the time it's COM.
jeeswg's Explorer tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=31755
[Script] PersistentSaveFolder - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 05#p188705
drozdman
Posts: 68
Joined: 05 Dec 2015, 01:07

Re: Notepad2: get path

Post by drozdman » 30 Aug 2018, 15:08

● Cool, I will try those two programs
● Nice tutorial. I added my sort in "Windows Explorer" there
Though, I have been looking for Save/Open dialogs change of paths. It's not as easy as in shell windows (I used some crude methods here Toolbar for "Open/Save As" dialogs).
This is more hidden.
Post Reply

Return to “Scripts and Functions”