{
if (form.WindowState == FormWindowState.Minimized)
{
- Win32Api.RestoreWindow(form);
+ NativeMethods.RestoreWindow(form);
}
form.Activate();
}
Networking.proxyType = proxyType;
Networking.proxy = proxy;
- Win32Api.SetProxy(proxyType, proxyAddress, proxyPort, proxyUser, proxyPassword);
+ NativeMethods.SetProxy(proxyType, proxyAddress, proxyPort, proxyUser, proxyPassword);
OnWebProxyChanged(EventArgs.Empty);
}
// Begin/EndUpdate メソッドを持たないコントロールに対しては、
// WM_SETREDRAW メッセージを直接コントロールに送信する。
return new Transaction<Control>(control,
- x => Win32Api.SetRedrawState(x, false),
- x => { Win32Api.SetRedrawState(x, true); x.Invalidate(true); });
+ x => NativeMethods.SetRedrawState(x, false),
+ x => { NativeMethods.SetRedrawState(x, true); x.Invalidate(true); });
}
public static IDisposable Layout(Control control)
/// </remarks>
public int SelectionMark
{
- get { return Win32Api.ListView_GetSelectionMark(this.Handle); }
- set { Win32Api.ListView_SetSelectionMark(this.Handle, value); }
+ get { return NativeMethods.ListView_GetSelectionMark(this.Handle); }
+ set { NativeMethods.ListView_SetSelectionMark(this.Handle, value); }
}
public void ChangeItemBackColor(int index, Color backColor)
case WM_PAINT:
if (this.changeBounds != Rectangle.Empty)
{
- Win32Api.ValidateRect(this.Handle, IntPtr.Zero);
+ NativeMethods.ValidateRect(this.Handle, IntPtr.Zero);
this.Invalidate(this.changeBounds);
this.changeBounds = Rectangle.Empty;
}
InitializeComponent();
// メイリオフォント指定時にタブの最小幅が広くなる問題の対策
- this.TabEventType.HandleCreated += (s, e) => Win32Api.SetMinTabWidth((TabControl)s, 40);
+ this.TabEventType.HandleCreated += (s, e) => NativeMethods.SetMinTabWidth((TabControl)s, 40);
}
private void OK_Button_Click(object sender, EventArgs e)
{
if (kvp.Value.KeyEvent.KeyData == key.KeyData && kvp.Value.Value == hotkeyValue) return true; // 登録済みなら正常終了
}
- var hotkeyId = Win32Api.RegisterGlobalHotKey(hotkeyValue, (int)modifiers, this._targetForm);
+ var hotkeyId = NativeMethods.RegisterGlobalHotKey(hotkeyValue, (int)modifiers, this._targetForm);
if (hotkeyId > 0)
{
this._hotkeyID.Add(hotkeyId, new KeyEventValue(key, hotkeyValue));
{
foreach (ushort hotkeyId in this._hotkeyID.Keys)
{
- Win32Api.UnregisterGlobalHotKey(hotkeyId, this._targetForm);
+ NativeMethods.UnregisterGlobalHotKey(hotkeyId, this._targetForm);
}
this._hotkeyID.Clear();
}
namespace OpenTween
{
- public static class Win32Api
+ internal static class NativeMethods
{
// 指定されたウィンドウへ、指定されたメッセージを送信します
[DllImport("user32.dll")]
<Compile Include="MediaSelector.Designer.cs">
<DependentUpon>MediaSelector.cs</DependentUpon>
</Compile>
+ <Compile Include="NativeMethods.cs">
+ <SubType>Code</SubType>
+ </Compile>
<Compile Include="OTBaseForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UserInfo.cs" />
<Compile Include="WebApiException.cs" />
<Compile Include="WebBrowserController.cs" />
- <Compile Include="Win32Api.cs" />
<Compile Include="ControlTransaction.cs" />
</ItemGroup>
<ItemGroup>
!SettingDialog.LimitBalloon
)
) &&
- !Win32Api.IsScreenSaverRunning())
+ !NativeMethods.IsScreenSaverRunning())
{
return true;
}
//mentions新着時に画面ブリンク
if (!_initial && SettingDialog.BlinkNewMentions && newMentions && Form.ActiveForm == null)
{
- Win32Api.FlashMyWindow(this.Handle, Win32Api.FlashSpecification.FlashTray, 3);
+ NativeMethods.FlashMyWindow(this.Handle, NativeMethods.FlashSpecification.FlashTray, 3);
}
}
this.gh.NotifyClicked += GrowlHelper_Callback;
// メイリオフォント指定時にタブの最小幅が広くなる問題の対策
- this.ListTab.HandleCreated += (s, e) => Win32Api.SetMinTabWidth((TabControl)s, 40);
+ this.ListTab.HandleCreated += (s, e) => NativeMethods.SetMinTabWidth((TabControl)s, 40);
this._apiGauge = new ToolStripAPIGauge();
this._apiGauge.BorderSides = ToolStripStatusLabelBorderSides.Right;