}\
}
+#define safeFree(p)\
+ free(p);\
+ (p) = NULL
#define sswitch() do
#define endsswitch() while(FALSE)
<None Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="..\nlite\targetver.h" />
<ClInclude Include="stdafx.h" />
</ItemGroup>
<ItemGroup>
#pragma once
-#include <targetver.h>
+#include <nlite\targetver.h>
#include <stdio.h>
#include <tchar.h>
{E36BC5DE-60A1-4A78-90EA-F3BFEF89F9A8}.Release|Win32.ActiveCfg = Release|Win32
{E36BC5DE-60A1-4A78-90EA-F3BFEF89F9A8}.Release|Win32.Build.0 = Release|Win32
{EB0B5264-9BB4-4EE3-B196-A0472DCB32A8}.Debug|Win32.ActiveCfg = Debug|Win32
- {EB0B5264-9BB4-4EE3-B196-A0472DCB32A8}.Debug-window|Win32.ActiveCfg = Debug|Win32
- {EB0B5264-9BB4-4EE3-B196-A0472DCB32A8}.Debug-window|Win32.Build.0 = Debug|Win32
+ {EB0B5264-9BB4-4EE3-B196-A0472DCB32A8}.Debug-window|Win32.ActiveCfg = Debug-window|Win32
+ {EB0B5264-9BB4-4EE3-B196-A0472DCB32A8}.Debug-window|Win32.Build.0 = Debug-window|Win32
{EB0B5264-9BB4-4EE3-B196-A0472DCB32A8}.Release|Win32.ActiveCfg = Release|Win32
{EB0B5264-9BB4-4EE3-B196-A0472DCB32A8}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by nlite.rc
-//
-
-#define IDS_APP_TITLE 103
-
-#define IDR_MAINFRAME 128
-#define IDD_NLITE_DIALOG 102
-#define IDD_ABOUTBOX 103
-#define IDM_ABOUT 104
-#define IDM_EXIT 105
-#define IDI_NLITE 107
-#define IDI_SMALL 108
-#define IDC_NLITE 109
-#define IDC_MYICON 2
#ifndef IDC_STATIC
-#define IDC_STATIC -1
+#define IDC_STATIC (-1)
#endif
-// \90V\82µ\82¢\83I\83u\83W\83F\83N\83g\82Ì\8e\9f\82Ì\8aù\92è\92l
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NO_MFC 130
-#define _APS_NEXT_RESOURCE_VALUE 129
-#define _APS_NEXT_COMMAND_VALUE 32771
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 110
-#endif
-#endif
+#define IDM_ABOUT 104
+#define IDM_EXIT 105
+#define IDI_NLITE 107
+#define IDI_SMALL 108
+#define IDC_NLITE 109
#include "stdafx.h"
#include "nlite_include.h"
+using namespace nlite;
-#define MAX_LOADSTRING 100
+CAppModule _Module;
-// \83O\83\8d\81[\83o\83\8b\95Ï\90\94:
-HINSTANCE hInst; // \8c»\8dÝ\82Ì\83C\83\93\83^\81[\83t\83F\83C\83X
-TCHAR szTitle[MAX_LOADSTRING]; // \83^\83C\83g\83\8b \83o\81[\82Ì\83e\83L\83X\83g
-TCHAR szWindowClass[MAX_LOADSTRING]; // \83\81\83C\83\93 \83E\83B\83\93\83h\83E \83N\83\89\83X\96¼
+const nlite::CApplicationInfo* appInfo = NULL;
-// \82±\82Ì\83R\81[\83h \83\82\83W\83\85\81[\83\8b\82É\8aÜ\82Ü\82ê\82é\8aÖ\90\94\82Ì\90é\8c¾\82ð\93]\91\97\82µ\82Ü\82·:
-ATOM nliteRegisterClass(HINSTANCE hInstance);
-BOOL InitInstance(HINSTANCE, int);
-LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
-INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
-int APIENTRY _tWinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPTSTR lpCmdLine,
- int nCmdShow)
-{
- UNREFERENCED_PARAMETER(hPrevInstance);
- UNREFERENCED_PARAMETER(lpCmdLine);
-
- // TODO: \82±\82±\82É\83R\81[\83h\82ð\91}\93ü\82µ\82Ä\82\82¾\82³\82¢\81B
- MSG msg;
- HACCEL hAccelTable;
-
- // \83O\83\8d\81[\83o\83\8b\95¶\8e\9a\97ñ\82ð\8f\89\8aú\89»\82µ\82Ä\82¢\82Ü\82·\81B
- LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
- LoadString(hInstance, IDC_NLITE, szWindowClass, MAX_LOADSTRING);
- nliteRegisterClass(hInstance);
-
- // \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\8f\89\8aú\89»\82ð\8eÀ\8ds\82µ\82Ü\82·:
- if (!InitInstance (hInstance, nCmdShow))
- {
- return FALSE;
- }
- hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_NLITE));
- // \83\81\83C\83\93 \83\81\83b\83Z\81[\83W \83\8b\81[\83v:
- while (GetMessage(&msg, NULL, 0, 0))
- {
- if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
+static BOOL InitializeNlite(); //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8f\89\8aú\89»
+static VOID FinalizeNlite(); //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8fI\97¹\8f\88\97\9d
+int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE,
+ LPTSTR lpCmdLine, int nCmdShow)
+{
+
+ int nRet = -1;
+ try{
+ if(_Module.Init(NULL, hInstance) != S_OK){
+ throw AppInitException();
}
- }
+
+ InitializeNlite();
+
- return (int) msg.wParam;
-}
+
+ CMessageLoop theLoop;
+ _Module.AddMessageLoop(&theLoop);
+ // \93Æ\8e©\83E\83B\83\93\83h\83E\82ð\8dì\90¬
+ CNliteMainFrame wnd;
+ wnd.CreateEx();
+ wnd.ShowWindow(nCmdShow);
+ wnd.UpdateWindow();
+ nRet = theLoop.Run();
-//
-// \8aÖ\90\94: nliteRegisterClass()
-//
-// \96Ú\93I: \83E\83B\83\93\83h\83E \83N\83\89\83X\82ð\93o\98^\82µ\82Ü\82·\81B
-//
-// \83R\83\81\83\93\83g:
-//
-// \82±\82Ì\8aÖ\90\94\82¨\82æ\82Ñ\8eg\82¢\95û\82Í\81A'RegisterClassEx' \8aÖ\90\94\82ª\92Ç\89Á\82³\82ê\82½
-// Windows 95 \82æ\82è\91O\82Ì Win32 \83V\83X\83e\83\80\82Æ\8cÝ\8a·\82³\82¹\82é\8fê\8d\87\82É\82Ì\82Ý\95K\97v\82Å\82·\81B
-// \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ª\81A\8aÖ\98A\95t\82¯\82ç\82ê\82½
-// \90³\82µ\82¢\8c`\8e®\82Ì\8f¬\82³\82¢\83A\83C\83R\83\93\82ð\8eæ\93¾\82Å\82«\82é\82æ\82¤\82É\82·\82é\82É\82Í\81A
-// \82±\82Ì\8aÖ\90\94\82ð\8cÄ\82Ñ\8fo\82µ\82Ä\82\82¾\82³\82¢\81B
-//
-ATOM nliteRegisterClass(HINSTANCE hInstance)
-{
- WNDCLASSEX wcex;
-
- wcex.cbSize = sizeof(WNDCLASSEX);
-
- wcex.style = CS_HREDRAW | CS_VREDRAW;
- wcex.lpfnWndProc = WndProc;
- wcex.cbClsExtra = 0;
- wcex.cbWndExtra = 0;
- wcex.hInstance = hInstance;
- wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_NLITE));
- wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
- wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
- wcex.lpszMenuName = MAKEINTRESOURCE(IDC_NLITE);
- wcex.lpszClassName = szWindowClass;
- wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
-
- return RegisterClassEx(&wcex);
+ _Module.RemoveMessageLoop();
+ } catch(std::exception e){
+
+ MessageBoxA(NULL,e.what(),"\83A\83v\83\8a\83P\81[\83V\83\87\83\93\83G\83\89\81[",MB_OK);
+ }
+
+ FinalizeNlite();
+ _Module.Term();
+
+ return nRet;
}
-//
-// \8aÖ\90\94: InitInstance(HINSTANCE, int)
-//
-// \96Ú\93I: \83C\83\93\83X\83^\83\93\83X \83n\83\93\83h\83\8b\82ð\95Û\91¶\82µ\82Ä\81A\83\81\83C\83\93 \83E\83B\83\93\83h\83E\82ð\8dì\90¬\82µ\82Ü\82·\81B
-//
-// \83R\83\81\83\93\83g:
-//
-// \82±\82Ì\8aÖ\90\94\82Å\81A\83O\83\8d\81[\83o\83\8b\95Ï\90\94\82Å\83C\83\93\83X\83^\83\93\83X \83n\83\93\83h\83\8b\82ð\95Û\91¶\82µ\81A
-// \83\81\83C\83\93 \83v\83\8d\83O\83\89\83\80 \83E\83B\83\93\83h\83E\82ð\8dì\90¬\82¨\82æ\82Ñ\95\\8e¦\82µ\82Ü\82·\81B
-//
-BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
-{
- HWND hWnd;
+static BOOL InitializeNlite(){
- hInst = hInstance; // \83O\83\8d\81[\83o\83\8b\95Ï\90\94\82É\83C\83\93\83X\83^\83\93\83X\8f\88\97\9d\82ð\8ai\94[\82µ\82Ü\82·\81B
+ BOOL rslt = FALSE;
- hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
+ try{
- if (!hWnd)
- {
- return FALSE;
- }
+ appInfo = &CApplicationInfo::getInstance();
+
- ShowWindow(hWnd, nCmdShow);
- UpdateWindow(hWnd);
+ }catch (AppInitException e){
- return TRUE;
-}
+ return rslt;
-//
-// \8aÖ\90\94: WndProc(HWND, UINT, WPARAM, LPARAM)
-//
-// \96Ú\93I: \83\81\83C\83\93 \83E\83B\83\93\83h\83E\82Ì\83\81\83b\83Z\81[\83W\82ð\8f\88\97\9d\82µ\82Ü\82·\81B
-//
-// WM_COMMAND - \83A\83v\83\8a\83P\81[\83V\83\87\83\93 \83\81\83j\83\85\81[\82Ì\8f\88\97\9d
-// WM_PAINT - \83\81\83C\83\93 \83E\83B\83\93\83h\83E\82Ì\95`\89æ
-// WM_DESTROY - \92\86\8e~\83\81\83b\83Z\81[\83W\82ð\95\\8e¦\82µ\82Ä\96ß\82é
-//
-//
-LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- int wmId, wmEvent;
- PAINTSTRUCT ps;
- HDC hdc;
-
- switch (message)
- {
- case WM_COMMAND:
- wmId = LOWORD(wParam);
- wmEvent = HIWORD(wParam);
- // \91I\91ð\82³\82ê\82½\83\81\83j\83\85\81[\82Ì\89ð\90Í:
- switch (wmId)
- {
- case IDM_ABOUT:
- DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
- break;
- case IDM_EXIT:
- DestroyWindow(hWnd);
- break;
- default:
- return DefWindowProc(hWnd, message, wParam, lParam);
- }
- break;
- case WM_PAINT:
- hdc = BeginPaint(hWnd, &ps);
- // TODO: \95`\89æ\83R\81[\83h\82ð\82±\82±\82É\92Ç\89Á\82µ\82Ä\82\82¾\82³\82¢...
- EndPaint(hWnd, &ps);
- break;
- case WM_DESTROY:
- PostQuitMessage(0);
- break;
- default:
- return DefWindowProc(hWnd, message, wParam, lParam);
}
- return 0;
-}
-// \83o\81[\83W\83\87\83\93\8fî\95ñ\83{\83b\83N\83X\82Ì\83\81\83b\83Z\81[\83W \83n\83\93\83h\83\89\81[\82Å\82·\81B
-INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
-{
- UNREFERENCED_PARAMETER(lParam);
- switch (message)
- {
- case WM_INITDIALOG:
- return (INT_PTR)TRUE;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
- {
- EndDialog(hDlg, LOWORD(wParam));
- return (INT_PTR)TRUE;
- }
- break;
- }
- return (INT_PTR)FALSE;
+ rslt = TRUE;
+
+
+ return rslt;
}
+
+
+ VOID FinalizeNlite(){
+
+
+
+ return;
+ }
\ No newline at end of file
#pragma once
-#include "resource.h"
+
+extern const nlite::CApplicationInfo* appInfo;
+
+namespace nlite{
+
+
+
+
+}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug-window|Win32">
+ <Configuration>Debug-window</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-window|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-window|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-window|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-window|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<None Include="small.ico" />
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="nlite.h" />
+ <ClInclude Include="nlite_commentview.h" />
+ <ClInclude Include="nlite_common.h" />
+ <ClInclude Include="nlite_define.h" />
+ <ClInclude Include="nlite_exception.h" />
<ClInclude Include="nlite_include.h" />
+ <ClInclude Include="nlite_listviewex.h" />
+ <ClInclude Include="nlite_mailframe.h" />
+ <ClInclude Include="nlite_appinfo.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="nlite.cpp" />
+ <ClCompile Include="nlite_appInfo.cpp" />
+ <ClCompile Include="nlite_mainframe.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-window|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
--- /dev/null
+#include "stdafx.h"
+#include "nlite_include.h"
+using namespace nlite;
+
+CApplicationInfo::CApplicationInfo(){
+
+ struct LANGANDCODEPAGE {
+
+ WORD wLanguage;
+ WORD wCodePage;
+ } *lpTranslate;
+ TCHAR szModuleName[_MAX_PATH + 1] = {0}; //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\83t\83@\83C\83\8b\96¼
+ try{
+ static const AppInitException err; //\97á\8aO\83N\83\89\83X
+ DWORD dwReserved;
+ LPTSTR errMessage = NULL;
+ int nRet = GetModuleFileName(NULL,szModuleName,ARRAYSIZE(szModuleName));
+ assert(nRet > 0);
+
+ if(nRet <= 0){
+
+
+ throw err;
+ }
+
+
+ DWORD dwSize = GetFileVersionInfoSize(szModuleName,&dwReserved);
+
+ assert(dwSize > 0);
+
+ if(dwSize <= 0){
+
+ throw err;
+ }
+
+ pBlock = malloc(dwSize);
+ assert(pBlock != NULL);
+
+ BOOL bRet = GetFileVersionInfo(szModuleName,0,dwSize,pBlock);
+
+ assert(bRet);
+
+ if(bRet != TRUE){
+ throw err;
+ }
+
+ UINT ulen;
+ if(VerQueryValue(pBlock,TEXT("\\VarFileInfo\\Translation"),(LPVOID*)&lpTranslate,&ulen) == FALSE){
+ throw err;
+ }
+
+ TCHAR subBlock[_MAX_PATH];
+ _stprintf(subBlock,TEXT("\\StringFileInfo\\%04x%04x\\ProductVersion"),lpTranslate->wLanguage,lpTranslate->wCodePage);
+
+ if(VerQueryValue(pBlock,subBlock,(LPVOID *)&pProductVersion,&ulen) == FALSE){
+
+ throw err;
+
+ }
+
+ _stprintf(subBlock,TEXT("\\StringFileInfo\\%04x%04x\\OriginalFilename"),lpTranslate->wLanguage,lpTranslate->wCodePage);
+
+ if(VerQueryValue(pBlock,subBlock,(LPVOID *)&pOriginalFileName,&ulen) == FALSE){
+
+ throw err;
+
+ }
+
+ _stprintf(subBlock,TEXT("\\StringFileInfo\\%04x%04x\\LegalCopyright"),lpTranslate->wLanguage,lpTranslate->wCodePage);
+
+ if(VerQueryValue(pBlock,subBlock,(LPVOID *)&pLegalCopyright,&ulen) == FALSE){
+
+ throw err;
+
+ }
+
+ throw err;
+
+
+ } catch (const AppInitException& e){
+
+
+ safeFree(pBlock);
+
+ throw e;
+ }
+
+ return;
+
+
+
+}
+
+
+CApplicationInfo::~CApplicationInfo(){
+
+
+ safeFree(pBlock);
+}
\ No newline at end of file
--- /dev/null
+#pragma once
+
+namespace nlite{
+
+
+
+ ///
+ ///\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8fî\95ñ\83N\83\89\83X(\83V\83\93\83O\83\8b\83g\83\93)
+ ///
+ class CApplicationInfo{
+
+
+
+
+
+ private:
+ LPVOID pBlock; //\83u\83\8d\83b\83N\83o\83b\83t\83@
+ LPTSTR pProductVersion; //\83o\81[\83W\83\87\83\93\8fî\95ñ
+ LPTSTR pOriginalFileName; //\83I\83\8a\83W\83i\83\8b\83t\83@\83C\83\8b\96¼
+ LPTSTR pLegalCopyright; //\92\98\8dì\8c
+ private:
+ ///
+ ///\83R\83\93\83c\83g\83\89\83N\83^
+ ///
+ CApplicationInfo();
+
+ public:
+ ~CApplicationInfo();
+ public:
+
+ ///
+ ///\83V\83\93\83O\83\8b\83g\83\93
+ ///
+ static CApplicationInfo& getInstance(){
+ static CApplicationInfo appInfo;
+ return appInfo;
+
+ }
+
+
+
+
+ //
+ //\83Q\83b\83^\81[
+ //
+
+ LPCTSTR getProductVersion()const{
+
+ return pProductVersion;
+
+ }
+
+ LPCTSTR getOriginalFileName()const{
+
+ return pOriginalFileName;
+
+ }
+
+ LPCTSTR getLegalCopyright()const{
+
+ return pLegalCopyright;
+
+ }
+
+ VOID show() const {
+
+ tstring szApp;
+ tstring szOtherStuff;
+
+
+ szApp.reserve(LENGTH_128);
+ szOtherStuff.reserve(LENGTH_128);
+
+ szApp = pOriginalFileName;
+ szApp += TEXT("\82Ì\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8fî\95ñ");
+
+ szOtherStuff = TEXT("\83o\81[\83W\83\87\83\93\8fî\95ñ: ");
+ szOtherStuff += pProductVersion;
+ szOtherStuff += TEXT("\r\n\92\98\8dì\8c : ");
+ szOtherStuff += pLegalCopyright;
+
+ ShellAbout(NULL,szApp.c_str(),szOtherStuff.c_str(),NULL);
+ }
+
+ };
+}
\ No newline at end of file
--- /dev/null
+#pragma once
+
+namespace nlite{
+ class CCommentView : public CListViewEx<CCommentView>{
+
+
+
+
+ };
+}
--- /dev/null
+#pragma once
+
--- /dev/null
+#pragma once
+
+//
+//\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\8c^\81E\90\94\92l\92è\8b`
+//
+
+namespace nlite{
+
+ //
+ //\8c^\92è\8b`
+ //
+
+ typedef std::basic_string<TCHAR> tstring; //\95¶\8e\9a\97ñ
+
+
+
+
+
+
+
+
+
+
+}
\ No newline at end of file
--- /dev/null
+#pragma once
+namespace nlite{
+
+ ///
+ ///nlite\97á\8aO\8f\88\97\9d\83N\83\89\83X
+ ///
+ class Exception:public std::exception{
+
+
+
+ //\83R\83\93\83X\83g\83\89\83N\83^
+ public:
+ Exception(){}
+ Exception(const char* const& errMessage):exception(errMessage){}
+
+
+
+ };
+
+
+ class AppInitException : public Exception{
+
+ public:
+
+ AppInitException():Exception("\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8f\89\8aú\89»\82É\8e¸\94s\82µ\82Ü\82µ\82½"){}
+
+
+
+ };
+
+
+
+}
\ No newline at end of file
#pragma once
+
+#include <qwerty\qwerty_common.h>
+#include <qwerty\windebuger.h>
+
#include "resource.h"
+#include "nlite_common.h"
+
+#include "nlite_listviewex.h"
+#include "nlite_commentview.h"
+#include "nlite_define.h"
+#include "nlite_exception.h"
+#include "nlite_appinfo.h"
+#include "nlite.h"
+#include "nlite_mailframe.h"
\ No newline at end of file
--- /dev/null
+#pragma once
+
+namespace nlite{
+
+
+
+
+ const static LPCTSTR LISTVIEW_EX = TEXT("NLITE_LISTVIEW");
+
+
+ const static UINT_PTR headerHaight = 20;
+
+ template<typename TBase>
+ class ATL_NO_VTABLE CListViewEx:public CWindowImpl<TBase>{
+
+ private:
+
+ CHeaderCtrl header;
+ CListBox listBox;
+
+
+
+
+ public:
+
+ DECLARE_WND_CLASS(LISTVIEW_EX)
+
+ //\83\81\83b\83Z\81[\83W\83}\83b\83v
+ BEGIN_MSG_MAP(tn)
+ MSG_WM_CREATE(OnCreate)
+ MSG_WM_DESTROY(OnDestroy)
+ MSG_WM_SIZING(OnSizing)
+ MSG_WM_SIZE(OnSize)
+ END_MSG_MAP()
+
+
+ //\83T\83C\83Y\95Ï\8dX\92\86
+ VOID OnSizing(UINT wParam,LPRECT lParam){
+
+ RECT client;
+ GetClientRect(&client);
+
+ ChangeSize( _WTYPES_NS::CSize(client.right - client.left,client.bottom - client.top));
+ return;
+
+ }
+
+ //\83T\83C\83Y\95Ï\8dX\8cã
+ LRESULT OnSize(UINT wParam,SIZE lParam){
+
+
+
+ ChangeSize(lParam);
+
+ return 0;
+ }
+
+ //\83T\83C\83Y\95Ï\8dX\8f\88\97\9d
+ VOID ChangeSize(const SIZE& client){
+
+ header.MoveWindow(0 , 0,client.cx , headerHaight );
+ listBox.MoveWindow(0,headerHaight,client.cx,client.cy - headerHaight);
+
+
+
+ return;
+ }
+
+
+
+ VOID OnDestroy(){
+ m_hWnd;
+ header.DestroyWindow();
+ listBox.DestroyWindow();
+ return;
+
+ }
+
+
+
+
+
+ LRESULT OnCreate(LPCREATESTRUCT lpcs){
+
+
+
+ vcverify(header.Create(m_hWnd,0,WC_HEADER,WS_CHILD | WS_VISIBLE | WS_BORDER | HDS_BUTTONS),TEXT("\83w\83b\83_\81[\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"));
+ vcverify(listBox.Create(m_hWnd,0,WC_LISTBOX,WS_CHILD | WS_VISIBLE | WS_BORDER),TEXT("\83\8a\83X\83g\83{\83b\83N\83X\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"));
+
+
+ return 0;
+ }
+ /*
+ static LPCTSTR GetWndClassName(){
+ return LISTVIEW_EX;
+ }
+ */
+
+ };
+
+
+
+}
\ No newline at end of file
--- /dev/null
+#pragma once
+
+namespace nlite{
+
+
+
+ const static LPCTSTR NLITE_MAINWINDOW = _T("nlite");
+
+ class CNliteMainFrame : public CFrameWindowImpl<CNliteMainFrame>,
+ public CUpdateUI<CNliteMainFrame>,public CMessageFilter, public CIdleHandler
+ {
+ public:
+
+ typedef CFrameWindowImpl<CNliteMainFrame> baseWindow;
+
+ // \83E\83B\83\93\83h\83E\83N\83\89\83X\96¼\81A\8b¤\92Ê\83\8a\83\\81[\83XID\81A\83X\83^\83C\83\8b\81A\94w\8ci\90F\82ð\93o\98^
+ //DECLARE_FRAME_WND_CLASS_EX(NLITE_MAINWINDOW, IDC_NLITE,CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS, COLOR_WINDOW)
+ //DECLARE_FRAME_WND_CLASS_EX(NLITE_MAINWINDOW, IDC_NLITE,CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS, COLOR_WINDOW)
+ DECLARE_FRAME_WND_CLASS(NULL,IDC_NLITE);
+ private:
+ CCommentView commentView;
+ CStatusBarCtrl statusBar;
+
+ private:
+
+ // \83\81\83b\83Z\81[\83W\83t\83B\83\8b\83^\8f\88\97\9d
+ virtual BOOL PreTranslateMessage(MSG* pMsg){
+ // \8aî\92ê\83N\83\89\83X\82ÌPreTranslateMessage\82ð\8cÄ\82Ñ\8fo\82·
+ return CFrameWindowImpl<CNliteMainFrame>::PreTranslateMessage(pMsg);
+ }
+
+ // \83A\83C\83h\83\8b\8f\88\97\9d
+ virtual BOOL OnIdle(){
+ UIUpdateStatusBar();
+ return FALSE;
+ }
+
+
+ public:
+
+
+ BEGIN_UPDATE_UI_MAP(CNliteMainFrame)
+ // \83G\83\93\83g\83\8a\82È\82µ
+ END_UPDATE_UI_MAP()
+
+ // \83\81\83b\83Z\81[\83W\83}\83b\83v
+ BEGIN_MSG_MAP_EX(CNliteMainFrame)
+ MSG_WM_CREATE(OnCreate)
+ MSG_WM_DESTROY(OnDestroy)
+ MSG_WM_SIZING(OnSizing)
+ MESSAGE_HANDLER(WM_SIZE,OnSize);
+
+ COMMAND_ID_HANDLER_EX(IDM_EXIT, OnMenuExit)
+ COMMAND_ID_HANDLER_EX(IDM_ABOUT,OnMenuAbount)
+ // CFrameWindowImpl\83N\83\89\83X\82Ö\83`\83F\81[\83\93
+ CHAIN_MSG_MAP(CUpdateUI<CNliteMainFrame>)
+ CHAIN_MSG_MAP(CFrameWindowImpl<CNliteMainFrame>)
+ END_MSG_MAP()
+
+ //\83T\83C\83Y\95Ï\8dX\92\86
+ VOID OnSizing(UINT wParam,LPRECT lParam){
+
+ RECT client;
+ GetClientRect(&client);
+
+ ChangeSize( _WTYPES_NS::CSize(client.right - client.left,client.bottom - client.top));
+
+
+
+ return;
+
+ }
+
+
+ //\83T\83C\83Y\95Ï\8dX\8cã
+ LRESULT OnSize(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL& bHandled){
+
+
+ SIZE clientSize;
+ clientSize.cx = LOWORD(lParam);
+ clientSize.cy = HIWORD(lParam);
+ ChangeSize(clientSize);
+
+ bHandled = FALSE;
+
+
+
+ return 0;
+ }
+
+ VOID ChangeSize(const SIZE& client);
+
+
+ LRESULT OnCreate(LPCREATESTRUCT lpcs){
+ // \83c\81[\83\8b\83o\81[\82ð\8dì\90¬
+ //CreateSimpleToolBar();
+
+ // \83X\83e\81[\83^\83X\83o\81[\82ð\8dì\90¬
+ vcverify(CreateSimpleStatusBar(),TEXT("\83X\83e\81[\83^\83X\83o\81[\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"));
+ vcverify(UIAddStatusBar(m_hWndStatusBar),TEXT("\83X\83e\81[\83^\83X\83o\81[\93o\98^\82É\82µ\83b\83p\82µ\82Ü\82µ\82½"));
+ vcverify(commentView.Create(m_hWnd,0,LISTVIEW_EX,WS_VISIBLE | WS_CHILD),TEXT("window\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"));;
+
+
+
+
+
+ // \83\81\83b\83Z\81[\83W\83\8b\81[\83v\82É\83\81\83b\83Z\81[\83W\83t\83B\83\8b\83^\82Æ\83A\83C\83h\83\8b\83n\83\93\83h\83\89\82ð\92Ç\89Á
+ CMessageLoop* pLoop = _Module.GetMessageLoop();
+ pLoop->AddMessageFilter(this);
+ pLoop->AddIdleHandler(this);
+ return 0;
+ }
+
+ VOID OnDestroy(){
+
+ commentView.DestroyWindow();
+ PostQuitMessage(0);
+ return;
+ }
+
+ //\83\81\83j\83\85\81[\82©\82ç\83t\83@\83C\83\8b\82ð\8fI\97¹\82ð\91I\91ð
+ void OnMenuExit(UINT uNotifyCode, int nID, HWND hWndCtl){
+ PostMessage(WM_CLOSE);
+ }
+
+ //\83\81\83j\83\85\81[\82Ì\83A\83v\83\8a\83P\81[\83V\83\87\83\93\83o\81[\83W\83\87\83\93\8fî\95ñ\95\\8e¦
+ void OnMenuAbount(UINT uNotifyCode,int nID,HWND hWndCtl){
+
+
+ appInfo->show();
+ }
+ };
+
+
+
+}
\ No newline at end of file
--- /dev/null
+#include "stdafx.h"
+#include "nlite_include.h"
+
+using namespace nlite;
+static const RECT commentViewSize = {20,20,20,40};
+
+
+//\83T\83C\83Y\95Ï\8dX\8f\88\97\9d
+VOID CNliteMainFrame::ChangeSize(const SIZE& client){
+
+
+
+
+ commentView.MoveWindow(commentViewSize.left , commentViewSize.top,client.cx - (commentViewSize.left + commentViewSize.right), client.cy - (commentViewSize.top + commentViewSize.bottom));
+
+ return;
+}
\ No newline at end of file
#pragma once
-#include <targetver.h>
+#include "targetver.h"
-#define WIN32_LEAN_AND_MEAN // Windows \83w\83b\83_\81[\82©\82ç\8eg\97p\82³\82ê\82Ä\82¢\82È\82¢\95\94\95ª\82ð\8f\9c\8aO\82µ\82Ü\82·\81B
+#define WIN32_LEAN_AND_MEAN // Windows \83w\83b\83_\81[\82©\82ç\8eg\97p\82³\82ê\82Ä\82¢\82È\82¢\95\94\95ª\82ð\8f\9c\8aO\82µ\82Ü\82·\81B
+#define _CRT_SECURE_NO_WARNINGS 1 //vc++\82Ì\82¨\82¹\82Á\82©\82¢\82È\8cx\8d\90\82ð\8fÁ\82·\83}\83N\83\8d
+#define _CRT_NON_CONFORMING_SWPRINTFS 1 //vc++\82Ì\82¨\82¹\82Á\82©\82¢\82È\8cx\8d\90\82ð\8fÁ\82·\83}\83N\83\8d
// Windows \83w\83b\83_\81[ \83t\83@\83C\83\8b:
#include <windows.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
+#include <assert.h>
+
+// C++\83\89\83C\83u\83\89\83\8a
+#include <string>
+#include <exception>
// TODO: \83v\83\8d\83O\83\89\83\80\82É\95K\97v\82È\92Ç\89Á\83w\83b\83_\81[\82ð\82±\82±\82Å\8eQ\8fÆ\82µ\82Ä\82\82¾\82³\82¢\81B
+#include <atlbase.h>
+#include <atlapp.h>
+extern CAppModule _Module;
+#include <atlwin.h>
+
+#include <atlcrack.h>
+#include <atlmisc.h>
+#include <atlframe.h>
+#include <atlctrls.h>
+
+#include <shellapi.h>
+
+#pragma comment(lib,"shell32.lib")
+#pragma comment(lib,"atlthunk.lib")
+#pragma comment(lib,"version.lib")
\ No newline at end of file
--- /dev/null
+#pragma once
+
+// SDKDDKVer.h \82ð\83C\83\93\83N\83\8b\81[\83h\82·\82é\82Æ\81A\97\98\97p\82Å\82«\82é\8dÅ\82à\8fã\88Ê\82Ì Windows \83v\83\89\83b\83g\83t\83H\81[\83\80\82ª\92è\8b`\82³\82ê\82Ü\82·\81B
+
+// \88È\91O\82Ì Windows \83v\83\89\83b\83g\83t\83H\81[\83\80\97p\82É\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ð\83r\83\8b\83h\82·\82é\8fê\8d\87\82Í\81AWinSDKVer.h \82ð\83C\83\93\83N\83\8b\81[\83h\82µ\81A
+// SDKDDKVer.h \82ð\83C\83\93\83N\83\8b\81[\83h\82·\82é\91O\82É\81A\83T\83|\81[\83g\91Î\8fÛ\82Æ\82·\82é\83v\83\89\83b\83g\83t\83H\81[\83\80\82ð\8e¦\82·\82æ\82¤\82É _WIN32_WINNT \83}\83N\83\8d\82ð\90Ý\92è\82µ\82Ü\82·\81B
+
+#include <WinSDKVer.h>
+#define _WIN32_WINNT 0x0501 //WindowsXP\82Ì\83o\81[\83W\83\87\83\93
+#define WINVER 0x0501 //WindowsXP\82Ì\83o\81[\83W\83\87\83\93
+
+#define NTDDI_VERSION NTDDI_WINXPSP3
+
+#include <SDKDDKVer.h>
--- /dev/null
+========================================================================
+ Win32 アプリケーション: test プロジェクトの概要
+========================================================================
+
+この test アプリケーションは、AppWizard により作成されました。
+
+このファイルには、test
+アプリケーションを構成する各ファイルの内容の概要が含まれています。
+
+
+test.vcxproj
+ これは、アプリケーション ウィザードを使用して生成された VC++
+ プロジェクトのメイン プロジェクト ファイルです。
+ ファイルを生成した Visual C++ のバージョンに関する情報と、アプリケーション
+ ウィザードで選択されたプラットフォーム、
+ 構成、およびプロジェクト機能に関する情報が含まれています。
+
+test.vcxproj.filters
+ これは、アプリケーション ウィザードで生成された VC++ プロジェクトのフィルター
+ ファイルです。
+ このファイルには、プロジェクト内のファイルとフィルターとの間の関連付けに関する
+ 情報が含まれています。 この関連付けは、特定のノー
+ ドで同様の拡張子を持つファイルのグループ化を
+ 示すために IDE で使用されます (たとえば、".cpp" ファイルは "ソース ファイル"
+ フィルターに関連付けられています)。
+
+test.cpp
+ これは、メインのアプリケーション ソース ファイルです。
+
+/////////////////////////////////////////////////////////////////////////////
+AppWizard によって、次のリソースが作成されました。
+
+test.rc
+ これは、プログラムが使用するすべての Microsoft Windows リソースの一覧です。RES
+ サブディレクトリに格納されるアイコン、ビットマップ、
+ およびカーソルをインクルードしています。 このファイルは、Microsoft Visual C++
+ で直接編集できます。
+
+Resource.h
+ これは、新しいリソース ID を定義する標準のヘッダー ファイルです。
+ このファイルの読み込みおよび更新は、Microsoft Visual C++ で行います。
+
+test.ico
+ これは、アプリケーションのアイコン (32x32) として使用されるアイコン
+ ファイルです。
+ このアイコンは、メイン リソース ファイル test.rc
+ にインクルードされます。
+
+small.ico
+ これは、アプリケーションのアイコンの小さいバージョン (16x16) を含むアイコン
+ ファイルです。 このアイコンは、メイン リソース ファイル test.rc
+ にインクルードされます。
+
+/////////////////////////////////////////////////////////////////////////////
+その他の標準ファイル :
+
+StdAfx.h、StdAfx.cpp
+ これらのファイルは、test.pch
+ という名前のプリコンパイル済みヘッダー (PCH) ファイルと、StdAfx.obj
+ という名前のプリコンパイル済みの型ファイルを構築するために使用されます。
+
+/////////////////////////////////////////////////////////////////////////////
+その他のメモ :
+
+AppWizard では "TODO:"
+コメントを使用して、ユーザーが追加またはカスタマイズする必要のあるソース
+コードを示します。
+
+/////////////////////////////////////////////////////////////////////////////
--- /dev/null
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by test.rc
+//
+
+#define IDS_APP_TITLE 103
+
+#define IDR_MAINFRAME 128
+#define IDD_TEST_DIALOG 102
+#define IDD_ABOUTBOX 103
+#define IDM_ABOUT 104
+#define IDM_EXIT 105
+#define IDI_TEST 107
+#define IDI_SMALL 108
+#define IDC_TEST 109
+#define IDC_MYICON 2
+#ifndef IDC_STATIC
+#define IDC_STATIC -1
+#endif
+// \90V\82µ\82¢\83I\83u\83W\83F\83N\83g\82Ì\8e\9f\82Ì\8aù\92è\92l
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+
+#define _APS_NO_MFC 130
+#define _APS_NEXT_RESOURCE_VALUE 129
+#define _APS_NEXT_COMMAND_VALUE 32771
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 110
+#endif
+#endif
--- /dev/null
+// stdafx.cpp : \95W\8f\80\83C\83\93\83N\83\8b\81[\83h test.pch \82Ì\82Ý\82ð
+// \8aÜ\82Þ\83\\81[\83X \83t\83@\83C\83\8b\82Í\81A\83v\83\8a\83R\83\93\83p\83C\83\8b\8dÏ\82Ý\83w\83b\83_\81[\82É\82È\82è\82Ü\82·\81B
+// stdafx.obj \82É\82Í\83v\83\8a\83R\83\93\83p\83C\83\8b\8dÏ\82Ý\8c^\8fî\95ñ\82ª\8aÜ\82Ü\82ê\82Ü\82·\81B
+
+#include "stdafx.h"
+
+// TODO: \82±\82Ì\83t\83@\83C\83\8b\82Å\82Í\82È\82\81ASTDAFX.H \82Å\95K\97v\82È
+// \92Ç\89Á\83w\83b\83_\81[\82ð\8eQ\8fÆ\82µ\82Ä\82\82¾\82³\82¢\81B
--- /dev/null
+// stdafx.h : \95W\8f\80\82Ì\83V\83X\83e\83\80 \83C\83\93\83N\83\8b\81[\83h \83t\83@\83C\83\8b\82Ì\83C\83\93\83N\83\8b\81[\83h \83t\83@\83C\83\8b\81A\82Ü\82½\82Í
+// \8eQ\8fÆ\89ñ\90\94\82ª\91½\82\81A\82©\82Â\82 \82Ü\82è\95Ï\8dX\82³\82ê\82È\82¢\81A\83v\83\8d\83W\83F\83N\83g\90ê\97p\82Ì\83C\83\93\83N\83\8b\81[\83h \83t\83@\83C\83\8b
+// \82ð\8bL\8fq\82µ\82Ü\82·\81B
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN // Windows \83w\83b\83_\81[\82©\82ç\8eg\97p\82³\82ê\82Ä\82¢\82È\82¢\95\94\95ª\82ð\8f\9c\8aO\82µ\82Ü\82·\81B
+// Windows \83w\83b\83_\81[ \83t\83@\83C\83\8b:
+#include <windows.h>
+
+// C \83\89\83\93\83^\83C\83\80 \83w\83b\83_\81[ \83t\83@\83C\83\8b
+#include <stdlib.h>
+#include <malloc.h>
+#include <memory.h>
+#include <tchar.h>
+
+
+// TODO: \83v\83\8d\83O\83\89\83\80\82É\95K\97v\82È\92Ç\89Á\83w\83b\83_\81[\82ð\82±\82±\82Å\8eQ\8fÆ\82µ\82Ä\82\82¾\82³\82¢\81B
--- /dev/null
+#pragma once
+
+// SDKDDKVer.h \82ð\83C\83\93\83N\83\8b\81[\83h\82·\82é\82Æ\81A\97\98\97p\82Å\82«\82é\8dÅ\82à\8fã\88Ê\82Ì Windows \83v\83\89\83b\83g\83t\83H\81[\83\80\82ª\92è\8b`\82³\82ê\82Ü\82·\81B
+
+// \88È\91O\82Ì Windows \83v\83\89\83b\83g\83t\83H\81[\83\80\97p\82É\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ð\83r\83\8b\83h\82·\82é\8fê\8d\87\82Í\81AWinSDKVer.h \82ð\83C\83\93\83N\83\8b\81[\83h\82µ\81A
+// SDKDDKVer.h \82ð\83C\83\93\83N\83\8b\81[\83h\82·\82é\91O\82É\81A\83T\83|\81[\83g\91Î\8fÛ\82Æ\82·\82é\83v\83\89\83b\83g\83t\83H\81[\83\80\82ð\8e¦\82·\82æ\82¤\82É _WIN32_WINNT \83}\83N\83\8d\82ð\90Ý\92è\82µ\82Ü\82·\81B
+
+#include <SDKDDKVer.h>
--- /dev/null
+// test.cpp : \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\83G\83\93\83g\83\8a \83|\83C\83\93\83g\82ð\92è\8b`\82µ\82Ü\82·\81B
+//
+
+#include "stdafx.h"
+#include "test.h"
+
+#define MAX_LOADSTRING 100
+
+// \83O\83\8d\81[\83o\83\8b\95Ï\90\94:
+HINSTANCE hInst; // \8c»\8dÝ\82Ì\83C\83\93\83^\81[\83t\83F\83C\83X
+TCHAR szTitle[MAX_LOADSTRING]; // \83^\83C\83g\83\8b \83o\81[\82Ì\83e\83L\83X\83g
+TCHAR szWindowClass[MAX_LOADSTRING]; // \83\81\83C\83\93 \83E\83B\83\93\83h\83E \83N\83\89\83X\96¼
+
+// \82±\82Ì\83R\81[\83h \83\82\83W\83\85\81[\83\8b\82É\8aÜ\82Ü\82ê\82é\8aÖ\90\94\82Ì\90é\8c¾\82ð\93]\91\97\82µ\82Ü\82·:
+ATOM MyRegisterClass(HINSTANCE hInstance);
+BOOL InitInstance(HINSTANCE, int);
+LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
+INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
+
+int APIENTRY _tWinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPTSTR lpCmdLine,
+ int nCmdShow)
+{
+ UNREFERENCED_PARAMETER(hPrevInstance);
+ UNREFERENCED_PARAMETER(lpCmdLine);
+
+ // TODO: \82±\82±\82É\83R\81[\83h\82ð\91}\93ü\82µ\82Ä\82\82¾\82³\82¢\81B
+ MSG msg;
+ HACCEL hAccelTable;
+
+ // \83O\83\8d\81[\83o\83\8b\95¶\8e\9a\97ñ\82ð\8f\89\8aú\89»\82µ\82Ä\82¢\82Ü\82·\81B
+ LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
+ LoadString(hInstance, IDC_TEST, szWindowClass, MAX_LOADSTRING);
+ MyRegisterClass(hInstance);
+
+ // \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\8f\89\8aú\89»\82ð\8eÀ\8ds\82µ\82Ü\82·:
+ if (!InitInstance (hInstance, nCmdShow))
+ {
+ return FALSE;
+ }
+
+ hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_TEST));
+
+ // \83\81\83C\83\93 \83\81\83b\83Z\81[\83W \83\8b\81[\83v:
+ while (GetMessage(&msg, NULL, 0, 0))
+ {
+ if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+
+ return (int) msg.wParam;
+}
+
+
+
+//
+// \8aÖ\90\94: MyRegisterClass()
+//
+// \96Ú\93I: \83E\83B\83\93\83h\83E \83N\83\89\83X\82ð\93o\98^\82µ\82Ü\82·\81B
+//
+// \83R\83\81\83\93\83g:
+//
+// \82±\82Ì\8aÖ\90\94\82¨\82æ\82Ñ\8eg\82¢\95û\82Í\81A'RegisterClassEx' \8aÖ\90\94\82ª\92Ç\89Á\82³\82ê\82½
+// Windows 95 \82æ\82è\91O\82Ì Win32 \83V\83X\83e\83\80\82Æ\8cÝ\8a·\82³\82¹\82é\8fê\8d\87\82É\82Ì\82Ý\95K\97v\82Å\82·\81B
+// \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ª\81A\8aÖ\98A\95t\82¯\82ç\82ê\82½
+// \90³\82µ\82¢\8c`\8e®\82Ì\8f¬\82³\82¢\83A\83C\83R\83\93\82ð\8eæ\93¾\82Å\82«\82é\82æ\82¤\82É\82·\82é\82É\82Í\81A
+// \82±\82Ì\8aÖ\90\94\82ð\8cÄ\82Ñ\8fo\82µ\82Ä\82\82¾\82³\82¢\81B
+//
+ATOM MyRegisterClass(HINSTANCE hInstance)
+{
+ WNDCLASSEX wcex;
+
+ wcex.cbSize = sizeof(WNDCLASSEX);
+
+ wcex.style = CS_HREDRAW | CS_VREDRAW;
+ wcex.lpfnWndProc = WndProc;
+ wcex.cbClsExtra = 0;
+ wcex.cbWndExtra = 0;
+ wcex.hInstance = hInstance;
+ wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TEST));
+ wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
+ wcex.lpszMenuName = MAKEINTRESOURCE(IDC_TEST);
+ wcex.lpszClassName = szWindowClass;
+ wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
+
+ return RegisterClassEx(&wcex);
+}
+
+//
+// \8aÖ\90\94: InitInstance(HINSTANCE, int)
+//
+// \96Ú\93I: \83C\83\93\83X\83^\83\93\83X \83n\83\93\83h\83\8b\82ð\95Û\91¶\82µ\82Ä\81A\83\81\83C\83\93 \83E\83B\83\93\83h\83E\82ð\8dì\90¬\82µ\82Ü\82·\81B
+//
+// \83R\83\81\83\93\83g:
+//
+// \82±\82Ì\8aÖ\90\94\82Å\81A\83O\83\8d\81[\83o\83\8b\95Ï\90\94\82Å\83C\83\93\83X\83^\83\93\83X \83n\83\93\83h\83\8b\82ð\95Û\91¶\82µ\81A
+// \83\81\83C\83\93 \83v\83\8d\83O\83\89\83\80 \83E\83B\83\93\83h\83E\82ð\8dì\90¬\82¨\82æ\82Ñ\95\\8e¦\82µ\82Ü\82·\81B
+//
+BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
+{
+ HWND hWnd;
+
+ hInst = hInstance; // \83O\83\8d\81[\83o\83\8b\95Ï\90\94\82É\83C\83\93\83X\83^\83\93\83X\8f\88\97\9d\82ð\8ai\94[\82µ\82Ü\82·\81B
+
+ hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
+
+ if (!hWnd)
+ {
+ return FALSE;
+ }
+
+ ShowWindow(hWnd, nCmdShow);
+ UpdateWindow(hWnd);
+
+ return TRUE;
+}
+
+//
+// \8aÖ\90\94: WndProc(HWND, UINT, WPARAM, LPARAM)
+//
+// \96Ú\93I: \83\81\83C\83\93 \83E\83B\83\93\83h\83E\82Ì\83\81\83b\83Z\81[\83W\82ð\8f\88\97\9d\82µ\82Ü\82·\81B
+//
+// WM_COMMAND - \83A\83v\83\8a\83P\81[\83V\83\87\83\93 \83\81\83j\83\85\81[\82Ì\8f\88\97\9d
+// WM_PAINT - \83\81\83C\83\93 \83E\83B\83\93\83h\83E\82Ì\95`\89æ
+// WM_DESTROY - \92\86\8e~\83\81\83b\83Z\81[\83W\82ð\95\\8e¦\82µ\82Ä\96ß\82é
+//
+//
+LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ int wmId, wmEvent;
+ PAINTSTRUCT ps;
+ HDC hdc;
+
+ switch (message)
+ {
+ case WM_COMMAND:
+ wmId = LOWORD(wParam);
+ wmEvent = HIWORD(wParam);
+ // \91I\91ð\82³\82ê\82½\83\81\83j\83\85\81[\82Ì\89ð\90Í:
+ switch (wmId)
+ {
+ case IDM_ABOUT:
+ DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
+ break;
+ case IDM_EXIT:
+ DestroyWindow(hWnd);
+ break;
+ default:
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ }
+ break;
+ case WM_PAINT:
+ hdc = BeginPaint(hWnd, &ps);
+ // TODO: \95`\89æ\83R\81[\83h\82ð\82±\82±\82É\92Ç\89Á\82µ\82Ä\82\82¾\82³\82¢...
+ EndPaint(hWnd, &ps);
+ break;
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
+ default:
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ }
+ return 0;
+}
+
+// \83o\81[\83W\83\87\83\93\8fî\95ñ\83{\83b\83N\83X\82Ì\83\81\83b\83Z\81[\83W \83n\83\93\83h\83\89\81[\82Å\82·\81B
+INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ UNREFERENCED_PARAMETER(lParam);
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ return (INT_PTR)TRUE;
+
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
+ {
+ EndDialog(hDlg, LOWORD(wParam));
+ return (INT_PTR)TRUE;
+ }
+ break;
+ }
+ return (INT_PTR)FALSE;
+}
--- /dev/null
+#pragma once
+
+#include "resource.h"
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{599C0E8B-8050-48FB-9061-8003CC75408F}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>test</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <None Include="ReadMe.txt" />
+ <None Include="small.ico" />
+ <None Include="test.ico" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="Resource.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
+ <ClInclude Include="test.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="stdafx.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="test.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="test.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file