Author: hbelusca
Date: Sat Feb 13 23:16:19 2016
New Revision: 70736
URL:
http://svn.reactos.org/svn/reactos?rev=70736&view=rev
Log:
[CLIPBRD]
- Add clipboard file icon by Jared Smudde.
- Open any clipboard data file given in the command line.
[BOOTDATA]
- Add registry entries for file extension .clp.
CORE-10853 #resolve #comment Support added in revision 70736.
Added:
trunk/reactos/base/applications/clipbrd/res/clpfile.ico (with props)
Modified:
trunk/reactos/base/applications/clipbrd/CMakeLists.txt
trunk/reactos/base/applications/clipbrd/clipbrd.c
trunk/reactos/base/applications/clipbrd/clipbrd.rc
trunk/reactos/base/applications/clipbrd/lang/de-DE.rc
trunk/reactos/base/applications/clipbrd/lang/en-US.rc
trunk/reactos/base/applications/clipbrd/lang/es-ES.rc
trunk/reactos/base/applications/clipbrd/lang/fr-FR.rc
trunk/reactos/base/applications/clipbrd/lang/ro-RO.rc
trunk/reactos/base/applications/clipbrd/lang/tr-TR.rc
trunk/reactos/base/applications/clipbrd/lang/zh-CN.rc
trunk/reactos/base/applications/clipbrd/lang/zh-TW.rc
trunk/reactos/base/applications/clipbrd/resources.h
trunk/reactos/boot/bootdata/hivecls.inf
Modified: trunk/reactos/base/applications/clipbrd/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/CMakeLists.txt [iso-8859-1] Sat Feb 13
23:16:19 2016
@@ -2,9 +2,9 @@
list(APPEND SOURCE
clipbrd.c
cliputils.c
- winutils.c
fileutils.c
scrollutils.c
+ winutils.c
precomp.h)
add_executable(clipbrd ${SOURCE} clipbrd.rc)
Modified: trunk/reactos/base/applications/clipbrd/clipbrd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/clipbrd.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/clipbrd.c [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -63,6 +63,23 @@
CloseClipboard();
}
+static void LoadClipboardDataFromFile(LPWSTR lpszFileName)
+{
+ if (!OpenClipboard(Globals.hMainWnd))
+ {
+ ShowLastWin32Error(Globals.hMainWnd);
+ return;
+ }
+
+ if (MessageBoxRes(Globals.hMainWnd, Globals.hInstance, STRING_DELETE_MSG,
STRING_DELETE_TITLE, MB_ICONWARNING | MB_YESNO) == IDYES)
+ {
+ EmptyClipboard();
+ ReadClipboardFile(lpszFileName);
+ }
+
+ CloseClipboard();
+}
+
static void LoadClipboardFromFile(void)
{
OPENFILENAMEW ofn;
@@ -87,19 +104,7 @@
if (!GetOpenFileNameW(&ofn))
return;
- if (!OpenClipboard(Globals.hMainWnd))
- {
- ShowLastWin32Error(Globals.hMainWnd);
- return;
- }
-
- if (MessageBoxRes(Globals.hMainWnd, Globals.hInstance, STRING_DELETE_MSG,
STRING_DELETE_TITLE, MB_ICONWARNING | MB_YESNO) == IDYES)
- {
- EmptyClipboard();
- ReadClipboardFile(szFileName);
- }
-
- CloseClipboard();
+ LoadClipboardDataFromFile(szFileName);
}
static void LoadClipboardFromDrop(HDROP hDrop)
@@ -109,19 +114,7 @@
DragQueryFileW(hDrop, 0, szFileName, ARRAYSIZE(szFileName));
DragFinish(hDrop);
- if (!OpenClipboard(Globals.hMainWnd))
- {
- ShowLastWin32Error(Globals.hMainWnd);
- return;
- }
-
- if (MessageBoxRes(Globals.hMainWnd, Globals.hInstance, STRING_DELETE_MSG,
STRING_DELETE_TITLE, MB_ICONWARNING | MB_YESNO) == IDYES)
- {
- EmptyClipboard();
- ReadClipboardFile(szFileName);
- }
-
- CloseClipboard();
+ LoadClipboardDataFromFile(szFileName);
}
static void SetDisplayFormat(UINT uFormat)
@@ -169,7 +162,7 @@
DrawMenuBar(Globals.hMainWnd);
}
-void UpdateDisplayMenu(void)
+static void UpdateDisplayMenu(void)
{
UINT uFormat;
WCHAR szFormatName[MAX_FMT_NAME_LEN + 1];
@@ -258,7 +251,7 @@
WCHAR szTitle[MAX_STRING_LEN];
HICON hIcon;
- hIcon = LoadIconW(Globals.hInstance, MAKEINTRESOURCE(CLIP_ICON));
+ hIcon = LoadIconW(Globals.hInstance, MAKEINTRESOURCE(CLIPBRD_ICON));
LoadStringW(Globals.hInstance, STRING_CLIPBOARD, szTitle,
ARRAYSIZE(szTitle));
ShellAboutW(Globals.hMainWnd, szTitle, 0, hIcon);
DeleteObject(hIcon);
@@ -346,6 +339,28 @@
{
switch(uMsg)
{
+ case WM_CREATE:
+ {
+ Globals.hMenu = GetMenu(hWnd);
+ Globals.hWndNext = SetClipboardViewer(hWnd);
+ UpdateDisplayMenu();
+ SetDisplayFormat(0);
+ break;
+ }
+
+ case WM_CLOSE:
+ {
+ DestroyWindow(hWnd);
+ break;
+ }
+
+ case WM_DESTROY:
+ {
+ ChangeClipboardChain(hWnd, Globals.hWndNext);
+ PostQuitMessage(0);
+ break;
+ }
+
case WM_PAINT:
{
ClipboardPaintHandler(hWnd, uMsg, wParam, lParam);
@@ -392,28 +407,6 @@
InvalidateRect(Globals.hMainWnd, NULL, TRUE);
}
- break;
- }
-
- case WM_CREATE:
- {
- Globals.hMenu = GetMenu(hWnd);
- Globals.hWndNext = SetClipboardViewer(hWnd);
- UpdateDisplayMenu();
- SetDisplayFormat(0);
- break;
- }
-
- case WM_CLOSE:
- {
- DestroyWindow(hWnd);
- break;
- }
-
- case WM_DESTROY:
- {
- ChangeClipboardChain(hWnd, Globals.hWndNext);
- PostQuitMessage(0);
break;
}
@@ -534,7 +527,7 @@
wndclass.cbSize = sizeof(wndclass);
wndclass.lpfnWndProc = MainWndProc;
wndclass.hInstance = hInstance;
- wndclass.hIcon = LoadIconW(hInstance, MAKEINTRESOURCEW(CLIP_ICON));
+ wndclass.hIcon = LoadIconW(hInstance, MAKEINTRESOURCEW(CLIPBRD_ICON));
wndclass.hCursor = LoadCursorW(0, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndclass.lpszMenuName = MAKEINTRESOURCEW(MAIN_MENU);
@@ -574,6 +567,10 @@
ShowLastWin32Error(Globals.hMainWnd);
}
+ /* If the user provided a path to a clipboard data file, try to open it */
+ if (lpCmdLine != NULL && *lpCmdLine)
+ LoadClipboardDataFromFile(lpCmdLine);
+
UpdateLinesToScroll();
while (GetMessageW(&msg, 0, 0, 0))
Modified: trunk/reactos/base/applications/clipbrd/clipbrd.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/clipbrd.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/clipbrd.rc [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -8,7 +8,8 @@
#define REACTOS_STR_ORIGINAL_FILENAME "clipbrd.exe"
#include <reactos/version.rc>
-CLIP_ICON ICON "res/clipbrd.ico"
+CLIPBRD_ICON ICON "res/clipbrd.ico"
+CLPFILE_ICON ICON "res/clpfile.ico"
#include <reactos/manifest_exe.rc>
Modified: trunk/reactos/base/applications/clipbrd/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/lang/de-DE.rc [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -33,6 +33,7 @@
STRINGTABLE
BEGIN
STRING_CLIPBOARD "Zwischenablage"
+ STRING_CLIPFILE "Clipboard Element"
STRING_DELETE_MSG "Soll der Inhalt der Zwischenablage gelöscht werden?"
STRING_DELETE_TITLE "Zwischenablage löschen"
STRING_FORMAT_NT "Zwischenablagedateien für ReactOS (*.clp)"
Modified: trunk/reactos/base/applications/clipbrd/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/lang/en-US.rc [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -33,6 +33,7 @@
STRINGTABLE
BEGIN
STRING_CLIPBOARD "Clipboard"
+ STRING_CLIPFILE "Clipboard Element"
STRING_DELETE_MSG "Clear contents of the Clipboard?"
STRING_DELETE_TITLE "Clear Clipboard"
STRING_FORMAT_NT "Clipboard files for ReactOS (*.clp)"
Modified: trunk/reactos/base/applications/clipbrd/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/lang/es-ES.rc [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -35,6 +35,7 @@
STRINGTABLE
BEGIN
STRING_CLIPBOARD "Portapapeles"
+ STRING_CLIPFILE "Clipboard Element"
STRING_DELETE_MSG "¿Borrar contenidos del Portapapeles?"
STRING_DELETE_TITLE "Vaciar Portapapeles"
STRING_FORMAT_NT "Archivos de Portapapeles de ReactOS (*.clp)"
Modified: trunk/reactos/base/applications/clipbrd/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/lang/fr-FR.rc [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -18,7 +18,7 @@
BEGIN
MENUITEM "&Supprimer\tSuppr", CMD_DELETE
END
- POPUP "&Affichage"
+ POPUP "Affic&hage"
BEGIN
MENUITEM "&Automatique", CMD_AUTOMATIC
END
@@ -33,6 +33,7 @@
STRINGTABLE
BEGIN
STRING_CLIPBOARD "Presse-papiers"
+ STRING_CLIPFILE "Ãlément du Presse-papiers"
STRING_DELETE_MSG "Voulez-vous effacer le contenu du Presse-papiers ?"
STRING_DELETE_TITLE "Effacer le Presse-papiers"
STRING_FORMAT_NT "Fichiers du Presse-papiers ReactOS (*.clp)"
Modified: trunk/reactos/base/applications/clipbrd/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/lang/ro-RO.rc [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -34,6 +34,7 @@
STRINGTABLE
BEGIN
STRING_CLIPBOARD "Clipboard"
+ STRING_CLIPFILE "Clipboard Element"
STRING_DELETE_MSG "EliminÄ conÈinutul din Clipboard?"
STRING_DELETE_TITLE "CurÄÈÄ Clipboard"
STRING_FORMAT_NT "FiÈiere clipboard pentru ReactOS (*.clp)"
Modified: trunk/reactos/base/applications/clipbrd/lang/tr-TR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/lang/tr-TR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/lang/tr-TR.rc [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -35,6 +35,7 @@
STRINGTABLE
BEGIN
STRING_CLIPBOARD "Pano"
+ STRING_CLIPFILE "Clipboard Element"
STRING_DELETE_MSG "Pano içeriÄini sil?"
STRING_DELETE_TITLE "Pano Sil"
STRING_FORMAT_NT "ReactOS İçin Pano Kütükleri (*.clp)"
Modified: trunk/reactos/base/applications/clipbrd/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/lang/zh-CN.rc [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -35,6 +35,7 @@
STRINGTABLE
BEGIN
STRING_CLIPBOARD "åªè´´æ¿"
+ STRING_CLIPFILE "Clipboard Element"
STRING_DELETE_MSG "æ¸
é¤åªè´´æ¿çå
容å?"
STRING_DELETE_TITLE "æ¸
é¤åªè´´æ¿"
STRING_FORMAT_NT "ReactOS çåªè´´æ¿æ件 (*.clp)"
Modified: trunk/reactos/base/applications/clipbrd/lang/zh-TW.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/lang/zh-TW.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/lang/zh-TW.rc [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -35,6 +35,7 @@
STRINGTABLE
BEGIN
STRING_CLIPBOARD "åªè²¼ç°¿"
+ STRING_CLIPFILE "Clipboard Element"
STRING_DELETE_MSG "æ¸
é¤åªè²¼ç°¿çå
§å®¹å?"
STRING_DELETE_TITLE "æ¸
é¤åªè²¼ç°¿"
STRING_FORMAT_NT "ReactOS çåªè²¼ç°¿æªæ¡ (*.clp)"
Added: trunk/reactos/base/applications/clipbrd/res/clpfile.ico
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
Binary file - no diff available.
Propchange: trunk/reactos/base/applications/clipbrd/res/clpfile.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: trunk/reactos/base/applications/clipbrd/resources.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/clipbrd/…
==============================================================================
--- trunk/reactos/base/applications/clipbrd/resources.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/clipbrd/resources.h [iso-8859-1] Sat Feb 13 23:16:19
2016
@@ -1,38 +1,40 @@
#pragma once
-#define MAIN_MENU 100
-#define CLIP_ICON 101
-#define ID_ACCEL 102
+#define CLIPBRD_ICON 100
+#define CLPFILE_ICON 101
+#define MAIN_MENU 102
+#define ID_ACCEL 103
-#define CMD_OPEN 100
-#define CMD_SAVE_AS 101
-#define CMD_EXIT 102
-#define CMD_DELETE 103
-#define CMD_HELP 105
-#define CMD_ABOUT 106
+#define CMD_OPEN 110
+#define CMD_SAVE_AS 111
+#define CMD_EXIT 112
+#define CMD_DELETE 113
+#define CMD_HELP 115
+#define CMD_ABOUT 116
#define CMD_AUTOMATIC 1000
-#define STRING_CLIPBOARD 100
-#define STRING_DELETE_MSG 101
-#define STRING_DELETE_TITLE 102
-#define STRING_FORMAT_NT 103
-#define STRING_FORMAT_GEN 104
+#define STRING_CLIPBOARD 120
+#define STRING_CLIPFILE 121
+#define STRING_DELETE_MSG 123
+#define STRING_DELETE_TITLE 124
+#define STRING_FORMAT_NT 125
+#define STRING_FORMAT_GEN 126
#define STRING_CF_UNKNOWN 200
#define STRING_CF_TEXT 201
#define STRING_CF_BITMAP 202
-#define STRING_CF_OEMTEXT 203
-#define STRING_CF_UNICODETEXT 204
-#define STRING_CF_DIB 205
-#define STRING_CF_LOCALE 206
-#define STRING_CF_ENHMETAFILE 207
-#define STRING_CF_METAFILEPICT 208
+#define STRING_CF_METAFILEPICT 203
+#define STRING_CF_SYLK 204
+#define STRING_CF_DIF 205
+#define STRING_CF_OEMTEXT 207
+#define STRING_CF_DIB 208
#define STRING_CF_PALETTE 209
-#define STRING_CF_DIBV5 210
-#define STRING_CF_SYLK 211
-#define STRING_CF_DIF 212
-#define STRING_CF_HDROP 213
+#define STRING_CF_UNICODETEXT 213
+#define STRING_CF_ENHMETAFILE 214
+#define STRING_CF_HDROP 215
+#define STRING_CF_LOCALE 216
+#define STRING_CF_DIBV5 217
#define ERROR_UNSUPPORTED_FORMAT 300
#define ERROR_INVALID_FILE_FORMAT 301
Modified: trunk/reactos/boot/bootdata/hivecls.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivecls.inf?…
==============================================================================
--- trunk/reactos/boot/bootdata/hivecls.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivecls.inf [iso-8859-1] Sat Feb 13 23:16:19 2016
@@ -22,6 +22,13 @@
HKCR,"CLSID\{5F5295E0-429F-1069-A2E2-08002B30309D}","",0x00000000,"Drive
Property Page Extension"
HKCR,"CLSID\{5F5295E0-429F-1069-A2E2-08002B30309D}\InProcServer32","",0x00000000,"shell32.dll"
HKCR,"CLSID\{5F5295E0-429F-1069-A2E2-08002B30309D}\InProcServer32","ThreadingModel",0x00000000,"Apartment"
+
+; Clipboard Element
+HKCR,".clp","",0x00000000,"clpfile"
+HKCR,"clpfile","",0x00000000,"Clipboard Element"
+HKCR,"clpfile","FriendlyTypeName",0x00020000,"(a)%SystemRoot%\system32\clipbrd.exe,-121"
+HKCR,"clpfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\clipbrd.exe,1"
+HKCR,"clpfile\shell\open\command","",0x00000000,"clipbrd.exe
%1"
; Rich Text Files
HKCR,".rtf","",0x00000000,"rtffile"