diff --git a/Version.ps1 b/Version.ps1
index 238a22681..c4e968acb 100644
--- a/Version.ps1
+++ b/Version.ps1
@@ -33,7 +33,7 @@ function DebugOutput($msg)
try
{
$AppName = "Notepad3"
- $Major = 6
+ $Major = 7
$Minor = [int]$(Get-Date -format yy)
$Revis = [int]$(Get-Date -format Mdd)
diff --git a/language/np3_af_za/resource.h b/language/np3_af_za/resource.h
index 949aa354c..f9dc5242a 100644
--- a/language/np3_af_za/resource.h
+++ b/language/np3_af_za/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_af_za.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_be_by/resource.h b/language/np3_be_by/resource.h
index 77b4210e4..e91286419 100644
--- a/language/np3_be_by/resource.h
+++ b/language/np3_be_by/resource.h
@@ -3,10 +3,10 @@
// Used by dialogs_be_by.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_de_de/resource.h b/language/np3_de_de/resource.h
index 0d4479871..d1c070a26 100644
--- a/language/np3_de_de/resource.h
+++ b/language/np3_de_de/resource.h
@@ -3,10 +3,10 @@
// Used by np3_de_de.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_el_gr/resource.h b/language/np3_el_gr/resource.h
index 6e399a41c..34072bb71 100644
--- a/language/np3_el_gr/resource.h
+++ b/language/np3_el_gr/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_en_gb/resource.h b/language/np3_en_gb/resource.h
index 6e399a41c..34072bb71 100644
--- a/language/np3_en_gb/resource.h
+++ b/language/np3_en_gb/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_en_us/resource.h b/language/np3_en_us/resource.h
index b2a6e4a17..75d36aed9 100644
--- a/language/np3_en_us/resource.h
+++ b/language/np3_en_us/resource.h
@@ -3,10 +3,10 @@
// Used by strings_en_us.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_es_es/resource.h b/language/np3_es_es/resource.h
index cd1d5201a..1d0a17c27 100644
--- a/language/np3_es_es/resource.h
+++ b/language/np3_es_es/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_es_es.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_fi_fi/resource.h b/language/np3_fi_fi/resource.h
index 6e399a41c..34072bb71 100644
--- a/language/np3_fi_fi/resource.h
+++ b/language/np3_fi_fi/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_fr_fr/resource.h b/language/np3_fr_fr/resource.h
index bb497874c..c2937195f 100644
--- a/language/np3_fr_fr/resource.h
+++ b/language/np3_fr_fr/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_fr_fr.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_hi_in/resource.h b/language/np3_hi_in/resource.h
index 6e399a41c..34072bb71 100644
--- a/language/np3_hi_in/resource.h
+++ b/language/np3_hi_in/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_hu_hu/resource.h b/language/np3_hu_hu/resource.h
index fb4d25440..46771933b 100644
--- a/language/np3_hu_hu/resource.h
+++ b/language/np3_hu_hu/resource.h
@@ -3,10 +3,10 @@
// Used by strings_hu_hu.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_id_id/resource.h b/language/np3_id_id/resource.h
index 6e399a41c..34072bb71 100644
--- a/language/np3_id_id/resource.h
+++ b/language/np3_id_id/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_it_it/resource.h b/language/np3_it_it/resource.h
index 28450016c..061088dd5 100644
--- a/language/np3_it_it/resource.h
+++ b/language/np3_it_it/resource.h
@@ -3,10 +3,10 @@
// Used by np3_it_it.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_ja_jp/resource.h b/language/np3_ja_jp/resource.h
index 1196bb00c..c723cc8c7 100644
--- a/language/np3_ja_jp/resource.h
+++ b/language/np3_ja_jp/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch strings_ja_jp.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_ko_kr/resource.h b/language/np3_ko_kr/resource.h
index 51ccef22e..1ce91e05a 100644
--- a/language/np3_ko_kr/resource.h
+++ b/language/np3_ko_kr/resource.h
@@ -3,10 +3,10 @@
// Used by menu_ko_kr.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_nl_nl/resource.h b/language/np3_nl_nl/resource.h
index 650eb6631..840180eef 100644
--- a/language/np3_nl_nl/resource.h
+++ b/language/np3_nl_nl/resource.h
@@ -3,10 +3,10 @@
// Used by dialogs_nl_nl.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_pl_pl/resource.h b/language/np3_pl_pl/resource.h
index 8167dede0..efdacef24 100644
--- a/language/np3_pl_pl/resource.h
+++ b/language/np3_pl_pl/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_pl_pl.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_pt_br/resource.h b/language/np3_pt_br/resource.h
index b9418ec3d..5bb589697 100644
--- a/language/np3_pt_br/resource.h
+++ b/language/np3_pt_br/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch encode_pt_br.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_pt_pt/resource.h b/language/np3_pt_pt/resource.h
index 6e399a41c..34072bb71 100644
--- a/language/np3_pt_pt/resource.h
+++ b/language/np3_pt_pt/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_ru_ru/resource.h b/language/np3_ru_ru/resource.h
index d77556929..d83a405c5 100644
--- a/language/np3_ru_ru/resource.h
+++ b/language/np3_ru_ru/resource.h
@@ -3,10 +3,10 @@
// Used by dialogs_ru_ru.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_sk_sk/resource.h b/language/np3_sk_sk/resource.h
index 9a3e01ec3..510b88789 100644
--- a/language/np3_sk_sk/resource.h
+++ b/language/np3_sk_sk/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_sk_sk.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_sv_se/resource.h b/language/np3_sv_se/resource.h
index 542a151ff..3fdef7eb9 100644
--- a/language/np3_sv_se/resource.h
+++ b/language/np3_sv_se/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_sv_se.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_tr_tr/resource.h b/language/np3_tr_tr/resource.h
index acc5dfcd4..6004f847c 100644
--- a/language/np3_tr_tr/resource.h
+++ b/language/np3_tr_tr/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch menu_tr_tr.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_vi_vn/resource.h b/language/np3_vi_vn/resource.h
index 6e399a41c..34072bb71 100644
--- a/language/np3_vi_vn/resource.h
+++ b/language/np3_vi_vn/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_zh_cn/resource.h b/language/np3_zh_cn/resource.h
index 3d7093cf8..b1af26022 100644
--- a/language/np3_zh_cn/resource.h
+++ b/language/np3_zh_cn/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch strings_zh_cn.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/language/np3_zh_tw/resource.h b/language/np3_zh_tw/resource.h
index 6e399a41c..34072bb71 100644
--- a/language/np3_zh_tw/resource.h
+++ b/language/np3_zh_tw/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch np3_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/lexilla/Lexilla.vcxproj b/lexilla/Lexilla.vcxproj
index c601956b8..49d0b5b95 100644
--- a/lexilla/Lexilla.vcxproj
+++ b/lexilla/Lexilla.vcxproj
@@ -322,7 +322,7 @@
Level4
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
true
@@ -358,7 +358,7 @@
true
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
true
@@ -401,7 +401,7 @@
true
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
true
@@ -442,7 +442,7 @@
Level4
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
true
@@ -476,7 +476,7 @@
Level4
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
true
@@ -513,7 +513,7 @@
true
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
true
@@ -555,7 +555,7 @@
true
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
true
@@ -597,7 +597,7 @@
true
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
true
@@ -640,7 +640,7 @@
true
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;SCI_LEXER;_CRT_SECURE_NO_WARNINGS;STATIC_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
stdcpp20
true
diff --git a/minipath/language/mp_af_za/resource.h b/minipath/language/mp_af_za/resource.h
index 4f8f45317..a1d0d0c02 100644
--- a/minipath/language/mp_af_za/resource.h
+++ b/minipath/language/mp_af_za/resource.h
@@ -3,10 +3,10 @@
// Used by mp_af_za.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_be_by/resource.h b/minipath/language/mp_be_by/resource.h
index 77b4210e4..e91286419 100644
--- a/minipath/language/mp_be_by/resource.h
+++ b/minipath/language/mp_be_by/resource.h
@@ -3,10 +3,10 @@
// Used by dialogs_be_by.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_de_de/resource.h b/minipath/language/mp_de_de/resource.h
index c1c6e7267..42b1cbd9b 100644
--- a/minipath/language/mp_de_de/resource.h
+++ b/minipath/language/mp_de_de/resource.h
@@ -3,10 +3,10 @@
// Used by mp_de_de.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_el_gr/resource.h b/minipath/language/mp_el_gr/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_el_gr/resource.h
+++ b/minipath/language/mp_el_gr/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_en_gb/resource.h b/minipath/language/mp_en_gb/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_en_gb/resource.h
+++ b/minipath/language/mp_en_gb/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_en_us/resource.h b/minipath/language/mp_en_us/resource.h
index a8a58ddda..1ba1ad121 100644
--- a/minipath/language/mp_en_us/resource.h
+++ b/minipath/language/mp_en_us/resource.h
@@ -3,10 +3,10 @@
// Used by np3_en_us.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_es_es/resource.h b/minipath/language/mp_es_es/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_es_es/resource.h
+++ b/minipath/language/mp_es_es/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_fi_fi/resource.h b/minipath/language/mp_fi_fi/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_fi_fi/resource.h
+++ b/minipath/language/mp_fi_fi/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_fr_fr/resource.h b/minipath/language/mp_fr_fr/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_fr_fr/resource.h
+++ b/minipath/language/mp_fr_fr/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_hi_in/resource.h b/minipath/language/mp_hi_in/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_hi_in/resource.h
+++ b/minipath/language/mp_hi_in/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_hu_hu/resource.h b/minipath/language/mp_hu_hu/resource.h
index ba7ff9140..596db3173 100644
--- a/minipath/language/mp_hu_hu/resource.h
+++ b/minipath/language/mp_hu_hu/resource.h
@@ -3,10 +3,10 @@
// Used by mp_hu_hu.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_id_id/resource.h b/minipath/language/mp_id_id/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_id_id/resource.h
+++ b/minipath/language/mp_id_id/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_it_it/resource.h b/minipath/language/mp_it_it/resource.h
index 2b6bd688b..2d5b7b6a6 100644
--- a/minipath/language/mp_it_it/resource.h
+++ b/minipath/language/mp_it_it/resource.h
@@ -3,10 +3,10 @@
// Used by mp__it_it.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_ja_jp/resource.h b/minipath/language/mp_ja_jp/resource.h
index 4aacfe7dc..10372faa2 100644
--- a/minipath/language/mp_ja_jp/resource.h
+++ b/minipath/language/mp_ja_jp/resource.h
@@ -3,10 +3,10 @@
// Used by mp_ja_jp.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_ko_kr/resource.h b/minipath/language/mp_ko_kr/resource.h
index 9c3c926b3..ff42d25fb 100644
--- a/minipath/language/mp_ko_kr/resource.h
+++ b/minipath/language/mp_ko_kr/resource.h
@@ -3,10 +3,10 @@
// Used by mp_ko_kr.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_nl_nl/resource.h b/minipath/language/mp_nl_nl/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_nl_nl/resource.h
+++ b/minipath/language/mp_nl_nl/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_pl_pl/resource.h b/minipath/language/mp_pl_pl/resource.h
index a66fd02f1..6710c2c2b 100644
--- a/minipath/language/mp_pl_pl/resource.h
+++ b/minipath/language/mp_pl_pl/resource.h
@@ -3,10 +3,10 @@
// Used by mp_pl_pl.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_pt_br/resource.h b/minipath/language/mp_pt_br/resource.h
index 6feafecad..b7944d9ef 100644
--- a/minipath/language/mp_pt_br/resource.h
+++ b/minipath/language/mp_pt_br/resource.h
@@ -3,10 +3,10 @@
// Used by mp_pt_br.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_pt_pt/resource.h b/minipath/language/mp_pt_pt/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_pt_pt/resource.h
+++ b/minipath/language/mp_pt_pt/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_ru_ru/resource.h b/minipath/language/mp_ru_ru/resource.h
index d77556929..d83a405c5 100644
--- a/minipath/language/mp_ru_ru/resource.h
+++ b/minipath/language/mp_ru_ru/resource.h
@@ -3,10 +3,10 @@
// Used by dialogs_ru_ru.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_sk_sk/resource.h b/minipath/language/mp_sk_sk/resource.h
index c25e35e52..ac72b01b6 100644
--- a/minipath/language/mp_sk_sk/resource.h
+++ b/minipath/language/mp_sk_sk/resource.h
@@ -3,10 +3,10 @@
// Verwendet durch menu_sk_sk.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_sv_se/resource.h b/minipath/language/mp_sv_se/resource.h
index 6e4788715..85170151f 100644
--- a/minipath/language/mp_sv_se/resource.h
+++ b/minipath/language/mp_sv_se/resource.h
@@ -3,10 +3,10 @@
// Used by mp_sv_se.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_tr_tr/resource.h b/minipath/language/mp_tr_tr/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_tr_tr/resource.h
+++ b/minipath/language/mp_tr_tr/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_vi_vn/resource.h b/minipath/language/mp_vi_vn/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_vi_vn/resource.h
+++ b/minipath/language/mp_vi_vn/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_zh_cn/resource.h b/minipath/language/mp_zh_cn/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_zh_cn/resource.h
+++ b/minipath/language/mp_zh_cn/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/language/mp_zh_tw/resource.h b/minipath/language/mp_zh_tw/resource.h
index feb96549d..00f35e287 100644
--- a/minipath/language/mp_zh_tw/resource.h
+++ b/minipath/language/mp_zh_tw/resource.h
@@ -3,10 +3,10 @@
// Used by mp_en_gb.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// Next default values for new objects
diff --git a/minipath/res/MiniPath.exe.manifest b/minipath/res/MiniPath.exe.manifest
index d00fa0e39..1b5f571eb 100644
--- a/minipath/res/MiniPath.exe.manifest
+++ b/minipath/res/MiniPath.exe.manifest
@@ -24,10 +24,7 @@
-
-
-
-
+
diff --git a/minipath/src/Dialogs.c b/minipath/src/Dialogs.c
index ee5eea2e6..30fe39892 100644
--- a/minipath/src/Dialogs.c
+++ b/minipath/src/Dialogs.c
@@ -14,10 +14,10 @@
* *
*******************************************************************************/
+#include
#if !defined(_WIN32_WINNT)
-#define _WIN32_WINNT 0x601
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
-#define _WIN32_IE 0x0700
#define OEMRESOURCE // use OBM_ resource constants
#define VC_EXTRALEAN 1
#define WIN32_LEAN_AND_MEAN 1
diff --git a/minipath/src/Dlapi.c b/minipath/src/Dlapi.c
index 837b636ab..4af608e58 100644
--- a/minipath/src/Dlapi.c
+++ b/minipath/src/Dlapi.c
@@ -13,7 +13,10 @@
* *
* *
*******************************************************************************/
-#define _WIN32_WINNT 0x601
+#include
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
+#endif
#include
#include
#include
@@ -99,7 +102,18 @@ BOOL DirList_Init(HWND hwnd,LPCWSTR pszHeader)
// Icon thread control
lpdl->hExitThread = CreateEvent(NULL,TRUE,FALSE,NULL);
+ if (!lpdl->hExitThread) {
+ RemoveProp(hwnd,pDirListProp);
+ GlobalFree(lpdl);
+ return FALSE;
+ }
lpdl->hTerminatedThread = CreateEvent(NULL,TRUE,TRUE,NULL);
+ if (!lpdl->hTerminatedThread) {
+ CloseHandle(lpdl->hExitThread);
+ RemoveProp(hwnd,pDirListProp);
+ GlobalFree(lpdl);
+ return FALSE;
+ }
UNUSED(pszHeader);
@@ -120,8 +134,12 @@ BOOL DirList_Destroy(HWND hwnd)
// Release multithreading objects
DirList_TerminateIconThread(hwnd);
- CloseHandle(lpdl->hExitThread);
- CloseHandle(lpdl->hTerminatedThread);
+ if (lpdl->hExitThread) {
+ CloseHandle(lpdl->hExitThread);
+ }
+ if (lpdl->hTerminatedThread) {
+ CloseHandle(lpdl->hTerminatedThread);
+ }
if (lpdl->pidl) {
CoTaskMemFree(lpdl->pidl);
diff --git a/minipath/src/DropSource.cpp b/minipath/src/DropSource.cpp
index 477273372..8b2dca46d 100644
--- a/minipath/src/DropSource.cpp
+++ b/minipath/src/DropSource.cpp
@@ -13,8 +13,13 @@
* *
* *
*******************************************************************************/
-#define _WIN32_WINNT 0x601
+#include
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
+#endif
+#define WIN32_LEAN_AND_MEAN 1
#include
+#include
//#include
#include "DropSource.h"
diff --git a/minipath/src/Helpers.c b/minipath/src/Helpers.c
index 12896fd2f..a89bcccc7 100644
--- a/minipath/src/Helpers.c
+++ b/minipath/src/Helpers.c
@@ -13,14 +13,15 @@
* *
* *
*******************************************************************************/
+#include
#if !defined(WINVER)
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER _WIN32_WINNT_WIN10
#endif
#if !defined(_WIN32_WINNT)
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
#if !defined(NTDDI_VERSION)
-#define NTDDI_VERSION 0x06010000 /*NTDDI_WIN7*/
+#define NTDDI_VERSION NTDDI_WIN10_RS5
#endif
//~#define VC_EXTRALEAN 1
//~#define WIN32_LEAN_AND_MEAN 1
@@ -155,6 +156,9 @@ BOOL ExeNameFromWnd(HWND hwnd,LPWSTR szExeName,int cchExeName)
{*/
GetWindowThreadProcessId(hwnd,&dwProcessId);
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,FALSE,dwProcessId);
+ if (!hProcess) {
+ return FALSE;
+ }
/*GetProcAddress(hPSAPI,"EnumProcessModules")*/ EnumProcessModules(hProcess,&hModule,sizeof(HMODULE),&cbNeeded);
/*GetProcAddress(hPSAPI,"GetModuleFileNameExW")*/ GetModuleFileNameExW(hProcess,hModule,szExeName,cchExeName);
CloseHandle(hProcess);
diff --git a/minipath/src/minipath.c b/minipath/src/minipath.c
index 309c0a1f5..557256e50 100644
--- a/minipath/src/minipath.c
+++ b/minipath/src/minipath.c
@@ -13,7 +13,10 @@
* *
* *
*******************************************************************************/
-#define _WIN32_WINNT 0x601
+#include
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
+#endif
#define VC_EXTRALEAN 1
#define WIN32_LEAN_AND_MEAN 1
#include
@@ -82,7 +85,7 @@ HWND hwndDirList;
HWND hwndMain;
-HANDLE hChangeHandle = NULL;
+HANDLE hChangeHandle = INVALID_HANDLE_VALUE;
HISTORY g_mHistory;
@@ -803,7 +806,10 @@ LRESULT CALLBACK MainWndProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
// Terminate directory watching
KillTimer(hwnd,ID_TIMER);
- FindCloseChangeNotification(hChangeHandle);
+ if (hChangeHandle != INVALID_HANDLE_VALUE) {
+ FindCloseChangeNotification(hChangeHandle);
+ hChangeHandle = INVALID_HANDLE_VALUE;
+ }
// GetWindowPlacement
wndpl.length = sizeof(WINDOWPLACEMENT);
@@ -907,7 +913,7 @@ CASE_WM_CTLCOLOR_SET:
case WM_TIMER:
// Check Change Notification Handle
- if (WAIT_OBJECT_0 == WaitForSingleObject(hChangeHandle,0)) {
+ if (hChangeHandle != INVALID_HANDLE_VALUE && WAIT_OBJECT_0 == WaitForSingleObject(hChangeHandle,0)) {
// Store information about currently selected item
DLITEM dli;
dli.mask = DLI_ALL;
@@ -1550,7 +1556,7 @@ void CreateBars(HWND hwnd,HINSTANCE hInstance)
// Theme = false (!) ~ you cannot change a toolbar's color when a visual style is active
- InitWindowCommon(hwndReBar, !(IsWindows10OrGreater() && IsDarkModeSupported()));
+ InitWindowCommon(hwndReBar, !IsDarkModeSupported());
#ifdef D_NP3_WIN10_DARK_MODE
if (IsDarkModeSupported()) {
@@ -1575,7 +1581,7 @@ void CreateBars(HWND hwnd,HINSTANCE hInstance)
rbBand.hbmBack = NULL;
rbBand.lpText = L"Toolbar";
rbBand.clrFore = GetModeTextColor(UseDarkMode());
- rbBand.clrBack = IsWindows10OrGreater() ? GetModeBkColor(UseDarkMode()) : GetModeBtnfaceColor(UseDarkMode());
+ rbBand.clrBack = GetModeBkColor(UseDarkMode());
rbBand.hwndChild = hwndToolbar;
rbBand.cxMinChild = (rc.right - rc.left) * COUNTOF(tbbMainWnd);
rbBand.cyMinChild = (rc.bottom - rc.top) + 2 * rc.top;
@@ -1587,7 +1593,7 @@ void CreateBars(HWND hwnd,HINSTANCE hInstance)
cyReBar = rc.bottom - rc.top;
cyReBarFrame = bIsAppThemed ? 0 : 2;
- cyDriveBoxFrame = (bIsAppThemed && IsWindowsVistaOrGreater()) ? 0 : 2;
+ cyDriveBoxFrame = bIsAppThemed ? 0 : 2;
}
@@ -2274,7 +2280,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
SHFileOperation(&shfos);
// Check if there are any changes in the directory, then update!
- if (WAIT_OBJECT_0 == WaitForSingleObject(hChangeHandle,0)) {
+ if (hChangeHandle != INVALID_HANDLE_VALUE && WAIT_OBJECT_0 == WaitForSingleObject(hChangeHandle,0)) {
SendWMCommand(hwnd, IDM_VIEW_UPDATE);
if (iItem > 0) {
iItem--;
@@ -3231,7 +3237,9 @@ BOOL ChangeDirectory(HWND hwnd,LPCWSTR lpszNewDir,BOOL bUpdateHistory)
}
// setup new change notification handle
- FindCloseChangeNotification(hChangeHandle);
+ if (hChangeHandle != INVALID_HANDLE_VALUE) {
+ FindCloseChangeNotification(hChangeHandle);
+ }
hChangeHandle = FindFirstChangeNotification(Settings.szCurDir,FALSE,
FILE_NOTIFY_CHANGE_FILE_NAME | \
FILE_NOTIFY_CHANGE_DIR_NAME | \
diff --git a/minipath/src/resource.h b/minipath/src/resource.h
index ab48e2d16..cc702c4c4 100644
--- a/minipath/src/resource.h
+++ b/minipath/src/resource.h
@@ -3,10 +3,10 @@
// Used by minipath.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#define IDR_RT_MANIFEST 1
diff --git a/np3encrypt/targetver.h b/np3encrypt/targetver.h
index 1a84a9b38..a8db33ce5 100644
--- a/np3encrypt/targetver.h
+++ b/np3encrypt/targetver.h
@@ -6,5 +6,5 @@
// legen Sie das _WIN32_WINNT-Makro auf die zu unterstützende Plattform fest, bevor Sie "SDKDDKVer.h" einschließen.
#include
-#define _WIN32_WINNT 0x500
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#include
diff --git a/other_sln/Notepad3DLL.vcxproj b/other_sln/Notepad3DLL.vcxproj
index fe6f7b5ca..a5374d218 100644
--- a/other_sln/Notepad3DLL.vcxproj
+++ b/other_sln/Notepad3DLL.vcxproj
@@ -109,7 +109,7 @@
false
true
Disabled
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;WIN32;STATIC_BUILD;SCI_LEXER;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;WIN32;STATIC_BUILD;SCI_LEXER;_DEBUG;DEBUG;%(PreprocessorDefinitions)
MultiThreadedDebugDLL
Level4
false
@@ -173,7 +173,7 @@
false
true
Disabled
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_WIN64;STATIC_BUILD;SCI_LEXER;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_WIN64;STATIC_BUILD;SCI_LEXER;_DEBUG;DEBUG;%(PreprocessorDefinitions)
MultiThreadedDebugDLL
Level4
false
@@ -233,7 +233,7 @@
.\;..\scintilla\include;..\scintilla\lexlib;..\scintilla\src;..\sciXlexers;..\ced\ced;..\uchardet;%(AdditionalIncludeDirectories)
true
MaxSpeed
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;WIN32;STATIC_BUILD;SCI_LEXER;NDEBUG;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;WIN32;STATIC_BUILD;SCI_LEXER;NDEBUG;%(PreprocessorDefinitions)
MultiThreadedDLL
Level4
None
@@ -301,7 +301,7 @@
.\;..\scintilla\include;..\scintilla\lexlib;..\scintilla\src;..\sciXlexers;..\ced\ced;..\uchardet;%(AdditionalIncludeDirectories)
true
MaxSpeed
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_WIN64;STATIC_BUILD;SCI_LEXER;NDEBUG;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_WIN64;STATIC_BUILD;SCI_LEXER;NDEBUG;%(PreprocessorDefinitions)
MultiThreadedDLL
Level4
None
diff --git a/res/Notepad3.exe.manifest b/res/Notepad3.exe.manifest
index bb41ef74f..70e552124 100644
--- a/res/Notepad3.exe.manifest
+++ b/res/Notepad3.exe.manifest
@@ -25,10 +25,7 @@
-
-
-
-
+
diff --git a/scintilla/Scintilla.vcxproj b/scintilla/Scintilla.vcxproj
index 272840177..cbe649599 100644
--- a/scintilla/Scintilla.vcxproj
+++ b/scintilla/Scintilla.vcxproj
@@ -214,7 +214,7 @@
true
Disabled
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
MultiThreadedDebug
Level4
false
@@ -245,7 +245,7 @@
true
Disabled
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
MultiThreadedDebug
Level4
false
@@ -276,7 +276,7 @@
true
Disabled
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
MultiThreadedDebug
Level4
false
@@ -309,7 +309,7 @@
true
MaxSpeed
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
MultiThreaded
Level4
false
@@ -345,7 +345,7 @@
true
MaxSpeed
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;USE_D2D;%(PreprocessorDefinitions)
MultiThreaded
Level4
false
@@ -380,7 +380,7 @@
true
MaxSpeed
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCI_LEXER;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCI_LEXER;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;USE_D2D;%(PreprocessorDefinitions)
MultiThreaded
Level4
false
@@ -416,7 +416,7 @@
true
MaxSpeed
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCI_LEXER;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCI_LEXER;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;USE_D2D;%(PreprocessorDefinitions)
MultiThreaded
Level4
false
@@ -452,7 +452,7 @@
true
MaxSpeed
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCI_LEXER;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCI_LEXER;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;USE_D2D;%(PreprocessorDefinitions)
MultiThreaded
Level4
false
@@ -489,7 +489,7 @@
true
MaxSpeed
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCI_LEXER;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NP3;NO_CXX11_REGEX;SCI_OWNREGEX;SCI_EMPTYCATALOGUE;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCI_LEXER;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;USE_D2D;%(PreprocessorDefinitions)
MultiThreaded
Level4
false
diff --git a/scintilla/ScintillaDLL.vcxproj b/scintilla/ScintillaDLL.vcxproj
index cdb1f9171..094726db2 100644
--- a/scintilla/ScintillaDLL.vcxproj
+++ b/scintilla/ScintillaDLL.vcxproj
@@ -121,7 +121,7 @@
true
Disabled
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NO_CXX11_REGEX;SCI_OWNREGEX;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCINTILLA_DLL;NP3;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;SCI_LEXER;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NO_CXX11_REGEX;SCI_OWNREGEX;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCINTILLA_DLL;NP3;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;SCI_LEXER;USE_D2D;%(PreprocessorDefinitions)
MultiThreadedDebugDLL
Level3
false
@@ -149,7 +149,7 @@
true
Disabled
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NO_CXX11_REGEX;SCI_OWNREGEX;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCINTILLA_DLL;NP3;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;SCI_LEXER;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NO_CXX11_REGEX;SCI_OWNREGEX;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCINTILLA_DLL;NP3;_WIN64;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;SCI_LEXER;USE_D2D;%(PreprocessorDefinitions)
MultiThreadedDebugDLL
Level3
false
@@ -176,7 +176,7 @@
true
MaxSpeed
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NO_CXX11_REGEX;SCI_OWNREGEX;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCINTILLA_DLL;NP3;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;SCI_LEXER;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NO_CXX11_REGEX;SCI_OWNREGEX;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCINTILLA_DLL;NP3;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;SCI_LEXER;USE_D2D;%(PreprocessorDefinitions)
MultiThreadedDLL
Level3
true
@@ -202,7 +202,7 @@
true
MaxSpeed
NotUsing
- _WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_SCL_SECURE_NO_WARNINGS;NO_CXX11_REGEX;SCI_OWNREGEX;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCINTILLA_DLL;NP3;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;SCI_LEXER;USE_D2D;%(PreprocessorDefinitions)
+ _WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_SCL_SECURE_NO_WARNINGS;NO_CXX11_REGEX;SCI_OWNREGEX;PCRE2_CODE_UNIT_WIDTH=8;PCRE2_STATIC;HAVE_CONFIG_H;SCINTILLA_DLL;NP3;_WIN64;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES;STATIC_BUILD;SCI_LEXER;USE_D2D;%(PreprocessorDefinitions)
MultiThreadedDLL
Level3
true
diff --git a/src/ChooseFont/ChooseFont.h b/src/ChooseFont/ChooseFont.h
index 227ac5e78..c6382cc30 100644
--- a/src/ChooseFont/ChooseFont.h
+++ b/src/ChooseFont/ChooseFont.h
@@ -16,16 +16,18 @@
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
-#ifndef WINVER // Minimum platform is Windows 7
-#define WINVER 0x0601
+#include
+
+#ifndef WINVER // Minimum platform is Windows 10
+#define WINVER _WIN32_WINNT_WIN10
#endif
-#ifndef _WIN32_WINNT // Minimum platform is Windows 7
-#define _WIN32_WINNT 0x0601
+#ifndef _WIN32_WINNT // Minimum platform is Windows 10
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
-#ifndef _WIN32_WINDOWS // Minimum platform is Windows 7
-#define _WIN32_WINDOWS 0x0601
+#ifndef _WIN32_WINDOWS // Minimum platform is Windows 10
+#define _WIN32_WINDOWS _WIN32_WINNT_WIN10
#endif
diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp
index 175a549b4..0ff58e7ee 100644
--- a/src/Config/Config.cpp
+++ b/src/Config/Config.cpp
@@ -12,14 +12,15 @@
* *
* *
*******************************************************************************/
+#include
#if !defined(WINVER)
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER _WIN32_WINNT_WIN10
#endif
#if !defined(_WIN32_WINNT)
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
#if !defined(NTDDI_VERSION)
-#define NTDDI_VERSION 0x06010000 /*NTDDI_WIN7*/
+#define NTDDI_VERSION NTDDI_WIN10_RS5
#endif
#if (defined(_DEBUG) || defined(DEBUG)) && !defined(NDEBUG)
diff --git a/src/DarkMode/DarkMode.cpp b/src/DarkMode/DarkMode.cpp
index d9ee8ccf8..1cfbd2c47 100644
--- a/src/DarkMode/DarkMode.cpp
+++ b/src/DarkMode/DarkMode.cpp
@@ -22,6 +22,7 @@
#define DBG_NEW new
#endif
+#define VC_EXTRALEAN 1
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include
@@ -55,18 +56,7 @@
#ifdef D_NP3_WIN10_DARK_MODE
-#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
-#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
-#endif
-
-#if _WIN32_WINNT < _WIN32_WINNT_WIN8
-DWORD const kSystemLibraryLoadFlags = (IsWindows8Point1OrGreater() ||
- GetProcAddress(GetModuleHandle(L"kernel32.dll"), "SetDefaultDllDirectories"))
- ? LOAD_LIBRARY_SEARCH_SYSTEM32
- : 0;
-#else
#define kSystemLibraryLoadFlags LOAD_LIBRARY_SEARCH_SYSTEM32
-#endif
// ============================================================================
diff --git a/src/Edit.c b/src/Edit.c
index 5a67068e1..08d75d128 100644
--- a/src/Edit.c
+++ b/src/Edit.c
@@ -1357,6 +1357,40 @@ bool EditLoadFile(
// --------------------------------------------------------------------------
+ if (encDetection.bIsUTF32) {
+ // UTF-32 is not supported — convert through ANSI codepage for binary display
+ // (same conversion path that other binary files use via EXTERNAL_8BIT)
+ status->iEncoding = CPI_ANSI_DEFAULT;
+ UINT const uCodePage = Encoding_GetCodePage(CPI_ANSI_DEFAULT);
+
+ LPWSTR const lpDataWide = AllocMem(cbData * 2 + 16, HEAP_ZERO_MEMORY);
+ ptrdiff_t const cbDataWide = MultiByteToWideCharEx(uCodePage, 0, lpData, cbData,
+ lpDataWide, (SizeOfMem(lpDataWide) / sizeof(WCHAR)));
+ if (cbDataWide != 0) {
+ FreeMem(lpData);
+ lpData = AllocMem(cbDataWide * 3 + 16, HEAP_ZERO_MEMORY);
+ cbData = WideCharToMultiByteEx(Encoding_SciCP, 0, lpDataWide, cbDataWide,
+ lpData, SizeOfMem(lpData), NULL, NULL);
+ if (cbData != 0) {
+ EditSetNewText(hwnd, lpData, cbData, bClearUndoHistory, bReloadFile);
+ EditDetectEOLMode(lpData, cbData, status);
+ FreeMem(lpDataWide);
+ } else {
+ FreeMem(lpDataWide);
+ EditSetNewText(hwnd, "", 0, bClearUndoHistory, bReloadFile);
+ }
+ } else {
+ FreeMem(lpDataWide);
+ EditSetNewText(hwnd, "", 0, bClearUndoHistory, bReloadFile);
+ }
+ status->iEOLMode = Settings.DefaultEOLMode;
+ FreeMem(lpData);
+ InfoBoxLng(MB_ICONWARNING, L"MsgUTF32Unsupported", IDS_MUI_ERR_ENCODINGNA);
+ goto observe;
+ }
+
+ // --------------------------------------------------------------------------
+
if (Flags.bDevDebugMode) {
#if TRUE
SetAdditionalTitleInfo(Encoding_GetTitleInfo());
diff --git a/src/Encoding.c b/src/Encoding.c
index 199793a89..67b1d1e9f 100644
--- a/src/Encoding.c
+++ b/src/Encoding.c
@@ -698,8 +698,35 @@ int Encoding_GetNameW(const cpi_enc_t iEncoding, LPWSTR buffer, size_t cwch)
// ============================================================================
+bool Has_UTF32_LE_BOM(const char* pBuf, size_t cnt)
+{
+ // UTF-32 LE BOM: FF FE 00 00
+ return (pBuf && cnt >= 4 &&
+ (unsigned char)pBuf[0] == 0xFF && (unsigned char)pBuf[1] == 0xFE &&
+ (unsigned char)pBuf[2] == 0x00 && (unsigned char)pBuf[3] == 0x00);
+}
+// ----------------------------------------------------------------------------
+
+bool Has_UTF32_BE_BOM(const char* pBuf, size_t cnt)
+{
+ // UTF-32 BE BOM: 00 00 FE FF
+ return (pBuf && cnt >= 4 &&
+ (unsigned char)pBuf[0] == 0x00 && (unsigned char)pBuf[1] == 0x00 &&
+ (unsigned char)pBuf[2] == 0xFE && (unsigned char)pBuf[3] == 0xFF);
+}
+// ----------------------------------------------------------------------------
+
+bool Has_UTF32_BOM(const char* pBuf, size_t cnt)
+{
+ return (Has_UTF32_LE_BOM(pBuf, cnt) || Has_UTF32_BE_BOM(pBuf, cnt));
+}
+// ----------------------------------------------------------------------------
+
bool Has_UTF16_LE_BOM(const char* pBuf, size_t cnt)
{
+ if (Has_UTF32_LE_BOM(pBuf, cnt)) {
+ return false; // UTF-32 LE BOM starts with FF FE — must not match as UTF-16 LE
+ }
int iTest = IS_TEXT_UNICODE_SIGNATURE;
bool const ok = IsTextUnicode(pBuf, clampi((int)cnt, 0, 4), &iTest);
return (ok && ((iTest & IS_TEXT_UNICODE_SIGNATURE) != 0));
diff --git a/src/Encoding.h b/src/Encoding.h
index 66bbda17d..53748aa4d 100644
--- a/src/Encoding.h
+++ b/src/Encoding.h
@@ -121,6 +121,10 @@ const char* Encoding_GetParseNames(const cpi_enc_t iEncoding);
int Encoding_GetNameA(const cpi_enc_t iEncoding, char* buffer, size_t cch);
int Encoding_GetNameW(const cpi_enc_t iEncoding, LPWSTR buffer, size_t cwch);
+bool Has_UTF32_LE_BOM(const char* pBuf, size_t cnt);
+bool Has_UTF32_BE_BOM(const char* pBuf, size_t cnt);
+bool Has_UTF32_BOM(const char* pBuf, size_t cnt);
+
bool Has_UTF16_LE_BOM(const char* pBuf, size_t cnt);
bool Has_UTF16_BE_BOM(const char* pBuf, size_t cnt);
bool Has_UTF16_BOM(const char *pBuf, size_t cnt);
@@ -193,12 +197,13 @@ typedef struct _enc_det_t {
bool bIsUTF8Sig;
bool bValidUTF8;
bool bPureASCII7Bit;
+ bool bIsUTF32;
char encodingStrg[64];
} ENC_DET_T;
-#define INIT_ENC_DET_T { CPI_NONE, CPI_NONE, CPI_NONE, CPI_NONE, CPI_NONE, 0.0f, false, false, false, false, false, false, "" }
+#define INIT_ENC_DET_T { CPI_NONE, CPI_NONE, CPI_NONE, CPI_NONE, CPI_NONE, 0.0f, false, false, false, false, false, false, false, "" }
ENC_DET_T Encoding_DetectEncoding(const HPATHL hpath, const char* lpData, const size_t cbData,
diff --git a/src/EncodingDetection.cpp b/src/EncodingDetection.cpp
index 05eb4eed7..13eaacc91 100644
--- a/src/EncodingDetection.cpp
+++ b/src/EncodingDetection.cpp
@@ -13,14 +13,15 @@
* *
* *
*******************************************************************************/
+#include
#if !defined(WINVER)
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER _WIN32_WINNT_WIN10
#endif
#if !defined(_WIN32_WINNT)
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
#if !defined(NTDDI_VERSION)
-#define NTDDI_VERSION 0x06010000 /*NTDDI_WIN7*/
+#define NTDDI_VERSION NTDDI_WIN10_RS5
#endif
#if (defined(_DEBUG) || defined(DEBUG)) && !defined(NDEBUG)
@@ -797,6 +798,7 @@ void Encoding_AnalyzeText(const char* const text, const size_t len,
//~cpiEncoding_CED = AnalyzeText_CED(text, len, encodingHint, &ced_cnf, encodingStrg_CED, MAX_ENC_STRG_LEN);
//~if (ced_cnf < 1.0f)
//~{
+
cpiEncoding_UCD = AnalyzeText_UCHARDET(text, len, &confidence_UCD, pEncDetInfo->encodingStrg, COUNTOF(pEncDetInfo->encodingStrg));
//~}
@@ -807,6 +809,7 @@ void Encoding_AnalyzeText(const char* const text, const size_t len,
#endif
+#if FALSE
// --- re-mapping UCD ----
switch (Encoding_GetCodePage(cpiEncoding_UCD)) {
@@ -815,18 +818,18 @@ void Encoding_AnalyzeText(const char* const text, const size_t len,
cpiEncoding_UCD = Encoding_GetByCodePage(1252); // auto detect default ANSI (!)
break;
- /*
- case 54936:
- if ((codePage_CED == 936) || (codePage_CED == 20936))
- {
- cpiEncoding_UCD = cpiEncoding_CED; // trust CED's choice
- }
- break;
- */
+ //case 54936:
+ // if ((codePage_CED == 936) || (codePage_CED == 20936))
+ // {
+ // cpiEncoding_UCD = cpiEncoding_CED; // trust CED's choice
+ // }
+ // break;
default:
break;
}
+
+#endif
// UCARDET does not rely on encodingHint, so make a bias here
confidence_UCD += (cpiEncoding_UCD == encodingHint) ? (1.0f - confidence_UCD) / 2.0f : 0.0f;
@@ -1265,6 +1268,19 @@ extern "C" ENC_DET_T Encoding_DetectEncoding(const HPATHL hpath, const char* lpD
FileVars_GetFromData(lpData, cbData, &Globals.fvCurFile);
+ // --- Check for UTF-32 BOM first (unsupported encoding) ---
+ if (Has_UTF32_BOM(lpData, cbData)) {
+ encDetRes.bIsUTF32 = true;
+ encDetRes.bHasBOM = true;
+ encDetRes.Encoding = CPI_PREFERRED_ENCODING;
+ StringCchCopyA(encDetRes.encodingStrg, COUNTOF(encDetRes.encodingStrg),
+ Has_UTF32_BE_BOM(lpData, cbData) ? "UTF-32BE" : "UTF-32LE");
+ if (Flags.bDevDebugMode) {
+ _SetEncodingTitleInfo(&encDetRes);
+ }
+ return encDetRes;
+ }
+
bool const bBOM_LE = Has_UTF16_LE_BOM(lpData, cbData);
bool const bBOM_BE = Has_UTF16_BE_BOM(lpData, cbData);
diff --git a/src/Helpers.c b/src/Helpers.c
index 2e9a7cae1..287c69f36 100644
--- a/src/Helpers.c
+++ b/src/Helpers.c
@@ -228,26 +228,12 @@ void GetWinVersionString(LPWSTR szVersionStr, size_t cchVersionStr)
DWORD const build = GetWindowsBuildNumber(NULL, NULL);
- if (IsWindows10OrGreater()) {
- StringCchCat(szVersionStr, cchVersionStr, IsWindowsServer() ? ((build >= 17134) ? L"Server 2019 " : L"Server 2016 ") :
- ((build >= 22000) ? L"11 " : L"10 "));
- } else if (IsWindows8Point1OrGreater()) {
- StringCchCat(szVersionStr, cchVersionStr, IsWindowsServer() ? L"Server 2012 R2 " : L"8.1");
- } else if (IsWindows8OrGreater()) {
- StringCchCat(szVersionStr, cchVersionStr, IsWindowsServer() ? L"Server 2012 " : L"8");
- } else if (IsWindows7SP1OrGreater()) {
- StringCchCat(szVersionStr, cchVersionStr, IsWindowsServer() ? L"Server 2008 R2 " : L"7 (SP1)");
- } else if (IsWindows7OrGreater()) {
- StringCchCat(szVersionStr, cchVersionStr, IsWindowsServer() ? L"Server 2008 " : L"7");
- } else {
- StringCchCat(szVersionStr, cchVersionStr, IsWindowsServer() ? L"Unkown Server " : L"?");
- }
+ StringCchCat(szVersionStr, cchVersionStr, IsWindowsServer() ? ((build >= 17134) ? L"Server 2019 " : L"Server 2016 ") :
+ ((build >= 22000) ? L"11 " : L"10 "));
- if (IsWindows10OrGreater()) {
- WCHAR win10ver[80] = { L'\0' };
- StringCchPrintf(win10ver, COUNTOF(win10ver), L" Version %s (Build %lu)", _Win10BuildToReleaseId(build), GetWindowsBuildNumber(NULL, NULL));
- StringCchCat(szVersionStr, cchVersionStr, win10ver);
- }
+ WCHAR win10ver[80] = { L'\0' };
+ StringCchPrintf(win10ver, COUNTOF(win10ver), L" Version %s (Build %lu)", _Win10BuildToReleaseId(build), build);
+ StringCchCat(szVersionStr, cchVersionStr, win10ver);
}
@@ -351,15 +337,6 @@ HRESULT SetWindowAppUserModelID(HWND hwnd, PCWSTR AppID)
//
bool IsProcessElevated()
{
-
- // When the process is run on operating systems prior to Windows
- // Vista, GetTokenInformation returns FALSE with the
- // ERROR_INVALID_PARAMETER error code because TokenElevation is
- // not supported on those operating systems.
- if (!IsWindowsVistaOrGreater()) {
- return false;
- }
-
bool bIsElevated = false;
HANDLE hToken = NULL;
Globals.dwLastError = ERROR_SUCCESS;
@@ -586,9 +563,15 @@ bool IsRunAsAdmin()
void BackgroundWorker_Init(BackgroundWorker* worker, HWND hwnd, const HPATHL hFilePath)
{
if (worker) {
+ if (IS_VALID_HANDLE(worker->eventCancel)) {
+ return; // already initialized — call Destroy first
+ }
worker->hwnd = hwnd;
// manual (not automatic) reset & initial state: not signaled (TRUE, FALSE)
worker->eventCancel = CreateEvent(NULL, TRUE, FALSE, NULL);
+ if (!IS_VALID_HANDLE(worker->eventCancel)) {
+ worker->eventCancel = INVALID_HANDLE_VALUE;
+ }
worker->workerThread = INVALID_HANDLE_VALUE;
worker->hFilePath = Path_Allocate(Path_Get(hFilePath));
}
@@ -597,31 +580,49 @@ void BackgroundWorker_Init(BackgroundWorker* worker, HWND hwnd, const HPATHL hFi
void BackgroundWorker_Start(BackgroundWorker* worker, _beginthreadex_proc_type routine, LPVOID property)
{
if (worker) {
- ResetEvent(worker->eventCancel); // init should be 'not signaled'
+ if (IS_VALID_HANDLE(worker->eventCancel)) {
+ ResetEvent(worker->eventCancel); // init should be 'not signaled'
+ }
//~worker->workerThread = CreateThread(NULL, 0, routine, property, 0, NULL); // MD(d) dll
uintptr_t const thread = _beginthreadex(NULL, 0, routine, property, 0, NULL); // MT(d) static
- InterlockedExchangePointer(&(worker->workerThread), (thread != 0LL) ? (HANDLE)thread : INVALID_HANDLE_VALUE);
+ HANDLE const hOld = InterlockedExchangePointer(&(worker->workerThread), (thread != 0LL) ? (HANDLE)thread : INVALID_HANDLE_VALUE);
+ if (IS_VALID_HANDLE(hOld)) {
+ CloseHandle(hOld); // prevent handle leak from re-entrant Start
+ }
}
}
void BackgroundWorker_Cancel(BackgroundWorker* worker) {
if (worker) {
- SetEvent(worker->eventCancel); // signal
+ if (IS_VALID_HANDLE(worker->eventCancel)) {
+ SetEvent(worker->eventCancel); // signal
+ }
HANDLE const workerThread = InterlockedExchangePointer(&(worker->workerThread), INVALID_HANDLE_VALUE);
if (IS_VALID_HANDLE(workerThread)) {
- // Optimize: MsgDispatch only in case of hwnd ?
- // DWORD const wait = SignalObjectAndWait(worker->eventCancel, workerThread, 100 /*INFINITE*/, FALSE);
- DWORD const dwTimeout = 5000; // 5 seconds max
+ DWORD const dwTimeout = 5000; // 5 seconds for graceful exit
DWORD const dwStart = GetTickCount();
- while (WaitForSingleObject(workerThread, 0) != WAIT_OBJECT_0) {
- if ((GetTickCount() - dwStart) > dwTimeout) {
- break; // give up waiting — thread will self-terminate
+
+ // Wait for thread exit, only pumping cross-thread SendMessage to prevent deadlocks.
+ // Posted messages (WM_TIMER, WM_COMMAND, etc.) are left in the queue — dispatching
+ // them here could cause reentrancy in the caller (e.g., mid-FileSave).
+ while (true) {
+ DWORD const dwElapsed = GetTickCount() - dwStart;
+ DWORD const dwRemaining = (dwElapsed < dwTimeout) ? (dwTimeout - dwElapsed) : 0;
+ DWORD const dwWait = MsgWaitForMultipleObjects(1, &workerThread, FALSE, dwRemaining, QS_SENDMESSAGE);
+ if (dwWait == WAIT_OBJECT_0) {
+ break; // thread exited
}
- MSG msg;
- if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
+ if (dwWait == WAIT_OBJECT_0 + 1) {
+ // Process only sent messages (cross-thread SendMessage), not posted messages
+ MSG msg;
+ PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
+ continue;
}
+ // WAIT_TIMEOUT or WAIT_FAILED — ensure thread is dead before cleanup
+ if (dwWait == WAIT_TIMEOUT) {
+ WaitForSingleObject(workerThread, INFINITE);
+ }
+ break;
}
CloseHandle(workerThread);
}
@@ -634,7 +635,10 @@ void BackgroundWorker_Destroy(BackgroundWorker* worker)
{
if (worker) {
BackgroundWorker_Cancel(worker);
- CloseHandle(InterlockedExchangePointer(&(worker->eventCancel), INVALID_HANDLE_VALUE));
+ HANDLE const hEvent = InterlockedExchangePointer(&(worker->eventCancel), INVALID_HANDLE_VALUE);
+ if (IS_VALID_HANDLE(hEvent)) {
+ CloseHandle(hEvent);
+ }
Path_Release(worker->hFilePath);
worker->hFilePath = NULL;
}
diff --git a/src/Helpers.h b/src/Helpers.h
index cfe9d1f02..99a680787 100644
--- a/src/Helpers.h
+++ b/src/Helpers.h
@@ -429,8 +429,8 @@ void BackgroundWorker_Start(BackgroundWorker* worker, _beginthreadex_proc
void BackgroundWorker_Cancel(BackgroundWorker* worker);
void BackgroundWorker_Destroy(BackgroundWorker* worker);
-static inline bool BackgroundWorker_Continue(BackgroundWorker* worker) {
- return (worker) ? (WaitForSingleObject(worker->eventCancel, 0) != WAIT_OBJECT_0) : false;
+static inline bool BackgroundWorker_Continue(BackgroundWorker* worker) {
+ return (worker && IS_VALID_HANDLE(worker->eventCancel)) ? (WaitForSingleObject(worker->eventCancel, 0) != WAIT_OBJECT_0) : false;
}
static inline void BackgroundWorker_End(BackgroundWorker* worker, unsigned int retcode) { if (worker) { _endthreadex(retcode); }}
diff --git a/src/Notepad3.c b/src/Notepad3.c
index 4891751b0..585a6bee5 100644
--- a/src/Notepad3.c
+++ b/src/Notepad3.c
@@ -509,21 +509,41 @@ static inline bool RaiseFlagIfCurrentFileChanged() {
if (IsFileDeletedFlagSet()) {
return false;
}
- SetEvent(s_FileChgObsvrData.hEventFileChanged);
- SetEvent(s_FileChgObsvrData.hEventFileDeleted);
+ if (IS_VALID_HANDLE(s_FileChgObsvrData.hEventFileChanged)) {
+ SetEvent(s_FileChgObsvrData.hEventFileChanged);
+ }
+ if (IS_VALID_HANDLE(s_FileChgObsvrData.hEventFileDeleted)) {
+ SetEvent(s_FileChgObsvrData.hEventFileDeleted);
+ }
return true;
}
if (IsFileDeletedFlagSet()) {
// The current file has been restored
- ResetEvent(s_FileChgObsvrData.hEventFileDeleted);
+ if (IS_VALID_HANDLE(s_FileChgObsvrData.hEventFileDeleted)) {
+ ResetEvent(s_FileChgObsvrData.hEventFileDeleted);
+ }
}
+ // Seqlock read: detect torn reads of fdCurFile during concurrent ResetFileObservationData
+ LONG const genBefore = InterlockedCompareExchange(&(s_FileChgObsvrData.iObservationGeneration), 0, 0);
+ if (genBefore & 1) {
+ return false; // write in progress — skip this cycle, next poll will retry
+ }
+
bool const changed = (s_FileChgObsvrData.fdCurFile.nFileSizeLow != fdUpdated.nFileSizeLow) || (s_FileChgObsvrData.fdCurFile.nFileSizeHigh != fdUpdated.nFileSizeHigh)
//~|| (CompareFileTime(&(s_FileChgObsvrData.fdCurFile.ftLastWriteTime), &fdUpdated.ftLastWriteTime) != 0)
|| (s_FileChgObsvrData.fdCurFile.ftLastWriteTime.dwLowDateTime != fdUpdated.ftLastWriteTime.dwLowDateTime)
|| (s_FileChgObsvrData.fdCurFile.ftLastWriteTime.dwHighDateTime != fdUpdated.ftLastWriteTime.dwHighDateTime);
+
+ LONG const genAfter = InterlockedCompareExchange(&(s_FileChgObsvrData.iObservationGeneration), 0, 0);
+ if (genBefore != genAfter) {
+ return false; // torn read — skip this cycle, next poll will retry
+ }
+
if (changed) {
- SetEvent(s_FileChgObsvrData.hEventFileChanged);
+ if (IS_VALID_HANDLE(s_FileChgObsvrData.hEventFileChanged)) {
+ SetEvent(s_FileChgObsvrData.hEventFileChanged);
+ }
}
return changed;
}
@@ -531,14 +551,22 @@ static inline bool RaiseFlagIfCurrentFileChanged() {
static inline void ResetFileObservationData(const bool bResetEvt) {
if (bResetEvt) {
- ResetEvent(s_FileChgObsvrData.hEventFileChanged);
- ResetEvent(s_FileChgObsvrData.hEventFileDeleted);
+ if (IS_VALID_HANDLE(s_FileChgObsvrData.hEventFileChanged)) {
+ ResetEvent(s_FileChgObsvrData.hEventFileChanged);
+ }
+ if (IS_VALID_HANDLE(s_FileChgObsvrData.hEventFileDeleted)) {
+ ResetEvent(s_FileChgObsvrData.hEventFileDeleted);
+ }
}
if (Path_IsNotEmpty(Paths.CurrentFile)) {
+ // Seqlock write: increment generation before and after updating fdCurFile
+ // so the observer thread can detect torn reads
+ InterlockedIncrement(&(s_FileChgObsvrData.iObservationGeneration));
if (!GetFileAttributesEx(Path_Get(Paths.CurrentFile), GetFileExInfoStandard, &(s_FileChgObsvrData.fdCurFile)))
{
ZeroMemory(&(s_FileChgObsvrData.fdCurFile), sizeof(WIN32_FIND_DATA));
}
+ InterlockedIncrement(&(s_FileChgObsvrData.iObservationGeneration));
}
}
@@ -779,6 +807,10 @@ static void _CleanUpResources(const HWND hwnd, bool bIsInitialized)
{
if (hwnd) {
KillTimer(hwnd, IDT_TIMER_MRKALL);
+ KillTimer(hwnd, ID_WATCHTIMER);
+ KillTimer(hwnd, ID_LOGROTATETIMER);
+ KillTimer(hwnd, ID_AUTOSAVETIMER);
+ KillTimer(hwnd, ID_PASTEBOARDTIMER);
}
if (Globals.pStdDarkModeIniStyles) {
@@ -793,6 +825,8 @@ static void _CleanUpResources(const HWND hwnd, bool bIsInitialized)
FreeMem(pmqc);
}
+ BackgroundWorker_Destroy(&(s_FileChgObsvrData.worker));
+
if (IS_VALID_HANDLE(s_FileChgObsvrData.hEventFileChanged)) {
CloseHandle(s_FileChgObsvrData.hEventFileChanged);
s_FileChgObsvrData.hEventFileChanged = INVALID_HANDLE_VALUE;
@@ -802,8 +836,6 @@ static void _CleanUpResources(const HWND hwnd, bool bIsInitialized)
s_FileChgObsvrData.hEventFileDeleted = INVALID_HANDLE_VALUE;
}
- BackgroundWorker_Destroy(&(s_FileChgObsvrData.worker));
-
// ---------------------------------------------
if (s_SelectionBuffer) {
@@ -1007,8 +1039,8 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
- // check if running at least on Windows 7 (SP1)
- if (!IsWindows7SP1OrGreater()) {
+ // check if running at least on Windows 10
+ if (!IsWindows10OrGreater()) {
MsgBoxLastError(L"Application Initialization", ERROR_OLD_WIN_VERSION);
return 1; // exit
}
@@ -1749,6 +1781,10 @@ HWND InitInstance(const HINSTANCE hInstance, int nCmdShow)
{
// manual (not automatic) reset & initial state: not signaled (TRUE, FALSE)
s_hEventAppIsClosing = CreateEvent(NULL, TRUE, FALSE, NULL);
+ if (!IS_VALID_HANDLE(s_hEventAppIsClosing)) {
+ MsgBoxLastError(L"CreateEvent(s_hEventAppIsClosing)", GetLastError());
+ return NULL;
+ }
// init w/o hwnd
g_IniWinInfo = GetWinInfoByFlag(NULL, Globals.CmdLnFlag_WindowPos);
@@ -1797,7 +1833,16 @@ HWND InitInstance(const HINSTANCE hInstance, int nCmdShow)
// manual (not automatic) reset & initial state: not signaled (TRUE, FALSE)
s_FileChgObsvrData.hEventFileChanged = CreateEvent(NULL, TRUE, FALSE, NULL);
+ if (!IS_VALID_HANDLE(s_FileChgObsvrData.hEventFileChanged)) {
+ MsgBoxLastError(L"CreateEvent(hEventFileChanged)", GetLastError());
+ return NULL;
+ }
s_FileChgObsvrData.hEventFileDeleted = CreateEvent(NULL, TRUE, FALSE, NULL);
+ if (!IS_VALID_HANDLE(s_FileChgObsvrData.hEventFileDeleted)) {
+ CloseHandle(s_FileChgObsvrData.hEventFileChanged);
+ MsgBoxLastError(L"CreateEvent(hEventFileDeleted)", GetLastError());
+ return NULL;
+ }
if (Settings.TransparentMode) {
SetWindowTransparentMode(hwndMain, true, Settings2.OpacityLevel);
@@ -2826,18 +2871,6 @@ static void _InitEditWndFrame()
SetWindowLongPtr(Globals.hwndEdit, GWL_EXSTYLE, GetWindowLongPtr(Globals.hwndEdit, GWL_EXSTYLE) & ~WS_EX_CLIENTEDGE);
SetWindowPos(Globals.hwndEdit, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- if (!IsWindowsVistaOrGreater()) {
-
- SetWindowPos(s_hwndEditFrame, Globals.hwndEdit, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- ShowWindow(s_hwndEditFrame, SW_HIDE);
-
- RECT rc, rc2;
- GetClientRect(s_hwndEditFrame, &rc);
- GetWindowRect(s_hwndEditFrame, &rc2);
- s_cxEditFrame = ((rc2.right - rc2.left) - (rc.right - rc.left)) / 2;
- s_cyEditFrame = ((rc2.bottom - rc2.top) - (rc.bottom - rc.top)) / 2;
- }
-
} else {
SetWindowLongPtr(Globals.hwndEdit, GWL_EXSTYLE, WS_EX_CLIENTEDGE | GetWindowLongPtr(Globals.hwndEdit, GWL_EXSTYLE));
@@ -3369,7 +3402,7 @@ void CreateBars(HWND hwnd, HINSTANCE hInstance)
0,0,0,0,hwnd,(HMENU)IDC_REBAR,hInstance,NULL);
// Theme = false (!) ~ you cannot change a toolbar's color when a visual style is active
- InitWindowCommon(Globals.hwndRebar, !(IsWindows10OrGreater() && IsDarkModeSupported()));
+ InitWindowCommon(Globals.hwndRebar, !IsDarkModeSupported());
#ifdef D_NP3_WIN10_DARK_MODE
if (IsDarkModeSupported()) {
@@ -3394,7 +3427,7 @@ void CreateBars(HWND hwnd, HINSTANCE hInstance)
rbBand.hbmBack = NULL;
rbBand.lpText = L"Toolbar";
rbBand.clrFore = GetModeTextColor(UseDarkMode());
- rbBand.clrBack = IsWindows10OrGreater() ? GetModeBkColor(UseDarkMode()) : GetModeBtnfaceColor(UseDarkMode());
+ rbBand.clrBack = GetModeBkColor(UseDarkMode());
rbBand.hwndChild = Globals.hwndToolbar;
rbBand.cxMinChild = (rc.right - rc.left) * COUNTOF(s_tbbMainWnd);
rbBand.cyMinChild = (rc.bottom - rc.top) + (2 * rc.top);
@@ -3772,32 +3805,7 @@ LRESULT MsgDropFiles(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
- HDROP hDrop = NULL;
- if (IsWindows10OrGreater()) {
- hDrop = (HDROP)wParam;
- }
- else // Windows7 Bug drag&drop of files from 32bit app to 64bit app
- {
- #ifdef _WIN64
- HANDLE hProcessHeap = GetProcessHeap();
- if (NULL != hProcessHeap && HeapLock(hProcessHeap)) {
- PROCESS_HEAP_ENTRY heapEntry = { 0 };
- while (HeapWalk(hProcessHeap, &heapEntry) != FALSE) {
- if ((heapEntry.wFlags & PROCESS_HEAP_ENTRY_BUSY) != 0) {
- HGLOBAL hGlobal = GlobalHandle(heapEntry.lpData);
- // Assuming wParam is the WM_DROPFILES WPARAM
- if ((((DWORD_PTR)hGlobal) & 0xFFFFFFFF) == (wParam & 0xFFFFFFFF)) {
- hDrop = (HDROP)hGlobal; // We got it !!
- break;
- }
- }
- }
- HeapUnlock(hProcessHeap);
- }
- #else
- hDrop = (HDROP)wParam;
- #endif
- }
+ HDROP hDrop = (HDROP)wParam;
if (hDrop) {
@@ -10016,6 +10024,9 @@ void MarkAllOccurrences(const LONG64 delay, const bool bForceClear)
//
void UpdateTitlebar(const HWND hwnd)
{
+ if (!IsWindow(hwnd)) {
+ return;
+ }
_DelayUpdateTitlebar(_MQ_STD, hwnd);
}
@@ -10027,6 +10038,9 @@ void UpdateTitlebar(const HWND hwnd)
static void _UpdateTitlebarDelayed(const HWND hwnd)
{
+ if (!IsWindow(hwnd)) {
+ return;
+ }
if (hwnd == Globals.hwndMain && Settings.ShowTitlebar) {
TITLEPROPS_T props = { 0 };
@@ -11177,11 +11191,15 @@ bool FileLoad(const HPATHL hfile_pth, const FileLoadFlags fLoadFlags, const DocP
}
if (bCreateFile) {
HANDLE hFile = CreateFileW(Path_Get(hopen_file),
- GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
Globals.dwLastError = GetLastError();
fSuccess = IS_VALID_HANDLE(hFile);
+ if (!fSuccess) {
+ // Handle already set to INVALID_HANDLE_VALUE by CreateFileW on failure
+ hFile = INVALID_HANDLE_VALUE;
+ }
if (fSuccess) {
FileVars_GetFromData(NULL, 0, &Globals.fvCurFile); // init/reset
EditSetNewText(Globals.hwndEdit, "", 0, false, false);
@@ -11983,6 +12001,9 @@ bool ActivatePrevInst(const bool bSetForground)
//
bool LaunchNewInstance(HWND hwnd, LPCWSTR lpszParameter, LPCWSTR lpszFilePath)
{
+ if (hwnd && !IsWindow(hwnd)) {
+ return false;
+ }
HPATHL hexe_pth = Path_Allocate(NULL);
Path_GetModuleFilePath(hexe_pth);
@@ -12109,7 +12130,7 @@ bool RelaunchMultiInst()
//
bool RelaunchElevated(LPCWSTR lpNewCmdLnArgs)
{
- if (!IsWindowsVistaOrGreater() || !Flags.bDoRelaunchElevated ||
+ if (!Flags.bDoRelaunchElevated ||
s_bIsProcessElevated || s_IsThisAnElevatedRelaunch || s_bIsRunAsAdmin ||
s_flagDisplayHelp) {
return false; // reject initial RelaunchElevated() try
@@ -12176,6 +12197,9 @@ bool RelaunchElevated(LPCWSTR lpNewCmdLnArgs)
//
void ShowNotifyIcon(HWND hwnd,bool bAdd)
{
+ if (!IsWindow(hwnd)) {
+ return;
+ }
HICON hIcon = NULL;
LoadIconWithScaleDown(Globals.hInstance, MAKEINTRESOURCE(IDR_MAINWND),
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), &hIcon);
@@ -12202,6 +12226,9 @@ void ShowNotifyIcon(HWND hwnd,bool bAdd)
//
void SetNotifyIconTitle(HWND hwnd)
{
+ if (!IsWindow(hwnd)) {
+ return;
+ }
NOTIFYICONDATA nid = { sizeof(NOTIFYICONDATA) };
nid.hWnd = hwnd;
nid.uID = 0;
@@ -12399,8 +12426,9 @@ void CALLBACK PasteBoardTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD
}
-// forward declaration for LogRotateTimerProc (defined after InstallFileWatching)
+// forward declarations for timer procs (defined after InstallFileWatching)
static void CALLBACK LogRotateTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
+static void CALLBACK AtomicSaveTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
//=============================================================================
//
@@ -12408,11 +12436,10 @@ static void CALLBACK LogRotateTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent,
//
LRESULT MsgFileChangeNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
- UNREFERENCED_PARAMETER(hwnd);
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- if (IsAppClosing()) { return TRUE; }
+ if (!IsWindow(hwnd) || IsAppClosing()) { return TRUE; }
SET_FCT_GUARD(TRUE);
@@ -12487,35 +12514,8 @@ LRESULT MsgFileChangeNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
else { // file has been deleted
- // Brief delay to handle atomic save (delete + rename) pattern
- Sleep(100);
- if (Path_IsExistingFile(Paths.CurrentFile)) {
- // File was restored (atomic save) — re-process as modification
- ResetFileObservationData(true);
- PostMessage(Globals.hwndMain, WM_FILECHANGEDNOTIFY, 0, 0);
- }
- else {
- InstallFileWatching(false); // truly deleted — terminate
-
- if (FileWatching.MonitoringLog) {
- // File deleted while monitoring — start retry timer for log rotation recovery
- FileWatching.LogRotateRetryCount = 0;
- SetTimer(Globals.hwndMain, ID_LOGROTATETIMER, 500, LogRotateTimerProc);
- SetSaveNeeded(true);
- }
- else if (FileWatching.FileWatchingMode == FWM_MSGBOX) {
- if (IsYesOkay(InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_FILECHANGENOTIFY2))) {
- FileSave(FSF_SaveAlways);
- }
- else {
- SetSaveNeeded(true);
- }
- }
- else {
- // FWM_INDICATORSILENT: nothing todo here
- SetSaveNeeded(true);
- }
- }
+ // Use timer to handle atomic save (delete + rename) pattern without blocking UI
+ SetTimer(Globals.hwndMain, ID_ATOMICSAVETIMER, 100, AtomicSaveTimerProc);
}
RESET_FCT_GUARD();
@@ -12531,7 +12531,16 @@ LRESULT MsgFileChangeNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
static inline void NotifyIfFileHasChanged()
{
- if (IsFileChangedFlagSet() || IsFileDeletedFlagSet() || RaiseFlagIfCurrentFileChanged()) {
+ bool notify = false;
+ if (IsFileChangedFlagSet()) {
+ // Consume the flag to prevent duplicate notifications from concurrent push+poll paths
+ ResetEvent(s_FileChgObsvrData.hEventFileChanged);
+ notify = true;
+ }
+ if (IsFileDeletedFlagSet()) {
+ notify = true; // don't reset deleted flag here — handler needs it
+ }
+ if (notify || RaiseFlagIfCurrentFileChanged()) {
PostMessage(Globals.hwndMain, WM_FILECHANGEDNOTIFY, 0, 0);
}
// reset Timeout interval
@@ -12582,6 +12591,45 @@ static void CALLBACK LogRotateTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent,
}
// ----------------------------------------------------------------------------
+static void CALLBACK AtomicSaveTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) {
+
+ UNREFERENCED_PARAMETER(dwTime);
+ UNREFERENCED_PARAMETER(idEvent);
+ UNREFERENCED_PARAMETER(uMsg);
+ UNREFERENCED_PARAMETER(hwnd);
+
+ KillTimer(Globals.hwndMain, ID_ATOMICSAVETIMER); // one-shot
+
+ if (Path_IsExistingFile(Paths.CurrentFile)) {
+ // File was restored (atomic save) — re-process as modification
+ ResetFileObservationData(true);
+ PostMessage(Globals.hwndMain, WM_FILECHANGEDNOTIFY, 0, 0);
+ }
+ else {
+ InstallFileWatching(false); // truly deleted — terminate
+
+ if (FileWatching.MonitoringLog) {
+ // File deleted while monitoring — start retry timer for log rotation recovery
+ FileWatching.LogRotateRetryCount = 0;
+ SetTimer(Globals.hwndMain, ID_LOGROTATETIMER, 500, LogRotateTimerProc);
+ SetSaveNeeded(true);
+ }
+ else if (FileWatching.FileWatchingMode == FWM_MSGBOX) {
+ if (IsYesOkay(InfoBoxLng(MB_YESNO | MB_ICONWARNING, NULL, IDS_MUI_FILECHANGENOTIFY2))) {
+ FileSave(FSF_SaveAlways);
+ }
+ else {
+ SetSaveNeeded(true);
+ }
+ }
+ else {
+ // FWM_INDICATORSILENT: nothing todo here
+ SetSaveNeeded(true);
+ }
+ }
+}
+// ----------------------------------------------------------------------------
+
unsigned int WINAPI FileChangeObserver(LPVOID lpParam)
{
@@ -12601,6 +12649,7 @@ unsigned int WINAPI FileChangeObserver(LPVOID lpParam)
FILE_NOTIFY_CHANGE_LAST_WRITE);
if (!IS_VALID_HANDLE(pFCOBSVData->hFileChanged)) {
+ pFCOBSVData->hFileChanged = INVALID_HANDLE_VALUE;
BackgroundWorker_End(worker, 1);
return 1;
}
@@ -12626,13 +12675,17 @@ unsigned int WINAPI FileChangeObserver(LPVOID lpParam)
case WAIT_ABANDONED:
case WAIT_FAILED:
default:
- BackgroundWorker_Cancel(worker);
+ if (IS_VALID_HANDLE(worker->eventCancel)) {
+ SetEvent(worker->eventCancel); // signal self-stop (don't call Cancel from within thread)
+ }
retcode = 1;
break;
}
}
- FindCloseChangeNotification(pFCOBSVData->hFileChanged); // stop monitoring
+ if (IS_VALID_HANDLE(pFCOBSVData->hFileChanged)) {
+ FindCloseChangeNotification(pFCOBSVData->hFileChanged); // stop monitoring
+ }
pFCOBSVData->hFileChanged = INVALID_HANDLE_VALUE;
BackgroundWorker_End(worker, retcode);
@@ -12676,6 +12729,7 @@ void InstallFileWatching(const bool bInstall) {
// Terminate previous watching
if (bTerminate) {
KillTimer(Globals.hwndMain, ID_WATCHTIMER);
+ KillTimer(Globals.hwndMain, ID_ATOMICSAVETIMER);
BackgroundWorker_Cancel(&(s_FileChgObsvrData.worker));
ResetFileObservationData(false); // (!) false
}
@@ -12687,15 +12741,16 @@ void InstallFileWatching(const bool bInstall) {
bool const bUsePush = (Settings2.FileWatchingMethod != FWMTH_POLL); // both or push
bool const bUsePoll = (Settings2.FileWatchingMethod != FWMTH_PUSH); // both or poll
- if (!IS_VALID_HANDLE(s_FileChgObsvrData.worker.workerThread)) {
+ // Always cancel stale/running thread before starting fresh
+ // (handles self-stop scenario where thread exited but handle was not closed)
+ BackgroundWorker_Cancel(&(s_FileChgObsvrData.worker));
- // Save data of current file
- ResetFileObservationData(false); // (!) false
+ // Save data of current file
+ ResetFileObservationData(false); // (!) false
- if (bUsePush) {
- Path_Reset(s_FileChgObsvrData.worker.hFilePath, Path_Get(hdir_pth)); // directory monitoring
- BackgroundWorker_Start(&(s_FileChgObsvrData.worker), FileChangeObserver, &s_FileChgObsvrData);
- }
+ if (bUsePush) {
+ Path_Reset(s_FileChgObsvrData.worker.hFilePath, Path_Get(hdir_pth)); // directory monitoring
+ BackgroundWorker_Start(&(s_FileChgObsvrData.worker), FileChangeObserver, &s_FileChgObsvrData);
}
InterlockedExchange64(&(s_FileChgObsvrData.iFileChangeNotifyTime), GetTicks_ms());
@@ -12737,6 +12792,9 @@ void InstallFileWatching(const bool bInstall) {
InfoBoxLng(MB_ICONERROR, NULL, IDS_MUI_FILELOCK_ERROR, wchDisplayName);
+ // Ensure handle is explicitly invalid
+ _hCurrFileHandle = INVALID_HANDLE_VALUE;
+
// need to chose another mode
FILE_WATCHING_MODE const fwm = Settings.FileWatchingMode;
FileWatching.FileWatchingMode = (fwm != FWM_EXCLUSIVELOCK) ? fwm : FWM_MSGBOX;
diff --git a/src/Notepad3.h b/src/Notepad3.h
index 11805b4d9..d9243e1a0 100644
--- a/src/Notepad3.h
+++ b/src/Notepad3.h
@@ -69,6 +69,7 @@ np3params, *LPnp3params;
#define ID_AUTOSAVETIMER (0xA002) // Auto Save Timer
#define ID_LOGROTATETIMER (0xA003) // Log Rotation Retry
#define ID_AUTOSCROLLTIMER (0xA004) // Middle-Click Auto-Scroll
+#define ID_ATOMICSAVETIMER (0xA005) // Atomic Save Detection
//==== Reuse Window Lock Timeout ==============================================
diff --git a/src/Notepad3.vcxproj b/src/Notepad3.vcxproj
index 79e32ce24..5aedbf09c 100644
--- a/src/Notepad3.vcxproj
+++ b/src/Notepad3.vcxproj
@@ -246,7 +246,7 @@
false
true
Disabled
- MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;WIN32;STATIC_BUILD;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+ MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;WIN32;STATIC_BUILD;_DEBUG;DEBUG;%(PreprocessorDefinitions)
MultiThreadedDebug
Level4
false
@@ -321,7 +321,7 @@
false
true
Disabled
- MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_WIN64;STATIC_BUILD;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+ MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_WIN64;STATIC_BUILD;_DEBUG;DEBUG;%(PreprocessorDefinitions)
MultiThreadedDebug
Level4
false
@@ -395,7 +395,7 @@
false
true
Disabled
- MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_WIN64;STATIC_BUILD;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+ MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_WIN64;STATIC_BUILD;_DEBUG;DEBUG;%(PreprocessorDefinitions)
MultiThreadedDebug
Level4
false
@@ -466,7 +466,7 @@
.;../scintilla/include;../lexilla;../lexilla/include;%(AdditionalIncludeDirectories)
true
MaxSpeed
- MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;WIN32;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
+ MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;WIN32;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
MultiThreaded
Level4
None
@@ -552,7 +552,7 @@
.;../scintilla/include;../lexilla;../lexilla/include;%(AdditionalIncludeDirectories)
true
MaxSpeed
- MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;WIN32;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
+ MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;WIN32;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
MultiThreaded
Level4
None
@@ -638,7 +638,7 @@
.;../scintilla/include;../lexilla;../lexilla/include;%(AdditionalIncludeDirectories)
true
MaxSpeed
- MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_WIN64;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
+ MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_WIN64;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
MultiThreaded
Level4
None
@@ -723,7 +723,7 @@
.;../scintilla/include;../lexilla;../lexilla/include;%(AdditionalIncludeDirectories)
true
MaxSpeed
- MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_WIN64;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
+ MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_WIN64;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
MultiThreaded
Level4
None
@@ -808,7 +808,7 @@
.;../scintilla/include;../lexilla;../lexilla/include;%(AdditionalIncludeDirectories)
true
MaxSpeed
- MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_WIN64;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
+ MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_WIN64;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
MultiThreaded
Level4
None
@@ -893,7 +893,7 @@
.;../scintilla/include;../lexilla;../lexilla/include;%(AdditionalIncludeDirectories)
true
MaxSpeed
- MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x601;WINVER=0x601;NTDDI_VERSION=0x06010000;_WIN64;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
+ MUI_BASE_LNG_EN_US;D_NP3_WIN10_DARK_MODE;_WIN32_WINNT=0x0A00;WINVER=0x0A00;NTDDI_VERSION=0x0A000006;_WIN64;STATIC_BUILD;NDEBUG;%(PreprocessorDefinitions)
MultiThreaded
Level4
None
diff --git a/src/PathLib.c b/src/PathLib.c
index 164ebdae5..8cf8ee115 100644
--- a/src/PathLib.c
+++ b/src/PathLib.c
@@ -64,7 +64,7 @@
// ============================================================================
// ============================================================================
-// TODO: if (IsWindows10OrGreater() && OptInRemovedMaxPathLimit()) {}
+// TODO: if (OptInRemovedMaxPathLimit()) {}
// https://docs.microsoft.com/de-de/windows/win32/api/fileapi/nf-fileapi-getfileattributesa
//
// These are the directory management functions that no longer have MAX_PATH restrictions
@@ -119,14 +119,15 @@
//
// ============================================================================
+#include
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
#ifndef WINVER
-#define WINVER 0x0601 /*_WIN32_WINNT_WIN7*/
+#define WINVER _WIN32_WINNT_WIN10
#endif
#ifndef NTDDI_VERSION
-#define NTDDI_VERSION 0x06010000 /*NTDDI_WIN7*/
+#define NTDDI_VERSION NTDDI_WIN10_RS5
#endif
diff --git a/src/Print.cpp b/src/Print.cpp
index 5e7e68757..2b05be4ae 100644
--- a/src/Print.cpp
+++ b/src/Print.cpp
@@ -24,14 +24,15 @@
#define DBG_NEW new
#endif
+#include
#if !defined(WINVER)
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER _WIN32_WINNT_WIN10
#endif
#if !defined(_WIN32_WINNT)
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
#if !defined(NTDDI_VERSION)
-#define NTDDI_VERSION 0x06010000 /*NTDDI_WIN7*/
+#define NTDDI_VERSION NTDDI_WIN10_RS5
#endif
#define VC_EXTRALEAN 1
#define WIN32_LEAN_AND_MEAN 1
diff --git a/src/TypeDefs.h b/src/TypeDefs.h
index 310b3bce6..362b9137d 100644
--- a/src/TypeDefs.h
+++ b/src/TypeDefs.h
@@ -13,23 +13,16 @@
* *
*******************************************************************************/
+#include
+
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
#ifndef WINVER
-#define WINVER 0x0601 /*_WIN32_WINNT_WIN7*/
+#define WINVER _WIN32_WINNT_WIN10
#endif
#ifndef NTDDI_VERSION
-#define NTDDI_VERSION 0x06010000 /*NTDDI_WIN7*/
-#endif
-
-#if 0
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN7*/
-#undef WINVER
-#define WINVER 0x0A00 /*_WIN32_WINNT_WIN7*/
-#undef NTDDI_VERSION
-#define NTDDI_VERSION 0x0A000000 /*NTDDI_WIN7*/
+#define NTDDI_VERSION NTDDI_WIN10_RS5
#endif
@@ -41,6 +34,9 @@
#define NOMINMAX
#endif
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN 1
+#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
@@ -869,6 +865,7 @@ typedef struct BackgroundWorker {
typedef struct FCOBSRVDATA_T {
volatile LONG64 iFileChangeNotifyTime; // multi-threaded
+ volatile LONG iObservationGeneration; // seqlock: incremented before+after fdCurFile writes
WIN32_FIND_DATA fdCurFile;
HANDLE hEventFileChanged;
@@ -879,7 +876,7 @@ typedef struct FCOBSRVDATA_T {
} FCOBSRVDATA_T, *PFCOBSRVDATA_T;
-#define INIT_FCOBSRV_T { 0LL, { 0 }, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, { NULL, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, NULL } }
+#define INIT_FCOBSRV_T { 0LL, 0L, { 0 }, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, { NULL, INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, NULL } }
#define MIN_FC_POLL_INTERVAL (200LL)
#define MAX_FC_POLL_INTERVAL ((24LL * 60 * 60 * 1000) << 1) // max: 48h
diff --git a/src/_backlog/AccelKeys.c b/src/_backlog/AccelKeys.c
index 8e691c0ee..500d2365c 100644
--- a/src/_backlog/AccelKeys.c
+++ b/src/_backlog/AccelKeys.c
@@ -18,14 +18,15 @@
// ============================================================================
+#include
#if !defined(WINVER)
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER _WIN32_WINNT_WIN10
#endif
#if !defined(_WIN32_WINNT)
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
#if !defined(NTDDI_VERSION)
-#define NTDDI_VERSION 0x06010000 /*NTDDI_WIN7*/
+#define NTDDI_VERSION NTDDI_WIN10_RS5
#endif
#define VC_EXTRALEAN 1
#define WIN32_LEAN_AND_MEAN 1
diff --git a/src/ced/targetver.h b/src/ced/targetver.h
index 8679e8224..2b30fb35f 100644
--- a/src/ced/targetver.h
+++ b/src/ced/targetver.h
@@ -6,5 +6,5 @@
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include
-#define _WIN32_WINNT 0x500
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#include
diff --git a/src/crypto/crypto.c b/src/crypto/crypto.c
index 472725efb..31aa689ba 100644
--- a/src/crypto/crypto.c
+++ b/src/crypto/crypto.c
@@ -12,14 +12,15 @@ optionally with master key
see ecryption-doc.txt for details
*/
+#include
#if !defined(WINVER)
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER _WIN32_WINNT_WIN10
#endif
#if !defined(_WIN32_WINNT)
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
#if !defined(NTDDI_VERSION)
-#define NTDDI_VERSION 0x06010000 /*NTDDI_WIN7*/
+#define NTDDI_VERSION NTDDI_WIN10_RS5
#endif
#define VC_EXTRALEAN 1
#define WIN32_LEAN_AND_MEAN 1
diff --git a/src/crypto/notepadcrypt.c b/src/crypto/notepadcrypt.c
index 72b08f946..9ae3aa1da 100644
--- a/src/crypto/notepadcrypt.c
+++ b/src/crypto/notepadcrypt.c
@@ -11,6 +11,8 @@
* also http://nayuki.eigenstate.org/page/notepadcrypt-format-decryptor-java
*/
#include "targetver.h"
+#define VC_EXTRALEAN 1
+#define WIN32_LEAN_AND_MEAN 1
#include
#include
#include
diff --git a/src/crypto/rijndael-api-fst.c b/src/crypto/rijndael-api-fst.c
index 991133c5d..e90ed1c8b 100644
--- a/src/crypto/rijndael-api-fst.c
+++ b/src/crypto/rijndael-api-fst.c
@@ -41,14 +41,15 @@
have been tweaked for compatibility with the local environment.
*/
+#include
#if !defined(WINVER)
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER _WIN32_WINNT_WIN10
#endif
#if !defined(_WIN32_WINNT)
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT _WIN32_WINNT_WIN10
#endif
#if !defined(NTDDI_VERSION)
-#define NTDDI_VERSION 0x06010000 /*NTDDI_WIN7*/
+#define NTDDI_VERSION NTDDI_WIN10_RS5
#endif
#define VC_EXTRALEAN 1
#define WIN32_LEAN_AND_MEAN 1
diff --git a/src/resource.h b/src/resource.h
index 3dd5ae619..d5b4991fc 100644
--- a/src/resource.h
+++ b/src/resource.h
@@ -3,10 +3,10 @@
// Used by Notepad3.rc
//
#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x601 /*_WIN32_WINNT_WIN7*/
+#define _WIN32_WINNT 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
#ifndef WINVER
-#define WINVER 0x601 /*_WIN32_WINNT_WIN7*/
+#define WINVER 0x0A00 /*_WIN32_WINNT_WIN10*/
#endif
// ==========================================