Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


go98

tiny patch for Notepad

26 posts in this topic

Maybe there are a few hardcore users here who, like me, like the original notepad. The good thing about it is that it knows its own limits and transfers control to wordpad for larger files...BUT...who needs the question "...do you want to open it in wordpad instead?", of course you want to open the file since you just clicked it!!

I count this as "bug", so to patch it you just have to hex-edit:

At address (offset) 33A5: 6A 24 (A1 B4 50 ...) (My english version of windows 98 SE is lost, so this is the address in my localized version)

change 6A 24 to EB 19

This bypasses the dialog and just opens the file in wordpad if the file is too big for notepad.

And if you want to transfer control to another more powerful application, change the text "wordpad.exe" (search hex for 77 00 6F 00 72) and a few "Wordpad" (search hex for 57 00 6F 00 72) for something else with same number of letters, or use a resource editor instead...

0

Share this post


Link to post
Share on other sites

Having availability, you can get the same result using the Windows ME version of notepad. No window dialog to manage, just like your hint.

0

Share this post


Link to post
Share on other sites

Apologize if i'm hijacking this topic (and i liked Notepad as well, for it's clean, simple, fast interface/behavior). But to me, the whole 64k/Wordpad issue just felt awfully kludgy, even with fixes. (After all, Wordpad isn't Notepad -- it's a primitive MS Word!) And i began to feel restircted in what i could do with Notepad -- i began wishing for a bit more functionality.

So looking for a small, fast, general-purpose, increased-capability but not-overwhelming alternative, i found Win32pad: http://www.gena01.com/win32pad/

- Executable size: 55k (not that it matters all that much).
- All Notepad menu items & shortcut keys (a few in different places).
- Additional features/functions (including "Redo").
- Appearance very similar to Notepad (can be customized).
- No 64k filesize limit (filesize limit is available memory).

- Freeware.
- Download as .exe installer or .zip archive.

Note: Requires a few dependency .dlls (available on download page) if not already on your system.

If desired, rename "Win32pad.exe" to "Notepad.exe" and copy to Windows\ folder like i did. :)

Edit: Also copy "win32pad.hlp" and "win32pad.cnt" to the Windows\Help\ folder -- no need to rename these files.

I've never looked back....

- Doug B.

Edited by DougB
0

Share this post


Link to post
Share on other sites

If you want definitely to keep the original Notepad, Commodore is right: Millenium Notepad is better.

But you will find several beneficial replacement with a lot more of features, than you will be able to run by simply renaming them as "notepad.exe"

I'm using for years the incredible metapad (190 KB) [http://liquidninja.com/metapad].

BTW, it has been updated, and the new 3.6 version is running fine in Win9x

0

Share this post


Link to post
Share on other sites

Thanks for the heads up, Charles, didn't know there was an update although it's a couple years old. Source code is available too and I see an attempt at making it Unicode-aware. Unfortunately I couldn't modify it to create a Unicode RichEdit control although I have built a similar application myself in AutoHotkey which can even load a RichEdit50W control if available in 9x.

Anyway, I've been using Metapad as main editor (renamed as Notepad) for as long as I know, even in XP. Hopefully the new UTF-8 capability will alow correct file conversion, which I was missing.

0

Share this post


Link to post
Share on other sites

Hi Drugwash,

I'm afraid it's not that simple.

In my tests, even this new metapad is unable to decode/encode in UTF-8!

What I have found is that he's only reading or adding the "" header at the beginning of the file to tell that it is UTF-8, but no more.

The previous 3.5 version was not recognizing it and even overwriting it when saving the file.

FWIW

Portability was also added, that can be great on a usb key,

but the metapad.ini file generated by the metapad.exe /m command used to migrate all registry settings needs to be completed manually...

It remains the new high resolution icons... :whistle:

0

Share this post


Link to post
Share on other sites

Yes, I've noticed certain settings are not ported over when migrating to ini, especially the WordWrap option. I may look into that sometime but considering my very bad memory, don't hold your breath. :blushing:

I haven't yet tested the UTF-8 capability. Since it's been a patch from someone esle - as noted on Alex's blog - it may well be incomplete. I'm so angry on myself for not having learned C/C++ in due time, otherwise it would've been so easy to fix/improve a lot of code offered freely by the good people. But I'll try, maybe even contact Alex for some tips.

In the mean time I've managed to build metapad in VC6 but it needs extensive testing to make sure it works correctly. The new icon is a major pain because VC6 won't recognize it so I had to rename the original, delete a few images, save it, compile with the modified icon and then replace it in ResHacker (newer version, because the older one would bail out). The manifest needs to be added afterwards too in ResHacker.

(edited for typo)

Edited by Drugwash
0

Share this post


Link to post
Share on other sites

After reading the 'Problems & Limitations' page I'm gonna stick to Metapad. ;)

0

Share this post


Link to post
Share on other sites

metapad is awesome.

It has much more features than any one else of those lightweight notepad replacement!

 

BTW if you use the Dll language plugin, you need to indicate its complete path in metapad which changes constantly if you run metapad on an USB key.

So, I have translated directly the exe file with Resource Hacker (and a few more strings in an hexadecimal editor) to get metapad in my own language with only 1 file.

Edited by CharlesF
0

Share this post


Link to post
Share on other sites

I've never used a translation with Metapad. Although I have contributed a few translations for certain softwares back in the day, I realised that most of the times translations won't work. Certain languages have very long words and expressions that simply won't fit their corresponding controls (Statics, Buttons, Checkboxes, Radio buttons etc.) and abbreviations would only make things worse.

Just for the sake of testing I loaded the italian translation in Metapad and on opening the Settings (Impostazioni) dialog there are about four cropped checkbox strings in first tab and about four or five cropped or abbreviated on fourth tab.

My language also has many lengthy words and expressions so it'd be a waste of time translating unless I make the whole dialog larger, together with resizing the controls, then recompiling the application.

 

I've also noticed the UTF-8 issue which doesn't convert the text at all in/out. And it really bugs me out that Unicode suport is not full, so for example if I drag Chinese/Japanese/Russian/etc. text to/from Metapad I'll only get question marks. That's due to the issue I mentioned somewhere above, that is the application is creating an ANSI RichEdit control, not a Unicode one which does work fine even under Win9x (see MyDiary at my repository and check control type using PIG - also one of my tools: metapad uses RichEdit20A while I'm using RichEdit20W or RICHEDIT50W if available through msftedit.dll). However, modifying the whole Metapad code to work with Unicode RichEdit is a bit beyond my C knowledge. I also find using a library for a translation to be an overkill (just like eMule used to have back when I maintained its translation) - a simple text file would do just fine (see SlimBrowser which I also used to translate a long time ago before it went all Unicode).

0

Share this post


Link to post
Share on other sites

Hi Drugwash,

 

unless I make the whole dialog larger, together with resizing the controls, then recompiling the application.

Yes, it is what I did, but you don't need to recompile, everything can be done from inside Resource Hacker.

 

If you want check with my language Dll, you will see: Français (French) for Metapad 3.6

The translated "all-in-one" exe has been uploaded here: Metapad v 3.6 (Fr) (same result but with one file).

 

I've also noticed the UTF-8 issue which doesn't convert the text at all in/out. And it really bugs me out that Unicode suport is not full

You are right, I was notifying it in my previous post #6.

 

But still, metapad is a very nice program to use in Win9x, with a bunch of features for his light weight.

0

Share this post


Link to post
Share on other sites

Resource Hacker has become an ugly useless chunk of code. :( Old 9x-compatible versions can't deal with x64 binaries and other limitations while newer 9x-incompatible 4.x versions are buggy, ugly and completely unintuitive. I am trying to avoid it as much as possible. And then, the source code for Metapad is available. It's a sacrilege to hack the executable when you can elegantly fix the code. ;)

 

Speaking of fixes, I took on fully implementing UTF-8 but it's not going as smoothly as I thought/hoped. But I'm still pushing the rock uphill. I may look at registry <-> ini migration too at some point, as soon as I understand what's going on there and if those settings were left aside for a purpose or were just forgotten. There is one thing that makes everything harder: the two versions of Metapad. The LE edition uses a simple Edit control while the full edition uses RichEdit. Certain options/settings are not available from one edition to another so there may have been a common selection or just an overlook.

 

I've seen your translation already, actually I downloaded them all as a paranoid collector that I am. :) Sadly my French is not as good as my English or my Italian (but I can still tell apart OK from Cancel, at least :D ).

 

Unfortunately a Unicode RichEdit that could allow full Unicode is too hard for me to implement. Most likely all buffers would need doubled, text size should be measured in TCHARS and a lot of other changes I may not even be aware of. Since my knowledge of C/C++ is limited to what I gathered here and there as a self-taught hobbyist I'd rather not bite more than I could chew (which I may already have done  :blushing:  ).

 

I've chosen Metapad years ago for a single major reason: the Save button in the toolbar. Besides its lightweight, of course. And the 'Undo'/'Redo' options are also a big plus. Did Microsoft ever think to add such highly needed options in a straightforward manner to their lame Notepad? I bet they didn't, not even in Win10 - someone please slap me in the face if I'm wrong. Hence the logical choice.

 

And no, Wordpad is not a choice for simple text files. Although admittedly it does employ a Unicode RichEdit (even v5.0) but only under NT-based systems (at least XP where I just checked).

0

Share this post


Link to post
Share on other sites

Let me put it this way: is there any simple text editor out there that can take a copy/paste from a Unicode-aware application (JWPce, for example) and display the Unicode text correctly under 9x? Because Notepad can't, Metapad can't, Akelpad can't…

 

Notepad2-mod can, actually, but only with certain font (for me it worked with Arial Unicode MS) and it has serious text selection/alignment problems. Weirdly, similarly to Notepad+ (IIRC) it uses a ListView control instead of a RichEdit control. Unfortunately, due to the alignment issues (and possibly others) it can't be used in programming.

 

I think I'm gonna end up writing my own editor, someday…

0

Share this post


Link to post
Share on other sites

Yeah, Unicode is a always a challenge in Win 9x.

That's why I was already glad of this tiny improvement of metapad in UTF-8.... :whistle:

Edited by CharlesF
0

Share this post


Link to post
Share on other sites

Akelpad sure can do it, try again. Of course you need an adequate font selected (Arial Unicode MS is fine), then you can save your text file in a variety of unicode encoding or as ANSI 932 - Shift-JIS.

 

There won't be any text editor that will automatically select the right font, for this you need to copy as rich text and paste in a rich text editor such as Polyedit Lite.

0

Share this post


Link to post
Share on other sites

Yeah, Unicode is a always a challenge in Win 9x.

That's why I was already glad of this tiny improvement of metapad in UTF-8.... :whistle:

 

Akelpad supports UTF-7, UTF-8, UTF-16 and UTF-32 as well as a large variety of ANSI encodings. Encoding options in the open/save dialog or by right-clicking the encoding field in the status bar.

0

Share this post


Link to post
Share on other sites

Akelpad sure can do it, try again. Of course you need an adequate font selected (Arial Unicode MS is fine), then you can save your text file in a variety of unicode encoding or as ANSI 932 - Shift-JIS.

 

There won't be any text editor that will automatically select the right font, for this you need to copy as rich text and paste in a rich text editor such as Polyedit Lite.

Indeed it can, my bad.  :blushing:  Forgot to select the font first.

 

However, I believe a smart editor can select a Unicode font at least when Unicode text is pasted from clipboard or dragged over. At the very least it could ask the user if they want the text as ANSI (current code page) or Unicode, because clipboard always contains both versions and there are APIs to check clipboard contents.

 

Oh and another thing I just checked (hopefully I'm not wrong again): OS version is English, regional settings are Romanian, I switched keyboard layout to Russian (Japanese IME is not enabled in Akelpad) and the text comes out garbled - the editor doesn't take into account that we are on an ANSI OS with a keyboard layout that doesn't match either OS language or regional language, which should've triggered at least an ANSI codepage conversion if not direct Unicode input. I mean, I can type both Russian and Japanese in an Office document under 98SE - why would it be so hard for other editors to do that? Oh, because nobody cares about 9x anymore, right… :}

0

Share this post


Link to post
Share on other sites

However, I believe a smart editor can select a Unicode font at least when Unicode text is pasted from clipboard or dragged over. At the very least it could ask the user if they want the text as ANSI (current code page) or Unicode, because clipboard always contains both versions and there are APIs to check clipboard contents.

 

And which Unicode font is it going to choose? It would need to parse all installed fonts to select one  that has got a corresponding unicode plane. AFAIK (I might be wrong) no text editor does this regardless of OS.

 

The closest to this is probably Babelpad  adequately  configured  in composite font mode.

 

I would not know anything about the rest as i don't use IME but I suspect that if you select the right codepage (or some UTF flavor) in Akelpad it might work OK.

Edited by loblo
0

Share this post


Link to post
Share on other sites

Akelpad supports UTF-7, UTF-8, UTF-16 and UTF-32 as well as a large variety of ANSI encodings. Encoding options in the open/save dialog or by right-clicking the encoding field in the status bar.

 

Indeed Akelpad is very impressive.

I will give it a further exploration.

0

Share this post


Link to post
Share on other sites

 

However, I believe a smart editor can select a Unicode font at least when Unicode text is pasted from clipboard or dragged over. At the very least it could ask the user if they want the text as ANSI (current code page) or Unicode, because clipboard always contains both versions and there are APIs to check clipboard contents.

 

And which Unicode font is it going to choose? It would need to parse all installed fonts to select one  that has got a corresponding unicode plane. AFAIK (I might be wrong) no text editor does this regardless of OS.

 

The closest to this is probably Babelpad  adequately  configured  in composite font mode.

 

I would not know anything about the rest as i don't use IME but I suspect that if you select the right codepage (or some UTF flavor) in Akelpad it might work OK.

 

Many applications lose userbase because of badly chosen defaults and unintuitive behavior.

 

One can choose a default codepage, a codepage for new file but it's of no use - still garbled text. Moreover, once there's English text and Japanese text in the same window/document it appears very clear that document should be treated as Unicode. Still, input from keyboard layout other than system default will appear in the default ANSI encoding, regardless even of the chosen font's codepage.

 

I have Babelpad 1.9.3 built in 2005 but couldn't get it to do the job. I'll let this rest for now.

0

Share this post


Link to post
Share on other sites

The main problem I have with Notepad, that still continues to this day, is opening text files with Unix-style line endings. Of course Wordpad and stuff like Notepad++ can handle them, but it would be so convenient if good ol' regular Notepad could display newlines correctly when I double-click the file.

0

Share this post


Link to post
Share on other sites

it would be so convenient if good ol' regular Notepad could display newlines correctly when I double-click the file.

Choose a Notepad replacement like one of the above, rename it 'Notepad.exe' and drop it in place of the original. You will enjoy the 'good old Notepad' with so many more features ;)

metapad for this purpose is very light in one file, that means fast.

 

You could even use a reg patch to open any non-associated file in Notepad by default.

Edited by CharlesF
0

Share this post


Link to post
Share on other sites

On a side note, I recently got a query about the asterisk in Notepad indicating a change in file content. On checking I found that in all the versions I checked, XP, W7, W8, and W8.1 the native notepad.exe had NO asterisk! Apparently, Ms finally learned that folks like that and added it to W10! My friend had been using a modded XP which I'd substituted Notepad2 for the original many many years ago. Both Notepad2 and Notepad++ sport that asterisk. I prefer Notepad++ for just about everything, though I have't played with many others like EditPlus, MetaPad, or AkelPad, though I've used and like TextPad. :^)

 

Drugwash, let us know if you code an editor, okay?

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.