Skip to content

Commit 7969e36

Browse files
committed
WIP
0 parents  commit 7969e36

25 files changed

+1336
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vs/
2+
Build/
3+
BuildTmp/
4+
packages/

WinWebMerge.sln

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.32014.148
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinWebMerge", "WinWebMerge\WinWebMerge.vcxproj", "{9470B0BF-C97B-4287-BF0F-6CF60EE186D5}"
7+
ProjectSection(ProjectDependencies) = postProject
8+
{551AB4A6-2721-48F0-96A4-231BD11032B8} = {551AB4A6-2721-48F0-96A4-231BD11032B8}
9+
EndProjectSection
10+
EndProject
11+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinWebMergeLib", "WinWebMergeLib\WinWebMergeLib.vcxproj", "{551AB4A6-2721-48F0-96A4-231BD11032B8}"
12+
EndProject
13+
Global
14+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15+
Debug|x64 = Debug|x64
16+
Debug|x86 = Debug|x86
17+
Release|x64 = Release|x64
18+
Release|x86 = Release|x86
19+
EndGlobalSection
20+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
21+
{9470B0BF-C97B-4287-BF0F-6CF60EE186D5}.Debug|x64.ActiveCfg = Debug|x64
22+
{9470B0BF-C97B-4287-BF0F-6CF60EE186D5}.Debug|x64.Build.0 = Debug|x64
23+
{9470B0BF-C97B-4287-BF0F-6CF60EE186D5}.Debug|x86.ActiveCfg = Debug|Win32
24+
{9470B0BF-C97B-4287-BF0F-6CF60EE186D5}.Debug|x86.Build.0 = Debug|Win32
25+
{9470B0BF-C97B-4287-BF0F-6CF60EE186D5}.Release|x64.ActiveCfg = Release|x64
26+
{9470B0BF-C97B-4287-BF0F-6CF60EE186D5}.Release|x64.Build.0 = Release|x64
27+
{9470B0BF-C97B-4287-BF0F-6CF60EE186D5}.Release|x86.ActiveCfg = Release|Win32
28+
{9470B0BF-C97B-4287-BF0F-6CF60EE186D5}.Release|x86.Build.0 = Release|Win32
29+
{551AB4A6-2721-48F0-96A4-231BD11032B8}.Debug|x64.ActiveCfg = Debug|x64
30+
{551AB4A6-2721-48F0-96A4-231BD11032B8}.Debug|x64.Build.0 = Debug|x64
31+
{551AB4A6-2721-48F0-96A4-231BD11032B8}.Debug|x86.ActiveCfg = Debug|Win32
32+
{551AB4A6-2721-48F0-96A4-231BD11032B8}.Debug|x86.Build.0 = Debug|Win32
33+
{551AB4A6-2721-48F0-96A4-231BD11032B8}.Release|x64.ActiveCfg = Release|x64
34+
{551AB4A6-2721-48F0-96A4-231BD11032B8}.Release|x64.Build.0 = Release|x64
35+
{551AB4A6-2721-48F0-96A4-231BD11032B8}.Release|x86.ActiveCfg = Release|Win32
36+
{551AB4A6-2721-48F0-96A4-231BD11032B8}.Release|x86.Build.0 = Release|Win32
37+
EndGlobalSection
38+
GlobalSection(SolutionProperties) = preSolution
39+
HideSolutionNode = FALSE
40+
EndGlobalSection
41+
GlobalSection(ExtensibilityGlobals) = postSolution
42+
SolutionGuid = {A502EF8E-6747-423C-84AA-2E5971ACF440}
43+
EndGlobalSection
44+
EndGlobal

WinWebMerge/Resource.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//{{NO_DEPENDENCIES}}
2+
// Microsoft Visual C++ generated include file.
3+
// Used by WinWebMerge.rc
4+
5+
#define IDS_APP_TITLE 103
6+
7+
#define IDR_MAINFRAME 128
8+
#define IDD_WINWEBMERGE_DIALOG 102
9+
#define IDD_ABOUTBOX 103
10+
#define IDM_ABOUT 104
11+
#define IDM_EXIT 105
12+
#define IDI_WINWEBMERGE 107
13+
#define IDI_SMALL 108
14+
#define IDC_WINWEBMERGE 109
15+
#define IDC_MYICON 2
16+
#ifndef IDC_STATIC
17+
#define IDC_STATIC -1
18+
#endif
19+
// Next default values for new objects
20+
//
21+
#ifdef APSTUDIO_INVOKED
22+
#ifndef APSTUDIO_READONLY_SYMBOLS
23+
24+
#define _APS_NO_MFC 130
25+
#define _APS_NEXT_RESOURCE_VALUE 129
26+
#define _APS_NEXT_COMMAND_VALUE 32771
27+
#define _APS_NEXT_CONTROL_VALUE 1000
28+
#define _APS_NEXT_SYMED_VALUE 110
29+
#endif
30+
#endif

WinWebMerge/WinWebMerge.cpp

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
// WinWebMerge.cpp : Defines the entry point for the application.
2+
//
3+
4+
#include "framework.h"
5+
#include "WinWebMerge.h"
6+
#include "../WinWebMergeLib/WinWebMergeLib.h"
7+
8+
#define MAX_LOADSTRING 100
9+
10+
// Global Variables:
11+
HINSTANCE hInst; // current instance
12+
HINSTANCE hInstDLL; // current instance
13+
WCHAR szTitle[MAX_LOADSTRING]; // The title bar text
14+
WCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
15+
IWebMergeWindow* m_pWebMergeWindow = nullptr;
16+
17+
// Forward declarations of functions included in this code module:
18+
ATOM MyRegisterClass(HINSTANCE hInstance);
19+
BOOL InitInstance(HINSTANCE, int);
20+
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
21+
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
22+
23+
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
24+
_In_opt_ HINSTANCE hPrevInstance,
25+
_In_ LPWSTR lpCmdLine,
26+
_In_ int nCmdShow)
27+
{
28+
UNREFERENCED_PARAMETER(hPrevInstance);
29+
UNREFERENCED_PARAMETER(lpCmdLine);
30+
31+
// TODO: Place code here.
32+
33+
// Initialize global strings
34+
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
35+
LoadStringW(hInstance, IDC_WINWEBMERGE, szWindowClass, MAX_LOADSTRING);
36+
MyRegisterClass(hInstance);
37+
hInstDLL = GetModuleHandleW(L"WinWebMergeLib.dll");
38+
39+
// Perform application initialization:
40+
if (!InitInstance (hInstance, nCmdShow))
41+
{
42+
return FALSE;
43+
}
44+
45+
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WINWEBMERGE));
46+
47+
MSG msg;
48+
49+
// Main message loop:
50+
while (GetMessage(&msg, nullptr, 0, 0))
51+
{
52+
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
53+
{
54+
TranslateMessage(&msg);
55+
DispatchMessage(&msg);
56+
}
57+
}
58+
59+
return (int) msg.wParam;
60+
}
61+
62+
63+
64+
//
65+
// FUNCTION: MyRegisterClass()
66+
//
67+
// PURPOSE: Registers the window class.
68+
//
69+
ATOM MyRegisterClass(HINSTANCE hInstance)
70+
{
71+
WNDCLASSEXW wcex;
72+
73+
wcex.cbSize = sizeof(WNDCLASSEX);
74+
75+
wcex.style = CS_HREDRAW | CS_VREDRAW;
76+
wcex.lpfnWndProc = WndProc;
77+
wcex.cbClsExtra = 0;
78+
wcex.cbWndExtra = 0;
79+
wcex.hInstance = hInstance;
80+
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WINWEBMERGE));
81+
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
82+
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
83+
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_WINWEBMERGE);
84+
wcex.lpszClassName = szWindowClass;
85+
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
86+
87+
return RegisterClassExW(&wcex);
88+
}
89+
90+
//
91+
// FUNCTION: InitInstance(HINSTANCE, int)
92+
//
93+
// PURPOSE: Saves instance handle and creates main window
94+
//
95+
// COMMENTS:
96+
//
97+
// In this function, we save the instance handle in a global variable and
98+
// create and display the main program window.
99+
//
100+
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
101+
{
102+
hInst = hInstance; // Store instance handle in our global variable
103+
104+
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
105+
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
106+
107+
if (!hWnd)
108+
{
109+
return FALSE;
110+
}
111+
112+
ShowWindow(hWnd, nCmdShow);
113+
UpdateWindow(hWnd);
114+
115+
return TRUE;
116+
}
117+
118+
//
119+
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
120+
//
121+
// PURPOSE: Processes messages for the main window.
122+
//
123+
// WM_COMMAND - process the application menu
124+
// WM_PAINT - Paint the main window
125+
// WM_DESTROY - post a quit message and return
126+
//
127+
//
128+
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
129+
{
130+
switch (message)
131+
{
132+
case WM_CREATE:
133+
m_pWebMergeWindow = WinWebMerge_CreateWindow(hInstDLL, hWnd);
134+
break;
135+
case WM_SIZE:
136+
{
137+
RECT rc;
138+
GetClientRect(hWnd, &rc);
139+
m_pWebMergeWindow->SetWindowRect(rc);
140+
break;
141+
}
142+
case WM_COMMAND:
143+
{
144+
int wmId = LOWORD(wParam);
145+
// Parse the menu selections:
146+
switch (wmId)
147+
{
148+
case IDM_ABOUT:
149+
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
150+
break;
151+
case IDM_EXIT:
152+
DestroyWindow(hWnd);
153+
break;
154+
default:
155+
return DefWindowProc(hWnd, message, wParam, lParam);
156+
}
157+
}
158+
break;
159+
case WM_PAINT:
160+
{
161+
PAINTSTRUCT ps;
162+
HDC hdc = BeginPaint(hWnd, &ps);
163+
// TODO: Add any drawing code that uses hdc here...
164+
EndPaint(hWnd, &ps);
165+
}
166+
break;
167+
case WM_DESTROY:
168+
WinWebMerge_DestroyWindow(m_pWebMergeWindow);
169+
PostQuitMessage(0);
170+
break;
171+
default:
172+
return DefWindowProc(hWnd, message, wParam, lParam);
173+
}
174+
return 0;
175+
}
176+
177+
// Message handler for about box.
178+
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
179+
{
180+
UNREFERENCED_PARAMETER(lParam);
181+
switch (message)
182+
{
183+
case WM_INITDIALOG:
184+
return (INT_PTR)TRUE;
185+
186+
case WM_COMMAND:
187+
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
188+
{
189+
EndDialog(hDlg, LOWORD(wParam));
190+
return (INT_PTR)TRUE;
191+
}
192+
break;
193+
}
194+
return (INT_PTR)FALSE;
195+
}

WinWebMerge/WinWebMerge.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#pragma once
2+
3+
#include "resource.h"

WinWebMerge/WinWebMerge.ico

45.1 KB
Binary file not shown.

WinWebMerge/WinWebMerge.rc

6.74 KB
Binary file not shown.

0 commit comments

Comments
 (0)