I used notepad2, a notebook that supports syntax highlighting for a long time, but it was a very early version and has been written into Chinese. After that, I found the Help menu bar on the official website notepad2, and gained a lot. It seems that the spirit of open source outside China has to be admired! Web site tell everyone: http://www.flos-freeware.ch/notepad2.html
The latest version is notepad2 4.1.24, including the source code.
The effect is as follows:
So I was excited to see if I could compile it. A notepad2.sln project file in it must be spam. In the face of such a complicated dependency, it was difficult to compile it. Besides, I found that a very important source code file was missing, I think it is difficult to succeed only by using this project file. Coincidentally, the wdkbuild folder contains a command line file, which is better, and the dependency between the source files becomes clearer.
@ Echo off </P> <p> REM set wdkbasedir = C:/winddk/7600.16385.1 <br/> set wdkbasedir = D: /programme/Microsoft wdk7 </P> <p> set include = % wdkbasedir %/INC/CRT; % wdkbasedir %/INC/API; % wdkbasedir %/INC/API/CRT/stl60; % wdkbasedir %/INC/DDK <br/> set Lib = % wdkbasedir %/lib/CRT/i386; % wdkbasedir %/lib/win7/i386 <br/> set libpath = <br/> set vscomntools = </P> <p> MD ".. /release "<br/> Del ".. /release /*. OBJ "<br/> Del ".. /release /*. EXE "<br/> Del ".. /release /*. PDB "<br/> Del ".. /release /*. IDB "</P> <p>" % wdkbasedir %/bin/x86/x86/cl.exe "@cl.txt <br/>" % wdkbasedir %/bin/x86/rc.exe "/fo ".. /release/notepad2.res "".. /src/notepad2.rc "<br/>" % wdkbasedir %/bin/x86/x86/link.exe "@link.txt <br/>
I checked whether the winddk driver is used or the new version of ddk7.1, so I had to install it. From this we can see that this is very important, otherwise it will be too much trouble to compile with vs, hey.
For more information, see the first few sentences of cl.txt.
/FO ".. /release/"/I ".. /scintilla/include "/I ".. /scintilla/src "/I ".. /scintilla/Win32 "/D" static_build "/D" sci_lexer "/D" Win32 "/D" _ WINDOWS "/D" ndebug "/D" _ Unicode "/D" unicode "/C/ehs/ GF/MD/O1/OS/W3
/TP "../scintilla/Win32/platwin. cxx"
/TP "../scintilla/Win32/scintillawin. cxx"
/TP "../scintilla/src/autocomplete. cxx"
...........
I found a very important folder, scintilla. Why didn't I find this folder? I searched the internet and found that it was a well-known syntax highlight package, in which notepad2 used this package (the website http://www.scintilla.org/also has instructions ).
Download the file, copy the scintilla folder to the same folder as wdkbuil, and click build. run the CMD batch processing (you can add some pause in it to pause, so as to avoid a flash, such as adding pause after the CL line and adding pause after the link line ).
There have been many problems, mainly starting from the edit. C (1867): Error C2001: newline in constant error (the warning should be ignored first ).
Open the file and look at strchr (L "'?, Psztextw [I]) This sentence may have a problem. Let's take a look at it and change it to strchr (L "", psztextw [I]). Well, let's get it done here, there are only a few warnings that are not a problem with the conversion of executable files.
Click link again.
Here, there are more problems. For more details, we mainly focus on keywords. obj. It may be that some of keywords. cxx are not accessible. Well, this is the case. There is no way to translate the link_lexer (***) of the keywords. cxx file from row 333rd to row 427.
After the compilation is successful, notepad2.exe OK is run, not to mention bugs, at leastProgramIt is no longer a problem to make necessary changes within your control.