Skip to content

Commit

Permalink
Issue #3 Added an opportunity to record an image stream to avi file.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderPro committed May 14, 2022
1 parent 8ac9f30 commit 2c5b3c9
Show file tree
Hide file tree
Showing 21 changed files with 615 additions and 140 deletions.
20 changes: 20 additions & 0 deletions Build/Build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<WindowTextExtractorSourceFileWin64 Include="$(WindowTextExtractorProjectPath)\bin\x64\Release\WindowTextExtractor.exe" />
<WindowTextExtractorDestFileWin32 Include="$(ApplicationPath)\WindowTextExtractor.exe" />
<WindowTextExtractorDestFileWin64 Include="$(ApplicationPath)\WindowTextExtractor64.exe" />
<WindowTextExtractorSourceConfgiFile Include="$(WindowTextExtractorProjectPath)\bin\x86\Release\WindowTextExtractor.exe.config" />
<WindowTextExtractorDestConfgiFile Include="$(ApplicationPath)\WindowTextExtractor.exe.config" />
<WindowTextExtractorSourceLibFiles Include="$(WindowTextExtractorProjectPath)\bin\x86\Release\Libs\*.dll" />
<WindowTextExtractorDestLibFiles Include="$(ApplicationPath)\" />
</ItemGroup>

<Target Name="BuildSolution">
Expand All @@ -28,6 +32,8 @@
<CallTarget Targets="Copy_Release_x64_WindowTextExtractor" />
<CallTarget Targets="Build_Release_x32_WindowTextExtractor" />
<CallTarget Targets="Copy_Release_x32_WindowTextExtractor" />
<CallTarget Targets="Copy_Release_ConfigFile" />
<CallTarget Targets="Copy_Release_LibFiles" />
</Target>

<Target Name="Build_Release_x32_WindowTextExtractorHook">
Expand Down Expand Up @@ -81,4 +87,18 @@
<Copy SourceFiles="@(WindowTextExtractorSourceFileWin64)" DestinationFiles="@(WindowTextExtractorDestFileWin64)" />
<Message Text="Copy Completed $(WindowTextExtractorProjectName) Realese x64" />
</Target>

<Target Name="Copy_Release_ConfigFile">
<Message Text="Copy Config File" />
<MakeDir Directories="$(ApplicationPath)"/>
<Copy SourceFiles="@(WindowTextExtractorSourceConfgiFile)" DestinationFiles="@(WindowTextExtractorDestConfgiFile)" />
<Message Text="Copy Completed Config File" />
</Target>

<Target Name="Copy_Release_LibFiles">
<Message Text="Copy Lib Files" />
<MakeDir Directories="$(ApplicationPath)"/>
<Copy SourceFiles="@(WindowTextExtractorSourceLibFiles)" DestinationFolder="@(WindowTextExtractorDestLibFiles)" />
<Message Text="Copy Completed Lib Files" />
</Target>
</Project>
36 changes: 36 additions & 0 deletions WindowTextExtractor/AccurateTimer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Threading;
using WindowTextExtractor.Native;

namespace WindowTextExtractor
{
class AccurateTimer
{
private int _timerId;
private Action _action;
private Winmm.TimerEventDelegate _handler;

public AccurateTimer(Action action, int delay)
{
_action = action;
Winmm.timeBeginPeriod(1);
_handler = new Winmm.TimerEventDelegate(TimerCallback);
_timerId = Winmm.timeSetEvent(delay, 0, _handler, IntPtr.Zero, Constants.EVENT_TYPE);
}

public void Stop()
{
Winmm.timeKillEvent(_timerId);
Winmm.timeEndPeriod(1);
Thread.Sleep(100);
}

private void TimerCallback(int id, int msg, IntPtr user, int dw1, int dw2)
{
if (_timerId != 0)
{
_action();
}
}
}
}
6 changes: 6 additions & 0 deletions WindowTextExtractor/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
</configuration>
135 changes: 118 additions & 17 deletions WindowTextExtractor/Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2c5b3c9

Please sign in to comment.