Ha,

that new feature in Windows 11 is sick and a troublemaker, in my not-so-humble opinion.

But we don't have to accept the multiple tabs feature of the new, but trouble-making notepad. I don't and won't. Here is what Google's Bard says ( via bard.google.com ) :
To disable the new tabs feature for Notepad in Windows 11, you can use the following steps:
Open Notepad.
Click on the "File" menu.
Click on "Settings".
Under the "General" tab, uncheck the box next to "Enable tabs".
Click on "OK".
Note that after disabling tabs, you will no longer be able to open multiple files in a single Notepad window.
If you want to open multiple files, you will need to open them in separate Notepad windows.
I still can't easily grab the name of the Window such that it matches the file being edited. However, I know the name of the file because my program opened it from the disk like this:
shellexecute( NotePadFilename, "", "", @NORMAL, "" ) ;open it from disk
Every window has an internal ID that you can use to manipulate that window. So multiple notepad windows can be open, all named 'Notepad", but each one deals with a different filename; the good news is that each one will have a different winid.
After opening a notepad file from the disk, I grab the ID of the window like this:
Timedelay(1)
win = wingetactive()
winid = winidget(win)
Next, I store the filename and the winid as a list in a control file of my own.
Before opening a notepad file from the disk, I see if I have a winid stored for it, showing that it might be open already.
Why because I don't want duplicate copies of the same filename open for editing at once.
I check to see if a window already exists using:
WinFound = WinExist(OpenWinID) && OpenWinID > ""
Note that an empty winid counts as a notepad that is active, so I check to make sure that the OpenWinID variable has some value in it.
If I find a winid associated with a file name, I activate it using its winid.
winactivate(OpenWinID)
Note that if a Notepad window is closed its winid will still be in my control file, so when I find that the winid does not exist, I update the control file and remove the record of the file name and win id.
Note also: not all details are shown here. Just my general approach.