Index: reactos/base/applications/CMakeLists.txt =================================================================== --- reactos/base/applications/CMakeLists.txt (revision 74717) +++ reactos/base/applications/CMakeLists.txt (working copy) @@ -27,6 +27,8 @@ add_subdirectory(network) add_subdirectory(notepad) add_subdirectory(osk) +add_subdirectory(paint) +add_subdirectory(pbrush) add_subdirectory(rapps) add_subdirectory(regedit) add_subdirectory(regedt32) Index: reactos/base/applications/paint/CMakeLists.txt =================================================================== --- reactos/base/applications/paint/CMakeLists.txt (nonexistent) +++ reactos/base/applications/paint/CMakeLists.txt (working copy) @@ -0,0 +1,5 @@ + +add_executable(paint paint.c rsrc.rc) +set_module_type(paint win32gui UNICODE) +add_importlibs(paint user32 gdi32 msvcrt kernel32) +add_cd_file(TARGET paint DESTINATION reactos/system32 FOR all) Index: reactos/base/applications/paint/lang/En.rc =================================================================== --- reactos/base/applications/paint/lang/En.rc (nonexistent) +++ reactos/base/applications/paint/lang/En.rc (working copy) @@ -0,0 +1,28 @@ +/* + * English language support + * + * Copyright (C) 2007 Mikolaj Zalewski + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "resources.h" + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + IDS_FAILED, "Starting mspaint failed" +} Index: reactos/base/applications/paint/paint.c =================================================================== --- reactos/base/applications/paint/paint.c (nonexistent) +++ reactos/base/applications/paint/paint.c (working copy) @@ -0,0 +1,53 @@ +/* + * pbrush.exe - this program only calls mspaint.exe + * + * Copyright 2017 Katayama Hirofumi MZ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include + +#include "resources.h" + +static const WCHAR SZ_MSPAINT[] = {'\\','m','s','p','a','i','n','t','.','e','x','e',0}; + +int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPWSTR szCmdParagraph, int res) +{ + WCHAR path[MAX_PATH]; + STARTUPINFOW stinf; + PROCESS_INFORMATION info; + + if (!GetSystemDirectoryW(path, MAX_PATH - 1 - lstrlenW(SZ_MSPAINT))) + goto failed; + lstrcatW(path, SZ_MSPAINT); + + stinf.cb = sizeof(STARTUPINFOW); + GetStartupInfoW(&stinf); + + if (!CreateProcessW(path, GetCommandLineW(), NULL, NULL, FALSE, 0, NULL, NULL, &stinf, &info)) + goto failed; + CloseHandle(info.hProcess); + CloseHandle(info.hThread); + return 0; + +failed: + LoadStringW(GetModuleHandleW(NULL), IDS_FAILED, path, MAX_PATH); + MessageBoxW(NULL, path, NULL, MB_OK|MB_ICONERROR); + return 1; +} Index: reactos/base/applications/paint/paint.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: reactos/base/applications/paint/paint.ico =================================================================== --- reactos/base/applications/paint/paint.ico (nonexistent) +++ reactos/base/applications/paint/paint.ico (working copy) Property changes on: reactos/base/applications/paint/paint.ico ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: reactos/base/applications/paint/resources.h =================================================================== --- reactos/base/applications/paint/resources.h (nonexistent) +++ reactos/base/applications/paint/resources.h (working copy) @@ -0,0 +1,21 @@ +/* + * Copyright 2017 Katayama Hirofumi MZ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma once + +#define IDS_FAILED 101 Index: reactos/base/applications/paint/rsrc.rc =================================================================== --- reactos/base/applications/paint/rsrc.rc (nonexistent) +++ reactos/base/applications/paint/rsrc.rc (working copy) @@ -0,0 +1,35 @@ +/* + * Copyright 2017 Katayama Hirofumi MZ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include "resources.h" + +#include + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +1 ICON "paint.ico" + +/* UTF-8 */ +#pragma code_page(65001) + +#ifdef LANGUAGE_EN_US + #include "lang/En.rc" +#endif Index: reactos/base/applications/pbrush/CMakeLists.txt =================================================================== --- reactos/base/applications/pbrush/CMakeLists.txt (nonexistent) +++ reactos/base/applications/pbrush/CMakeLists.txt (working copy) @@ -0,0 +1,5 @@ + +add_executable(pbrush pbrush.c rsrc.rc) +set_module_type(pbrush win32gui UNICODE) +add_importlibs(pbrush user32 gdi32 msvcrt kernel32) +add_cd_file(TARGET pbrush DESTINATION reactos/system32 FOR all) Index: reactos/base/applications/pbrush/lang/En.rc =================================================================== --- reactos/base/applications/pbrush/lang/En.rc (nonexistent) +++ reactos/base/applications/pbrush/lang/En.rc (working copy) @@ -0,0 +1,28 @@ +/* + * English language support + * + * Copyright (C) 2007 Mikolaj Zalewski + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "resources.h" + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + IDS_FAILED, "Starting mspaint failed" +} Index: reactos/base/applications/pbrush/pbrush.c =================================================================== --- reactos/base/applications/pbrush/pbrush.c (nonexistent) +++ reactos/base/applications/pbrush/pbrush.c (working copy) @@ -0,0 +1,53 @@ +/* + * pbrush.exe - this program only calls mspaint.exe + * + * Copyright 2017 Katayama Hirofumi MZ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include + +#include "resources.h" + +static const WCHAR SZ_MSPAINT[] = {'\\','m','s','p','a','i','n','t','.','e','x','e',0}; + +int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPWSTR szCmdParagraph, int res) +{ + WCHAR path[MAX_PATH]; + STARTUPINFOW stinf; + PROCESS_INFORMATION info; + + if (!GetSystemDirectoryW(path, MAX_PATH - 1 - lstrlenW(SZ_MSPAINT))) + goto failed; + lstrcatW(path, SZ_MSPAINT); + + stinf.cb = sizeof(STARTUPINFOW); + GetStartupInfoW(&stinf); + + if (!CreateProcessW(path, GetCommandLineW(), NULL, NULL, FALSE, 0, NULL, NULL, &stinf, &info)) + goto failed; + CloseHandle(info.hProcess); + CloseHandle(info.hThread); + return 0; + +failed: + LoadStringW(GetModuleHandleW(NULL), IDS_FAILED, path, MAX_PATH); + MessageBoxW(NULL, path, NULL, MB_OK|MB_ICONERROR); + return 1; +} Index: reactos/base/applications/pbrush/pbrush.ico =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: reactos/base/applications/pbrush/pbrush.ico =================================================================== --- reactos/base/applications/pbrush/pbrush.ico (nonexistent) +++ reactos/base/applications/pbrush/pbrush.ico (working copy) Property changes on: reactos/base/applications/pbrush/pbrush.ico ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: reactos/base/applications/pbrush/resources.h =================================================================== --- reactos/base/applications/pbrush/resources.h (nonexistent) +++ reactos/base/applications/pbrush/resources.h (working copy) @@ -0,0 +1,21 @@ +/* + * Copyright 2017 Katayama Hirofumi MZ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma once + +#define IDS_FAILED 101 Index: reactos/base/applications/pbrush/rsrc.rc =================================================================== --- reactos/base/applications/pbrush/rsrc.rc (nonexistent) +++ reactos/base/applications/pbrush/rsrc.rc (working copy) @@ -0,0 +1,35 @@ +/* + * Copyright 2017 Katayama Hirofumi MZ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#include "resources.h" + +#include + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +1 ICON "pbrush.ico" + +/* UTF-8 */ +#pragma code_page(65001) + +#ifdef LANGUAGE_EN_US + #include "lang/En.rc" +#endif