Permalink
Browse files

・新生VizCommand

・ウィンドウの表示
  • Loading branch information...
1 parent 0df4621 commit 46f8195eddeb7ead841183a109c26cf410ca34ca @bg1bgst333 committed Jan 11, 2017
View
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VizCommand", "VizCommand\VizCommand.vcxproj", "{4F8F4DC4-C914-4175-996A-20D440BFF830}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4F8F4DC4-C914-4175-996A-20D440BFF830}.Debug|x64.ActiveCfg = Debug|x64
+ {4F8F4DC4-C914-4175-996A-20D440BFF830}.Debug|x64.Build.0 = Debug|x64
+ {4F8F4DC4-C914-4175-996A-20D440BFF830}.Debug|x86.ActiveCfg = Debug|Win32
+ {4F8F4DC4-C914-4175-996A-20D440BFF830}.Debug|x86.Build.0 = Debug|Win32
+ {4F8F4DC4-C914-4175-996A-20D440BFF830}.Release|x64.ActiveCfg = Release|x64
+ {4F8F4DC4-C914-4175-996A-20D440BFF830}.Release|x64.Build.0 = Release|x64
+ {4F8F4DC4-C914-4175-996A-20D440BFF830}.Release|x86.ActiveCfg = Release|Win32
+ {4F8F4DC4-C914-4175-996A-20D440BFF830}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Binary file not shown.
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.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>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{4F8F4DC4-C914-4175-996A-20D440BFF830}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>VizCommand</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </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>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <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|x64'">
+ <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)'=='Debug|x64'">
+ <LinkIncremental>true</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="WinMain.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="resource.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="VizCommand.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
View
@@ -0,0 +1,110 @@
+// ヘッダのインクルード
+// 既定のヘッダ
+#include <windows.h> // 標準WindowsAPI
+#include <tchar.h> // TCHAR型
+
+// 関数のプロトタイプ宣言
+LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); // 独自のウィンドウプロシージャWindowProc.
+
+// _tWinMain関数
+int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd) {
+
+ // 変数の宣言
+ HWND hWnd; // HWND型ウィンドウハンドルhWnd
+ MSG msg; // MSG型ウィンドウメッセージ構造体msg
+ WNDCLASS wc; // WNDCLASS型ウィンドウクラス構造体wc
+
+ // ウィンドウクラスの設定
+ wc.lpszClassName = _T("VizCommand_MainWindow"); // 独自に定義したウィンドウクラス"VizCommand_MainWindow".
+ wc.style = CS_HREDRAW | CS_VREDRAW; // とりあえずCS_HREDRAW | CS_VREDRAW.
+ wc.lpfnWndProc = WindowProc; // 独自に定義したウィンドウプロシージャWindowProc.
+ wc.hInstance = hInstance; // WinMainの引数のインスタンスハンドルhInstanceを指定.
+ wc.hIcon = LoadIcon(hInstance, IDI_APPLICATION); // アプリケーション既定アイコンIDI_APPLICATION.
+ wc.hCursor = LoadCursor(hInstance, IDC_ARROW); // システム既定の矢印カーソルIDC_ARROW.
+ wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); // 背景は白(WHITE_BRUSH).
+ wc.lpszMenuName = NULL; // とりあえずNULL.
+ wc.cbClsExtra = 0; // とりあえず0でいい.
+ wc.cbWndExtra = 0; // とりあえず0でいい.
+
+ // ウィンドウクラスの登録
+ if (!RegisterClass(&wc)) { // RegisterClassにwcをセットして登録.
+
+ // エラー処理
+ MessageBox(NULL, _T("ウィンドウクラスの登録に失敗しました."), _T("VizCommand"), MB_OK | MB_ICONHAND); // MessageBoxで"ウィンドウクラスの登録に失敗しました!"と表示.
+ return -1; // 異常終了(-1)を返す.
+
+ }
+
+ // ウィンドウクラスの作成
+ hWnd = CreateWindow(wc.lpszClassName, _T("VizCommand"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); // CreateWindowで"VizCommand_MainWindow"ウィンドウクラスのウィンドウ"VizCommand"を作成.
+ if (hWnd == NULL) {
+
+ // エラー処理
+ MessageBox(NULL, _T("ウィンドウの作成に失敗しました!"), _T("VizCommand"), MB_OK | MB_ICONHAND); // MessageBoxで"ウィンドウの作成に失敗しました!"と表示.
+ return -2; // 異常終了(-2)を返す.
+
+ }
+
+ // ウィンドウの表示
+ ShowWindow(hWnd, SW_SHOW); // ShowWindowでhWndを表示.
+
+ // メッセージループ
+ while (GetMessage(&msg, NULL, 0, 0) > 0) { // GetMessageでメッセージ取得.
+
+ // ウィンドウメッセージの送出
+ DispatchMessage(&msg); // DispatchMessageでウィンドウプロシージャに送出.
+ TranslateMessage(&msg); // TranslateMessageで仮想キーメッセージを文字へ変換.
+
+ }
+
+ // プログラムの終了
+ return (int)msg.wParam; // 終了コードとしてmsg.wParamを返す.
+
+}
+
+// ウィンドウプロシージャWindowProc関数
+LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+
+ // ウィンドウメッセージ処理
+ switch (uMsg) {
+
+ // ウィンドウの作成が開始された時.
+ case WM_CREATE:
+
+ // WM_CREATEブロック
+ {
+
+ // ウィンドウ作成成功
+ return 0; // 成功なら0を返す.
+
+ }
+
+ // 既定の処理へ向かう.
+ break; // 抜けてDefWindowProcに向かう.
+
+ // ウィンドウが破棄された時.
+ case WM_DESTROY:
+
+ // WM_DESTROYブロック
+ {
+
+ // メッセージループ終了.
+ PostQuitMessage(0); // PostQuitMessageでメッセージループを抜けさせる.
+
+ }
+
+ // 既定の処理へ向かう.
+ break; // 抜けてDefWindowProcに向かう.
+
+ // それ以外の時.
+ default:
+
+ // 既定の処理へ向かう.
+ break; // 抜けてDefWindowProcに向かう.
+
+ }
+
+ // 既定の処理
+ return DefWindowProc(hwnd, uMsg, wParam, lParam); // DefWindowProcに任せる.
+
+}
View
@@ -0,0 +1,14 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by VizCommand.rc
+
+// 新しいオブジェクトの次の既定値
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif

0 comments on commit 46f8195

Please sign in to comment.