-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathWinIMergeLib.cpp
More file actions
86 lines (79 loc) · 2.78 KB
/
Copy pathWinIMergeLib.cpp
File metadata and controls
86 lines (79 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/////////////////////////////////////////////////////////////////////////////
// License (GPLv2+):
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program 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
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
/////////////////////////////////////////////////////////////////////////////
#include <Windows.h>
#include <gdiplus.h>
#include "ImgWindow.hpp"
#include "ImgMergeWindow.hpp"
#include "ImgToolWindow.hpp"
extern "C" IImgMergeWindow *
WinIMerge_CreateWindow(HINSTANCE hInstance, HWND hWndParent, int nID)
{
RECT rc = {0};
CImgMergeWindow *pImgMergeWindow = new CImgMergeWindow();
pImgMergeWindow->Create(hInstance, hWndParent, nID, rc);
return static_cast<IImgMergeWindow *>(pImgMergeWindow);
}
extern "C" IImgMergeWindow *
WinIMerge_CreateWindowless()
{
CImgMergeWindow *pImgMergeWindow = new CImgMergeWindow();
return static_cast<IImgMergeWindow *>(pImgMergeWindow);
}
extern "C" bool
WinIMerge_DestroyWindow(IImgMergeWindow *pImgMergeWindow)
{
CImgMergeWindow *pImgMergeWindow2 = static_cast<CImgMergeWindow *>(pImgMergeWindow);
pImgMergeWindow2->Destroy();
delete pImgMergeWindow2;
return true;
}
extern "C" IImgToolWindow *
WinIMerge_CreateToolWindow(HINSTANCE hInstance, HWND hWndParent, IImgMergeWindow *pImgMergeWindow)
{
CImgToolWindow *pImgToolWindow = new CImgToolWindow();
pImgToolWindow->Create(hInstance, hWndParent);
pImgToolWindow->SetImgMergeWindow(pImgMergeWindow);
return static_cast<IImgToolWindow *>(pImgToolWindow);
}
extern "C" bool
WinIMerge_DestroyToolWindow(IImgToolWindow *pImgToolWindow)
{
CImgToolWindow *pImgToolWindow2 = static_cast<CImgToolWindow *>(pImgToolWindow);
pImgToolWindow2->Destroy();
delete pImgToolWindow2;
return true;
}
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
FreeImage_Initialise();
#ifdef _WIN64
InitializeCriticalSection(&Win78Libraries::CriticalSection);
#endif
return TRUE;
}
else if (dwReason == DLL_PROCESS_DETACH)
{
#ifdef _WIN64
Win78Libraries::unload();
DeleteCriticalSection(&Win78Libraries::CriticalSection);
#endif
FreeImage_DeInitialise();
}
return FALSE;
}