Hi,
Does anyone knows the maximum file size that notepad can handle? I can open a couple of MB. But what's the safe value without getting an error?
Kind regards,
JKepler
Printable View
Hi,
Does anyone knows the maximum file size that notepad can handle? I can open a couple of MB. But what's the safe value without getting an error?
Kind regards,
JKepler
I think it can open a lot more but it's slow. Wordpad is much faster.
Hi,
You're entirely right regarding Wordpad speed. Thanks.
Kind regards,
JKepler
FYI. Notepad uses a standard Edit control. This is a pre-defined window class. As such it has pre-defined limits but can be modified. In order to know what the "safe" limit is, one has to query the control to get that limit
Oh, WordPad also uses a pre-defined window class: Rich Edit Control
@Lord Orwell
Not arguing... I'd think the limit would be about 4GB theoretically. The EM_SETLIMITTEXT message on 32bit machines is a Long value; thereby making its maximum value ~2^32. But it also may be dependent upon O/S (Win9x vs NT-based). However, MSDN docs specifically indicate you can exceed whatever limit by simply 'pasting' more code at the end of the document. System memory will most likely be in play too.
@jkepler
You'd have to get the hWnd of the NotePad text window, then use SendMessage API to send it a EM_GETLIMITTEXT message.
More DetailsLooking at the MSDN documentation above, it appears the high bit of the Long value for EM_SETLIMITTEXT may be reserved which could mean the maximum limit may be ~2GB. Also, out of curiosity, I sent a new Notepad instance the message and it returned a value of -1. Though none of the above really means squat. Even if you try to open a 500+ MB file, Notepad will tell you to use another editor. Though I opened an 18MB file with no issues. Even though the Edit control's limitation may exceed the bytes being read, Notepad itself may have set restrictions on file sizes.Quote:
Originally Posted by MSDN