Skip to content

Commit f3cf9c5

Browse files
committed
Added an opportunity to build the application by MsBuild.
1 parent 9fa1663 commit f3cf9c5

File tree

8 files changed

+135
-17
lines changed

8 files changed

+135
-17
lines changed

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.vs/
2-
31
## Ignore Visual Studio temporary files, build results, and
42
## files generated by popular Visual Studio add-ons.
53

@@ -11,11 +9,16 @@
119
# Build results
1210

1311
[Dd]ebug/
12+
[Dd]ebug32/
13+
[Dd]ebug64/
1414
[Rr]elease/
15+
[Rr]elease32/
16+
[Rr]elease64/
1517
x64/
16-
build/
1718
[Bb]in/
1819
[Oo]bj/
20+
.vs/
21+
Application/
1922

2023
#NuGet
2124
packages/

Build/Build.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
call "%VS100COMNTOOLS%\vsvars32.bat"
2+
MSBuild.exe Build.xml
3+
pause

Build/Build.xml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<WindowTextExtractorProjectPath>..\WindowTextExtractor</WindowTextExtractorProjectPath>
5+
<WindowTextExtractorProjectName>WindowTextExtractor</WindowTextExtractorProjectName>
6+
<WindowTextExtractorHookProjectPath>..\WindowTextExtractorHook</WindowTextExtractorHookProjectPath>
7+
<WindowTextExtractorHookProjectName>WindowTextExtractorHook</WindowTextExtractorHookProjectName>
8+
<ApplicationPath>..\Application</ApplicationPath>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<WindowTextExtractorHookSourceFileWin32 Include="$(WindowTextExtractorHookProjectPath)\Release32\WindowTextExtractorHook.dll" />
13+
<WindowTextExtractorHookSourceFileWin64 Include="$(WindowTextExtractorHookProjectPath)\Release64\WindowTextExtractorHook.dll" />
14+
<WindowTextExtractorHookDestFileWin32 Include="$(ApplicationPath)\WindowTextExtractorHook.dll" />
15+
<WindowTextExtractorHookDestFileWin64 Include="$(ApplicationPath)\WindowTextExtractorHook64.dll" />
16+
<WindowTextExtractorSourceFileWin32 Include="$(WindowTextExtractorProjectPath)\bin\x86\Release\WindowTextExtractor.exe" />
17+
<WindowTextExtractorSourceFileWin64 Include="$(WindowTextExtractorProjectPath)\bin\x64\Release\WindowTextExtractor.exe" />
18+
<WindowTextExtractorDestFileWin32 Include="$(ApplicationPath)\WindowTextExtractor.exe" />
19+
<WindowTextExtractorDestFileWin64 Include="$(WindowTextExtractorProjectPath)\WindowTextExtractor64.exe" />
20+
<EmptyTextForFile Include="Empty File" />
21+
</ItemGroup>
22+
23+
<Target Name="BuildSolution">
24+
<CallTarget Targets="Build_Release_x32_WindowTextExtractorHook" />
25+
<CallTarget Targets="Copy_Release_x32_WindowTextExtractorHook" />
26+
<CallTarget Targets="Build_Release_x64_WindowTextExtractorHook" />
27+
<CallTarget Targets="Copy_Release_x64_WindowTextExtractorHook" />
28+
<CallTarget Targets="WriteEmptyTextToEmbeddedResourceInWindowTextExtractor" />
29+
<CallTarget Targets="Build_Release_x64_WindowTextExtractor" />
30+
<CallTarget Targets="Copy_Release_x64_WindowTextExtractor" />
31+
<CallTarget Targets="Build_Release_x32_WindowTextExtractor" />
32+
<CallTarget Targets="Copy_Release_x32_WindowTextExtractor" />
33+
</Target>
34+
35+
<Target Name="Build_Release_x32_WindowTextExtractorHook">
36+
<Message Text="Build $(WindowTextExtractorHookProjectName) Realese x32" />
37+
<MSBuild Projects="$(WindowTextExtractorHookProjectPath)\$(WindowTextExtractorHookProjectName).vcxproj" Targets="Clean;Rebuild" Properties="Configuration=Release;Platform=Win32" />
38+
<Message Text="Build Completed $(WindowTextExtractorHookProjectName) Realese x32" />
39+
</Target>
40+
41+
<Target Name="Build_Release_x64_WindowTextExtractorHook">
42+
<Message Text="Build $(WindowTextExtractorHookProjectName) Realese x64" />
43+
<MSBuild Projects="$(WindowTextExtractorHookProjectPath)\$(WindowTextExtractorHookProjectName).vcxproj" Targets="Clean;Rebuild" Properties="Configuration=Release;Platform=x64" />
44+
<Message Text="Build Completed $(WindowTextExtractorHookProjectName) Realese x64" />
45+
</Target>
46+
47+
<Target Name="Build_Release_x32_WindowTextExtractor">
48+
<Message Text="Build $(WindowTextExtractorProjectName) Realese x32" />
49+
<MSBuild Projects="$(WindowTextExtractorProjectPath)\$(WindowTextExtractorProjectName).csproj" Targets="Clean;Rebuild" Properties="Configuration=Release;Platform=x86" />
50+
<Message Text="Build Completed $(WindowTextExtractorProjectName) Realese x32" />
51+
</Target>
52+
53+
<Target Name="Build_Release_x64_WindowTextExtractor">
54+
<Message Text="Build $(WindowTextExtractorProjectName) Realese x64" />
55+
<MSBuild Projects="$(WindowTextExtractorProjectPath)\$(WindowTextExtractorProjectName).csproj" Targets="Clean;Rebuild" Properties="Configuration=Release;Platform=x64" />
56+
<Message Text="Build Completed $(WindowTextExtractorProjectName) Realese x64" />
57+
</Target>
58+
59+
<Target Name="Copy_Release_x32_WindowTextExtractorHook">
60+
<Message Text="Copy $(WindowTextExtractorHookProjectName) Realese x32" />
61+
<MakeDir Directories="$(ApplicationPath)"/>
62+
<Copy SourceFiles="@(WindowTextExtractorHookSourceFileWin32)" DestinationFiles="@(WindowTextExtractorHookDestFileWin32)" />
63+
<Message Text="Copy Completed $(WindowTextExtractorHookProjectName) Realese x32" />
64+
</Target>
65+
66+
<Target Name="Copy_Release_x64_WindowTextExtractorHook">
67+
<Message Text="Copy $(WindowTextExtractorHookProjectName) Realese x64" />
68+
<MakeDir Directories="$(ApplicationPath)"/>
69+
<Copy SourceFiles="@(WindowTextExtractorHookSourceFileWin64)" DestinationFiles="@(WindowTextExtractorHookDestFileWin64)" />
70+
<Message Text="Copy Completed $(WindowTextExtractorHookProjectName) Realese x64" />
71+
</Target>
72+
73+
<Target Name="Copy_Release_x32_WindowTextExtractor">
74+
<Message Text="Copy $(WindowTextExtractorProjectName) Realese x32" />
75+
<MakeDir Directories="$(ApplicationPath)"/>
76+
<Copy SourceFiles="@(WindowTextExtractorSourceFileWin32)" DestinationFiles="@(WindowTextExtractorDestFileWin32)" />
77+
<Message Text="Copy Completed $(WindowTextExtractorProjectName) Realese x32" />
78+
</Target>
79+
80+
<Target Name="Copy_Release_x64_WindowTextExtractor">
81+
<Message Text="Copy $(WindowTextExtractorProjectName) Realese x64" />
82+
<MakeDir Directories="$(ApplicationPath)"/>
83+
<Copy SourceFiles="@(WindowTextExtractorSourceFileWin64)" DestinationFiles="@(WindowTextExtractorDestFileWin64)" />
84+
<Message Text="Copy Completed $(WindowTextExtractorProjectName) Realese x64" />
85+
</Target>
86+
87+
<Target Name="WriteEmptyTextToEmbeddedResourceInWindowTextExtractor">
88+
<Message Text="Write Empty Embedded Resource $(WindowTextExtractorProjectName)" />
89+
<WriteLinesToFile File="@(WindowTextExtractorDestFileWin64)" Lines="@(EmptyTextForFile)" Overwrite="true" />
90+
<Message Text="Write Empty Embedded Resource Completed $(WindowTextExtractorProjectName)" />
91+
</Target>
92+
</Project>

WindowTextExtractor.sln

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Global
2121
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
2222
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Debug|x64.ActiveCfg = Debug|Any CPU
2323
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Debug|x64.Build.0 = Debug|Any CPU
24-
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Debug|x86.ActiveCfg = Debug|Any CPU
25-
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Debug|x86.Build.0 = Debug|Any CPU
24+
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Debug|x86.ActiveCfg = Debug|x86
25+
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Debug|x86.Build.0 = Debug|x86
2626
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
2727
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Release|Any CPU.Build.0 = Release|Any CPU
2828
{784E5D61-B08C-47E4-936A-03C9F67B71D0}.Release|x64.ActiveCfg = Release|Any CPU
@@ -32,8 +32,8 @@ Global
3232
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Debug|Any CPU.ActiveCfg = Debug|Win32
3333
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Debug|x64.ActiveCfg = Debug|x64
3434
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Debug|x64.Build.0 = Debug|x64
35-
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Debug|x86.ActiveCfg = Debug|x64
36-
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Debug|x86.Build.0 = Debug|x64
35+
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Debug|x86.ActiveCfg = Debug|Win32
36+
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Debug|x86.Build.0 = Debug|Win32
3737
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Release|Any CPU.ActiveCfg = Release|Win32
3838
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Release|x64.ActiveCfg = Release|x64
3939
{5A4E4384-EF85-4E57-BFD6-ED0F99386E34}.Release|x64.Build.0 = Release|x64

WindowTextExtractor/Forms/MainForm.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ public partial class MainForm : Form, IMessageFilter
1717
private bool _isButtonTargetPasswordMouseDown;
1818
private Cursor _targetTextCursor;
1919
private Cursor _targetPasswordCursor;
20-
#if WIN32
2120
private string _64BitFilePath;
22-
#endif
2321

2422
public MainForm()
2523
{
@@ -30,6 +28,7 @@ public MainForm()
3028
_targetPasswordCursor = new Cursor(Properties.Resources.TargetPassword.Handle);
3129
_processId = Process.GetCurrentProcess().Id;
3230
_messageId = NativeMethods.RegisterWindowMessage("WINDOW_TEXT_EXTRACTOR_HOOK");
31+
_64BitFilePath = "";
3332
}
3433

3534
protected override void OnLoad(EventArgs e)

WindowTextExtractor/WindowTextExtractor.csproj

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,41 @@
2727
<UseApplicationTrust>false</UseApplicationTrust>
2828
<BootstrapperEnabled>true</BootstrapperEnabled>
2929
</PropertyGroup>
30-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
30+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
3131
<PlatformTarget>x86</PlatformTarget>
3232
<DebugSymbols>true</DebugSymbols>
3333
<DebugType>full</DebugType>
3434
<Optimize>false</Optimize>
35-
<OutputPath>bin\Debug\</OutputPath>
35+
<OutputPath>bin\x86\Debug\</OutputPath>
3636
<DefineConstants>TRACE;DEBUG;WIN32</DefineConstants>
3737
<ErrorReport>prompt</ErrorReport>
3838
<WarningLevel>4</WarningLevel>
3939
</PropertyGroup>
40-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
41-
<PlatformTarget>AnyCPU</PlatformTarget>
40+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
41+
<PlatformTarget>x86</PlatformTarget>
42+
<DebugType>pdbonly</DebugType>
43+
<Optimize>true</Optimize>
44+
<OutputPath>bin\x86\Release\</OutputPath>
45+
<DefineConstants>TRACE;WIN32</DefineConstants>
46+
<ErrorReport>prompt</ErrorReport>
47+
<WarningLevel>4</WarningLevel>
48+
</PropertyGroup>
49+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
50+
<PlatformTarget>x64</PlatformTarget>
51+
<DebugSymbols>true</DebugSymbols>
52+
<DebugType>full</DebugType>
53+
<Optimize>false</Optimize>
54+
<OutputPath>bin\x64\Debug\</OutputPath>
55+
<DefineConstants>TRACE;DEBUG;WIN64</DefineConstants>
56+
<ErrorReport>prompt</ErrorReport>
57+
<WarningLevel>4</WarningLevel>
58+
</PropertyGroup>
59+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
60+
<PlatformTarget>x64</PlatformTarget>
4261
<DebugType>pdbonly</DebugType>
4362
<Optimize>true</Optimize>
44-
<OutputPath>bin\Release\</OutputPath>
45-
<DefineConstants>TRACE</DefineConstants>
63+
<OutputPath>bin\x64\Release\</OutputPath>
64+
<DefineConstants>TRACE;WIN64</DefineConstants>
4665
<ErrorReport>prompt</ErrorReport>
4766
<WarningLevel>4</WarningLevel>
4867
</PropertyGroup>
-512 Bytes
Binary file not shown.

WindowTextExtractorHook/WindowTextExtractorHook.vcxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,19 @@
7272
<PropertyGroup Label="UserMacros" />
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7474
<LinkIncremental>false</LinkIncremental>
75+
<OutDir>.\Release32\</OutDir>
7576
</PropertyGroup>
7677
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7778
<LinkIncremental>true</LinkIncremental>
78-
<OutDir>.\$(Configuration)\</OutDir>
79+
<OutDir>.\Debug32\</OutDir>
7980
</PropertyGroup>
8081
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8182
<LinkIncremental>true</LinkIncremental>
82-
<OutDir>.\$(Configuration)\</OutDir>
83+
<OutDir>.\Debug64\</OutDir>
8384
</PropertyGroup>
8485
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8586
<LinkIncremental>false</LinkIncremental>
87+
<OutDir>.\Release64\</OutDir>
8688
</PropertyGroup>
8789
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
8890
<ClCompile>

0 commit comments

Comments
 (0)