@@ -106,7 +106,7 @@ void OpenVideo(string path)
106
106
videoWindow . SetPosition ( _screen . Bounds ) ;
107
107
videoWindow . Show ( ) ;
108
108
109
- PInvoke . SetParent ( videoWindow . GetHandle ( ) , _desktopWindowHandle ) ;
109
+ NativeMethods . SetParent ( videoWindow . GetHandle ( ) , _desktopWindowHandle ) ;
110
110
}
111
111
112
112
( ( IPlayerControl ) _player ) . Source = new Uri ( path , UriKind . Absolute ) ;
@@ -137,7 +137,7 @@ void OpenWeb(string url)
137
137
webWindow . SetPosition ( _screen . Bounds ) ;
138
138
webWindow . Show ( ) ;
139
139
140
- PInvoke . SetParent ( webWindow . GetHandle ( ) , _desktopWindowHandle ) ;
140
+ NativeMethods . SetParent ( webWindow . GetHandle ( ) , _desktopWindowHandle ) ;
141
141
}
142
142
143
143
( ( IPlayerControl ) _player ) . Source = new Uri ( url ) ;
@@ -165,7 +165,7 @@ void SetWindow(IntPtr hWnd)
165
165
WindowPlayer windowPlayer = new WindowPlayer ( hWnd ) ;
166
166
_player = windowPlayer ;
167
167
windowPlayer . SetPosition ( _screen . Bounds ) ;
168
- PInvoke . SetParent ( windowPlayer . GetHandle ( ) , _desktopWindowHandle ) ;
168
+ NativeMethods . SetParent ( windowPlayer . GetHandle ( ) , _desktopWindowHandle ) ;
169
169
170
170
EnableControl ( ) ;
171
171
}
@@ -190,7 +190,7 @@ void CloseWindow(WindowType wt)
190
190
toolStripMenuItem27 . Enabled = true ;
191
191
192
192
if ( _player is IPlayerInteractive && _settings . UseDesktopInteraction )
193
- PInvoke . DS2_EndForwardMouseKeyboardMessage ( ) ;
193
+ NativeMethods . DS2_EndForwardMouseKeyboardMessage ( ) ;
194
194
195
195
if ( _lwt == WindowType . Web && ! ( ( IPlayerControl ) _player ) . IsPlaying )
196
196
Play_ ( ) ;
@@ -204,14 +204,14 @@ void CloseWindow(WindowType wt)
204
204
_lwt = wt ;
205
205
206
206
GC . Collect ( ) ;
207
- PInvoke . DS2_RefreshDesktop ( ) ;
207
+ NativeMethods . DS2_RefreshDesktop ( ) ;
208
208
}
209
209
210
210
void ForwardMessage ( )
211
211
{
212
212
IntPtr hWnd = ( ( IPlayerInteractive ) _player ) . GetMessageHandle ( ) ;
213
213
if ( hWnd != IntPtr . Zero )
214
- PInvoke . DS2_StartForwardMouseKeyboardMessage ( hWnd ) ;
214
+ NativeMethods . DS2_StartForwardMouseKeyboardMessage ( hWnd ) ;
215
215
}
216
216
217
217
#endregion
@@ -222,7 +222,7 @@ void ForwardMessage()
222
222
223
223
private void MainForm_Load ( object sender , EventArgs e )
224
224
{
225
- _desktopWindowHandle = PInvoke . DS2_GetDesktopWindowHandle ( ) ;
225
+ _desktopWindowHandle = NativeMethods . DS2_GetDesktopWindowHandle ( ) ;
226
226
if ( _desktopWindowHandle == IntPtr . Zero )
227
227
{
228
228
btnOpenFile . Enabled = false ;
@@ -271,7 +271,7 @@ private void MainForm_Load(object sender, EventArgs e)
271
271
const int MOD_NOREPEAT = 0x4000 ;
272
272
const int MOD_CONTROL = 0x0002 ;
273
273
const int MOD_ALT = 0x0001 ;
274
- PInvoke . RegisterHotKey ( this . Handle , PLAY_HOTKEY_ID , MOD_NOREPEAT | MOD_CONTROL | MOD_ALT , ( int ) 'P' ) ;
274
+ NativeMethods . RegisterHotKey ( this . Handle , PLAY_HOTKEY_ID , MOD_NOREPEAT | MOD_CONTROL | MOD_ALT , ( int ) 'P' ) ;
275
275
}
276
276
277
277
private void MainForm_FormClosing ( object sender , FormClosingEventArgs e )
@@ -293,7 +293,7 @@ private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
293
293
else
294
294
{
295
295
notifyIcon1 . Visible = false ;
296
- PInvoke . UnregisterHotKey ( this . Handle , PLAY_HOTKEY_ID ) ;
296
+ NativeMethods . UnregisterHotKey ( this . Handle , PLAY_HOTKEY_ID ) ;
297
297
CloseWindow ( WindowType . None ) ;
298
298
}
299
299
@@ -401,7 +401,7 @@ private void timer1_Tick(object sender, EventArgs e)
401
401
bool fullScreen ;
402
402
if ( _settings . AutoPause3 )
403
403
{
404
- fullScreen = PInvoke . DS2_TestScreen ( _screen . WorkingArea . ToRECT ( ) ) == 0 ;
404
+ fullScreen = NativeMethods . DS2_TestScreen ( _screen . WorkingArea . ToRECT ( ) ) == 0 ;
405
405
if ( fullScreen )
406
406
{
407
407
if ( ( ( IPlayerControl ) _player ) . IsPlaying )
@@ -433,7 +433,7 @@ private void timer1_Tick(object sender, EventArgs e)
433
433
434
434
if ( _settings . AutoPause1 )
435
435
{
436
- bool val = PInvoke . DS2_GetLastInputTickCount ( ) < 500 ;
436
+ bool val = NativeMethods . DS2_GetLastInputTickCount ( ) < 500 ;
437
437
array_push ( _parr , val ? 1 : 0 ) ;
438
438
439
439
if ( array_is_max ( _parr ) )
@@ -464,7 +464,7 @@ private void timer1_Tick(object sender, EventArgs e)
464
464
private void contextMenuStrip1_Opening ( object sender , System . ComponentModel . CancelEventArgs e )
465
465
{
466
466
toolStripMenuItem12 . Checked = Helper . CheckStartOnBoot ( ) ;
467
- int val = PInvoke . DS2_IsVisibleDesktopIcons ( ) ;
467
+ int val = NativeMethods . DS2_IsVisibleDesktopIcons ( ) ;
468
468
toolStripMenuItem13 . Text = val != 0 ? "隐藏桌面图标" : "显示桌面图标" ;
469
469
}
470
470
@@ -577,7 +577,7 @@ private void toolStripMenuItem10_DropDownOpening(object sender, EventArgs e)
577
577
_screen = Screen . AllScreens [ _screenIndex ] ;
578
578
System . Drawing . Rectangle bounds = _screen . Bounds ;
579
579
580
- PInvoke . DS2_RefreshDesktop ( ) ;
580
+ NativeMethods . DS2_RefreshDesktop ( ) ;
581
581
582
582
if ( _player != null )
583
583
_player . SetPosition ( bounds ) ;
@@ -599,10 +599,10 @@ private void toolStripMenuItem16_DropDownOpening(object sender, EventArgs e)
599
599
foreach ( var val in _hWndSet )
600
600
{
601
601
IntPtr ptr = val ;
602
- bool b = PInvoke . IsWindowVisible ( ptr ) ;
602
+ bool b = NativeMethods . IsWindowVisible ( ptr ) ;
603
603
604
604
StringBuilder sb = new StringBuilder ( 128 ) ;
605
- PInvoke . GetWindowText ( ptr , sb , sb . Capacity ) ;
605
+ NativeMethods . GetWindowText ( ptr , sb , sb . Capacity ) ;
606
606
string title = sb . ToString ( ) ;
607
607
608
608
ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem ( title + ( b ? "" : " (Invalidate)" ) ) ;
@@ -677,7 +677,7 @@ private void toolStripMenuItem26_Click(object sender, EventArgs e)
677
677
678
678
private void toolStripMenuItem13_Click ( object sender , EventArgs e )
679
679
{
680
- PInvoke . DS2_ToggleShowDesktopIcons ( ) ;
680
+ NativeMethods . DS2_ToggleShowDesktopIcons ( ) ;
681
681
}
682
682
683
683
private void toolStripMenuItem27_Click ( object sender , EventArgs e )
@@ -688,7 +688,7 @@ private void toolStripMenuItem27_Click(object sender, EventArgs e)
688
688
if ( _settings . UseDesktopInteraction )
689
689
ForwardMessage ( ) ;
690
690
else
691
- PInvoke . DS2_EndForwardMouseKeyboardMessage ( ) ;
691
+ NativeMethods . DS2_EndForwardMouseKeyboardMessage ( ) ;
692
692
}
693
693
}
694
694
0 commit comments