Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
exectails committed Mar 28, 2016
1 parent b3af676 commit 3f48b5d
Show file tree
Hide file tree
Showing 32 changed files with 16,768 additions and 0 deletions.
22 changes: 22 additions & 0 deletions IPFBrowser.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IPFBrowser", "IPFBrowser\IPFBrowser.csproj", "{1776B727-829E-46A4-B9BE-96687449C1D3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1776B727-829E-46A4-B9BE-96687449C1D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1776B727-829E-46A4-B9BE-96687449C1D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1776B727-829E-46A4-B9BE-96687449C1D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1776B727-829E-46A4-B9BE-96687449C1D3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
29 changes: 29 additions & 0 deletions IPFBrowser/ControlHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace IPFBrowser
{
public static class ControlHelper
{
[DllImport("user32.dll", EntryPoint = "SendMessageA", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
private const int WM_SETREDRAW = 0xB;

public static void SuspendDrawing(this Control target)
{
SendMessage(target.Handle, WM_SETREDRAW, 0, 0);
}

public static void ResumeDrawing(this Control target) { ResumeDrawing(target, true); }
public static void ResumeDrawing(this Control target, bool redraw)
{
SendMessage(target.Handle, WM_SETREDRAW, 1, 0);

if (redraw)
{
target.Refresh();
}
}
}
}
Loading

0 comments on commit 3f48b5d

Please sign in to comment.