flat assembler
Message board for the users of flat assembler.

Index > Windows > NoteIt! - a Notepad replacement app

Author
Thread Post new topic Reply to topic
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Windows Notepad is proably one of most important applications in the system. It provides you with basic text editor functionality, it is simple and small. However, It has many limitations: famous 64KB limit, no replace function, and (at least in win9x) there are no even simple keyboard shortcuts, like Ctrl+S for saving. That's why I want to create my own replacement for that program. Of course I know that tere are many apps of this type (even some written in assembly, like EditHLA). But I think that writing such program would be good for me as an excercise of win32 API coding. And AFAIK there's no such program written in FASM Wink
Here's what I have now. The basic functionality is implemented (saving and opening fils, choosing font, etc). Can you test it? I would like it to be on examples section, but I want to finish it first.
Also, can you write what functions would you expect from a notepad replacement? I want it to be rather simple program, without any unneeded features...

regards,
Mateusz


Last edited by decard on 25 Jun 2004, 15:23; edited 1 time in total
Post 25 Jun 2004, 14:22
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
decard wrote:
Also, can you write what functions would you expect from a notepad replacement? I want it to be rather simple program, without any unneeded features...


He Decard.

My opinion about missing functions:

1. Search/Replace
2. Font diallog should allow only monospaced fonts.
3. Check for modified on exit.
4. Check for nonaned file on save (and open SaveAs dialog).
5. Drag&Drop files.
6. Command line parameters parseing/opening.
7. Word wrap ON/OFF
8. Save settings in INI file. (or at least use the same registry keys as original Notepad).

btw: windows Notepad is 52kbytes. Confused Wink

Regards.
Post 25 Jun 2004, 14:53
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
For me to even consider a replacement, it should use a custom control rather than richedit... otherwise I might as well go to a full-featured editor like editplus, textpad or ultraedit Smile

(PS: notepad on NT has search&replace, keyboard shortcuts, and no 64kb limit)
Post 25 Jun 2004, 15:23
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Thanks for your opinion, of course I had most of this points in my plans. Smile
Actually point 4 was just a bug: this behaviour was implemented, but it didn't work because of some further modification (fixed now)Wink

Quote:
8. Save settings in INI file. (or at least use the same registry keys as original Notepad).

So what is better: INI files or registry? I thought that INIs are outdated, but both FASMW and Fresh use them (AFAIK firstly FASMW was using registry)...

Quote:
btw: windows Notepad is 52kbytes.

Yeah, I was suprised too... what did they put there? More powerfil EditHLA is only 25KB. And FASMW, with custom edit control and built-in compiler has just 99kb... beautful example of assembler's advantages over C Very HappyVery Happy
Post 25 Jun 2004, 15:32
View user's profile Send private message Visit poster's website Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don
If the shortcuts you would like to improve in Notepad program, I've a tip to share with you. My window notepad has all I need for the shortcuts like saving, open, new, print, select all, find, ... Here is the screenshot my window Notepad.

Image
fig. 1 - File Menu and it's shotcuts

Image
fig. 2 - Edit Menu and it's shotcuts

Image
fig. 3 - Find Menu and it's shotcuts

The secret is I'm using Resource Hacker and PcPlus Helpdesk (See page 5) guide to modified Notepad program and enjoyed additional working shortcut.

Here is my Notepad Menu-1-1033 resource:
Code:
1 MENU
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
POPUP "&File"
{
  MENUITEM "&New\tCtrl+N",  9
  MENUITEM "&Open...\tCtrl+O",  10
     MENUITEM "&Save\tCtrl+S",  1
 MENUITEM "Save &As...",  2
    MENUITEM SEPARATOR
  MENUITEM "Page Se&tup...",  32
        MENUITEM "&Print\tCtrl+P",  14
       MENUITEM SEPARATOR
  MENUITEM "E&xit",  28
}
POPUP "&Edit"
{
      MENUITEM "&Undo\tCtrl+Z",  25
        MENUITEM SEPARATOR
  MENUITEM "Cu&t\tCtrl+X",  768,  GRAYED
       MENUITEM "&Copy\tCtrl+C",  769,  GRAYED
      MENUITEM "&Paste\tCtrl+V",  770,  GRAYED
     MENUITEM "De&lete\tDel",  771,  GRAYED
       MENUITEM SEPARATOR
  MENUITEM "Select &All\tCtrl+A",  7
   MENUITEM "Time/&Date\tF5",  12
       MENUITEM SEPARATOR
  MENUITEM "&Word Wrap\tCtrl+W",  27
}
POPUP "&Search"
{
      MENUITEM "&Find...\tCtrl+F",  3
      MENUITEM "Find &Next\tF3",  8
}
POPUP "&Help"
{
     MENUITEM "&Help Topics",  5
   MENUITEM SEPARATOR
  MENUITEM "&About Notepad",  11
}
}
    



And here is my Accelerator-1-1033 resource code:
Code:

1 ACCELERATORS
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
{
    VK_INSERT, 769, CONTROL, VIRTKEY
    VK_F1, 5, VIRTKEY
   VK_F3, 8, VIRTKEY
   VK_F5, 12, VIRTKEY
  VK_BACK, 25, ALT, VIRTKEY
   "^Z", 25
  "^X", 768
 "^C", 769
 "^V", 770
 "^N", 9
   "^O", 10
  "^S", 1
   "^P", 14
  "^A", 7
   "^W", 27
  "^F", 3
}
    


For time being you could enjoy it until we got a new Notepad project that decard is doing. I'm particulary interested in having notepad which is can break 64K limitation and still having common functions of the usual notepad features.

What makes more interesting on decard's Notepad, it is written in assembly and FASM. So, keep up the good works, decard...

greetings,

i-don.

ps - what make it bigger is probably the icon file resource and print preview dialog functions.
Post 25 Jun 2004, 18:37
View user's profile Send private message Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon
There is one suggestion i have. i found myself(until recently, frhex opened my eyes) using dos edit with the binary input and fixed width to view and edit files without the line breaks shown in windows text editors. If at all possible, think about your NoteIt having that extra edge over notepad with fixed width, binary input, and mabey(if time allows) virtical selection, like in fasm.
Post 26 Jun 2004, 00:03
View user's profile Send private message Visit poster's website Reply with quote
Quant



Joined: 15 Nov 2003
Posts: 13
Location: Turkey
Quant
Works fine for me (win2k sp4).

_________________
Regards...
Post 29 Jun 2004, 05:27
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
Quant



Joined: 15 Nov 2003
Posts: 13
Location: Turkey
Quant
If you solve the flickered window resizing, I want to learn the solution...

_________________
Regards...
Post 29 Jun 2004, 05:35
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
If I dont edit a file it says "You edited. wanna save?"..should fix that
Post 30 Jun 2004, 23:31
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Hi, thanks for the suggestions and opinions. Now the general behaviour is fixed. I added command line processing. Find/Replace still don't work but the "basement" for them is ready. Can you test if it works properly?

Well, this flickering is annoying me too... but I don't have any idea how to fix that. Can anybody give me some suggestion how to fix it?

asmdemon: what do you mean by binary input?

BTW: i-don, I was also using notepad tweaked with resHack Wink

regards
Post 01 Jul 2004, 11:47
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
Hi decard,
Some suggestions in order to do THE notepad-killer app:

1. Replace riched20 with asmedit
1.1. As it is now, in my system your app is more than 480 KB, not 5 KB as it seems.
1.2. Riched is the worst implementation I have ever seen in Windows. RaEdit is far better solution and is asm-written.
1.3. Any improvement in asmedit control will benefit also fasmw and fresh.

2. Regular Expression support. I know you are working on it for your string library. Very good.

3. Binary input: This is the only feature I miss on RaEdit form EditPlus. When you load a binary file, it does not change the value of any byte. For non printable chars, it shows a symbol. You can find and replace among non printable chars and save without altering the values.

In other words, if you load an icon file, then select all, copy and paste in a new empty file and save it, you obtain an icon again. This is not possible with neither notepad nor asmedit nor RaEdit,...

Thanks and good coding Smile
Post 01 Jul 2004, 12:59
View user's profile Send private message Yahoo Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
pelaillo wrote:
1.3. Any improvement in asmedit control will benefit also fasmw and fresh.


Yes, yes, yes... Wink I have one kilometer long list with wishes... The one who implement them will deserve my everlasting gratitude. Smile

btw: NoteIt seems to work good on my computer. Only, very strange, on the very first stat it crashed, but on next atempt it works OK and I can't repeat this crash, even trying to delete everything and restore from the archive.

Regards
Post 01 Jul 2004, 14:53
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
Mine works fine exept for saving. I think that it's not implemented yet so that is ok when it crashes on exit, when answering "YES" Very Happy
Post 01 Jul 2004, 15:25
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Madis731 wrote:
Mine works fine exept for saving. I think that it's not implemented yet so that is ok when it crashes on exit, when answering "YES" Very Happy


strange, under my system (win98SE) it works just fine. Can you post more info, where exactly it crashes?
Post 01 Jul 2004, 17:48
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Hi Pelaillo,
You convienced me to use something different than RichEdit Wink Proably AsmEdit will be a good choice. But I will stay with RichEdit for a while, it would be easier for me (until my program will have all Notepad features). Then I will add new features.
Unfortunatelly, despite holidays, I don't have enough time for my projects. Strange, I thought I will quickly make NoteIt at least as useful as Notepad, but there are so many things I have to do iunstead of programming... Sad

pelaillo wrote:
2. Regular Expression support. I know you are working on it for your string library. Very good.

actually I suspended this project a bit, I have to start it again, prepare myself better, learn something more about parsing expressions. But finally I will do it Smile

JohnFound wrote:
Only, very strange, on the very first stat it crashed, but on next atempt it works OK and I can't repeat this crash,

It is strange. But I had similar crash, and can't reproduce it too. :wink;
Post 01 Jul 2004, 18:07
View user's profile Send private message Visit poster's website Reply with quote
i-don



Joined: 18 Jul 2003
Posts: 66
i-don
Here is my feedback for the latest Noteit test:


  • Changing font cause the program 'think' the content of the file is modified. I think this can be improve the Richedit to ignore Font change.
  • When the save dialog appeared, only [IDYES] and [IDCANCEL] is handle. [IDNO] should be added. This section I got the crash.
  • Notepad like editor is not required font change or TrueType fonts availabilities. People just use it as 'Raw' editor or text reader/viewer. So having a fixed font would be a better choice. For e.g. "Fixedsys" or "Terminal" font is a good one for the purposes. Or you could include "Courier" and "Lucida" series if user want a little bit fancy OEM/DOS text fonts. And most of this fonts available in all windows system. And the first 2, able to display binary strings instead of blank space.


The 2nd version look better only the above minor glitches.

Hopefully my feedback would helps for the next version release.

Suggestion: Adding "ReadOnly" option would make this Noteit a better notepad replacement. Wink

greetings,

i-don.
Post 01 Jul 2004, 18:38
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
Ok, maybe the attached document helps
The saving has problems (no save neither save as work[no action])and I can't compile not knowing about "uglobal" Sad


Description: Dr Watson Log
2 crashes:
1) some source, but no error pointed out
2) no source!!!!!! (why??) only 00000000....

Download
Filename: drwtsn32.txt
Filesize: 8.35 KB
Downloaded: 173 Time(s)

Post 02 Jul 2004, 14:09
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon
decard wrote:
asmdemon: what do you mean by binary input?


What i mean is when notepad, wordpad or other word processing program encounters a line break or special chars(Tab, LF) it processes them instead of displaying the char. Binary input would not "interperate" the special chars and just display them.

open up an .exe in notepad, then use dos's edit with the binary option selected; this will show you what i mean.

_________________
It is better to be on the right side of the devil than in his path.
Post 02 Jul 2004, 21:41
View user's profile Send private message Visit poster's website Reply with quote
h4ng4m3



Joined: 25 Jun 2003
Posts: 21
h4ng4m3
hi decard, it crashed on windows 2000 pro sp4
get last version on decard.org
Post 31 Jul 2005, 02:44
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.