Skip to content

Commit 2c5b3c9

Browse files
committed
Issue #3 Added an opportunity to record an image stream to avi file.
1 parent 8ac9f30 commit 2c5b3c9

21 files changed

+615
-140
lines changed

Build/Build.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
<WindowTextExtractorSourceFileWin64 Include="$(WindowTextExtractorProjectPath)\bin\x64\Release\WindowTextExtractor.exe" />
1818
<WindowTextExtractorDestFileWin32 Include="$(ApplicationPath)\WindowTextExtractor.exe" />
1919
<WindowTextExtractorDestFileWin64 Include="$(ApplicationPath)\WindowTextExtractor64.exe" />
20+
<WindowTextExtractorSourceConfgiFile Include="$(WindowTextExtractorProjectPath)\bin\x86\Release\WindowTextExtractor.exe.config" />
21+
<WindowTextExtractorDestConfgiFile Include="$(ApplicationPath)\WindowTextExtractor.exe.config" />
22+
<WindowTextExtractorSourceLibFiles Include="$(WindowTextExtractorProjectPath)\bin\x86\Release\Libs\*.dll" />
23+
<WindowTextExtractorDestLibFiles Include="$(ApplicationPath)\" />
2024
</ItemGroup>
2125

2226
<Target Name="BuildSolution">
@@ -28,6 +32,8 @@
2832
<CallTarget Targets="Copy_Release_x64_WindowTextExtractor" />
2933
<CallTarget Targets="Build_Release_x32_WindowTextExtractor" />
3034
<CallTarget Targets="Copy_Release_x32_WindowTextExtractor" />
35+
<CallTarget Targets="Copy_Release_ConfigFile" />
36+
<CallTarget Targets="Copy_Release_LibFiles" />
3137
</Target>
3238

3339
<Target Name="Build_Release_x32_WindowTextExtractorHook">
@@ -81,4 +87,18 @@
8187
<Copy SourceFiles="@(WindowTextExtractorSourceFileWin64)" DestinationFiles="@(WindowTextExtractorDestFileWin64)" />
8288
<Message Text="Copy Completed $(WindowTextExtractorProjectName) Realese x64" />
8389
</Target>
90+
91+
<Target Name="Copy_Release_ConfigFile">
92+
<Message Text="Copy Config File" />
93+
<MakeDir Directories="$(ApplicationPath)"/>
94+
<Copy SourceFiles="@(WindowTextExtractorSourceConfgiFile)" DestinationFiles="@(WindowTextExtractorDestConfgiFile)" />
95+
<Message Text="Copy Completed Config File" />
96+
</Target>
97+
98+
<Target Name="Copy_Release_LibFiles">
99+
<Message Text="Copy Lib Files" />
100+
<MakeDir Directories="$(ApplicationPath)"/>
101+
<Copy SourceFiles="@(WindowTextExtractorSourceLibFiles)" DestinationFolder="@(WindowTextExtractorDestLibFiles)" />
102+
<Message Text="Copy Completed Lib Files" />
103+
</Target>
84104
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Threading;
3+
using WindowTextExtractor.Native;
4+
5+
namespace WindowTextExtractor
6+
{
7+
class AccurateTimer
8+
{
9+
private int _timerId;
10+
private Action _action;
11+
private Winmm.TimerEventDelegate _handler;
12+
13+
public AccurateTimer(Action action, int delay)
14+
{
15+
_action = action;
16+
Winmm.timeBeginPeriod(1);
17+
_handler = new Winmm.TimerEventDelegate(TimerCallback);
18+
_timerId = Winmm.timeSetEvent(delay, 0, _handler, IntPtr.Zero, Constants.EVENT_TYPE);
19+
}
20+
21+
public void Stop()
22+
{
23+
Winmm.timeKillEvent(_timerId);
24+
Winmm.timeEndPeriod(1);
25+
Thread.Sleep(100);
26+
}
27+
28+
private void TimerCallback(int id, int msg, IntPtr user, int dw1, int dw2)
29+
{
30+
if (_timerId != 0)
31+
{
32+
_action();
33+
}
34+
}
35+
}
36+
}

WindowTextExtractor/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup useLegacyV2RuntimeActivationPolicy="true">
4+
<supportedRuntime version="v4.0" />
5+
</startup>
6+
</configuration>

WindowTextExtractor/Forms/MainForm.Designer.cs

Lines changed: 118 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)