-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add windows app build target * Create sample app * Cleanup package lock relative paths Co-authored-by: Matthew Asplund <[email protected]>
- Loading branch information
Showing
37 changed files
with
1,826 additions
and
609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Name = "Samples.Cpp.WindowsApplication" | ||
Language = "C++" | ||
Type = "Windows" | ||
Version = "1.1.3" | ||
Resources = "WindowsProject.rc" | ||
Source = [ | ||
"WindowsProject.cpp" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//{{NO_DEPENDENCIES}} | ||
// Microsoft Visual C++ generated include file. | ||
// Used by WindowsProject.rc | ||
|
||
#define IDS_APP_TITLE 103 | ||
|
||
#define IDR_MAINFRAME 128 | ||
#define IDD_WINDOWSPROJECT_DIALOG 102 | ||
#define IDD_ABOUTBOX 103 | ||
#define IDM_ABOUT 104 | ||
#define IDM_EXIT 105 | ||
#define IDI_WINDOWSPROJECT 107 | ||
#define IDI_SMALL 108 | ||
#define IDC_WINDOWSPROJECT 109 | ||
#define IDC_MYICON 2 | ||
#ifndef IDC_STATIC | ||
#define IDC_STATIC -1 | ||
#endif | ||
// Next default values for new objects | ||
// | ||
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
// WindowsProject.cpp : Defines the entry point for the application. | ||
// | ||
|
||
#include "framework.h" | ||
#include "WindowsProject.h" | ||
|
||
#define MAX_LOADSTRING 100 | ||
|
||
// Global Variables: | ||
HINSTANCE hInst; // current instance | ||
WCHAR szTitle[MAX_LOADSTRING]; // The title bar text | ||
WCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name | ||
|
||
// Forward declarations of functions included in this code module: | ||
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 wWinMain( | ||
_In_ HINSTANCE hInstance, | ||
_In_opt_ HINSTANCE hPrevInstance, | ||
_In_ LPWSTR lpCmdLine, | ||
_In_ int nCmdShow) | ||
{ | ||
UNREFERENCED_PARAMETER(hPrevInstance); | ||
UNREFERENCED_PARAMETER(lpCmdLine); | ||
|
||
// Initialize global strings | ||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); | ||
LoadStringW(hInstance, IDC_WINDOWSPROJECT, szWindowClass, MAX_LOADSTRING); | ||
MyRegisterClass(hInstance); | ||
|
||
// Perform application initialization: | ||
if (!InitInstance (hInstance, nCmdShow)) | ||
{ | ||
return FALSE; | ||
} | ||
|
||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WINDOWSPROJECT)); | ||
|
||
MSG msg; | ||
|
||
// Main message loop: | ||
while (GetMessage(&msg, nullptr, 0, 0)) | ||
{ | ||
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) | ||
{ | ||
TranslateMessage(&msg); | ||
DispatchMessage(&msg); | ||
} | ||
} | ||
|
||
return (int) msg.wParam; | ||
} | ||
|
||
|
||
ATOM MyRegisterClass(HINSTANCE hInstance) | ||
{ | ||
WNDCLASSEXW 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_WINDOWSPROJECT)); | ||
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); | ||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); | ||
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_WINDOWSPROJECT); | ||
wcex.lpszClassName = szWindowClass; | ||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); | ||
|
||
return RegisterClassExW(&wcex); | ||
} | ||
|
||
// | ||
// FUNCTION: InitInstance(HINSTANCE, int) | ||
// | ||
// PURPOSE: Saves instance handle and creates main window | ||
// | ||
// COMMENTS: | ||
// | ||
// In this function, we save the instance handle in a global variable and | ||
// create and display the main program window. | ||
// | ||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) | ||
{ | ||
hInst = hInstance; // Store instance handle in our global variable | ||
|
||
HWND hWnd = CreateWindowW( | ||
szWindowClass, | ||
szTitle, | ||
WS_OVERLAPPEDWINDOW, | ||
CW_USEDEFAULT, | ||
0, | ||
CW_USEDEFAULT, | ||
0, | ||
nullptr, | ||
nullptr, | ||
hInstance, | ||
nullptr); | ||
|
||
if (!hWnd) | ||
{ | ||
return FALSE; | ||
} | ||
|
||
ShowWindow(hWnd, nCmdShow); | ||
UpdateWindow(hWnd); | ||
|
||
return TRUE; | ||
} | ||
|
||
// | ||
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) | ||
// | ||
// PURPOSE: Processes messages for the main window. | ||
// | ||
// WM_COMMAND - process the application menu | ||
// WM_PAINT - Paint the main window | ||
// WM_DESTROY - post a quit message and return | ||
// | ||
// | ||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) | ||
{ | ||
switch (message) | ||
{ | ||
case WM_COMMAND: | ||
{ | ||
int wmId = LOWORD(wParam); | ||
// Parse the menu selections: | ||
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: | ||
{ | ||
PAINTSTRUCT ps; | ||
HDC hdc = BeginPaint(hWnd, &ps); | ||
UNREFERENCED_PARAMETER(hdc); | ||
// TODO: Add any drawing code that uses hdc here... | ||
EndPaint(hWnd, &ps); | ||
} | ||
break; | ||
case WM_DESTROY: | ||
PostQuitMessage(0); | ||
break; | ||
default: | ||
return DefWindowProc(hWnd, message, wParam, lParam); | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
// Message handler for about box. | ||
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
|
||
#include "resource.h" |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// framework.h : include file for standard system include files, | ||
// or project specific include files | ||
// | ||
|
||
#pragma once | ||
|
||
#include "targetver.h" | ||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers | ||
// Windows Header Files | ||
#include <windows.h> | ||
// C RunTime Header Files | ||
#include <stdlib.h> | ||
#include <malloc.h> | ||
#include <memory.h> | ||
#include <tchar.h> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
// // Including SDKDDKVer.h defines the highest available Windows platform. | ||
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and | ||
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. | ||
#include <SDKDDKVer.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
[Projects] | ||
"C++" = [ | ||
{ Name = "Soup", Version = "C:/Users/mwasp/source/repos/Soup/Source/Client/CLI" }, | ||
{ Name = "Soup.Core", Version = "C:/Users/mwasp/source/repos/Soup/Source/Client/Core/" }, | ||
{ Name = "Soup", Version = "./" }, | ||
{ Name = "Soup.Core", Version = "../Core/" }, | ||
{ Name = "json11", Version = "[email protected]" }, | ||
{ Name = "Opal", Version = "[email protected]" }, | ||
{ Name = "toml11", Version = "[email protected]" }, | ||
{ Name = "Monitor.Host", Version = "C:/Users/mwasp/source/repos/Soup/Source/Monitor/Host/" }, | ||
{ Name = "Detours", Version = "C:/Users/mwasp/source/repos/Soup/Dependencies/Detours/src/" }, | ||
{ Name = "Monitor.Shared", Version = "C:/Users/mwasp/source/repos/Soup/Source/Monitor/Shared/" }, | ||
{ Name = "Monitor.Host", Version = "../../Monitor/Host/" }, | ||
{ Name = "Detours", Version = "../../../Dependencies/Detours/src/" }, | ||
{ Name = "Monitor.Shared", Version = "../../../Monitor/Shared/" }, | ||
{ Name = "Soup.Test.Assert", Version = "[email protected]" }, | ||
{ Name = "copy", Version = "C:/Users/mwasp/source/repos/Soup/Source/Tools/Copy/" }, | ||
{ Name = "mkdir", Version = "C:/Users/mwasp/source/repos/Soup/Source/Tools/Mkdir/" }, | ||
{ Name = "copy", Version = "../../Tools/Copy/" }, | ||
{ Name = "mkdir", Version = "../../Tools/Mkdir/" }, | ||
] | ||
"C#" = [ | ||
{ Name = "Soup.Test.Cpp", Version = "[email protected]" }, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.