212 references to Interop
Microsoft.Win32.SystemEvents (212)
_generated\0\LibraryImports.g.cs (16)
66
public static partial int DispatchMessageW(ref global::
Interop
.User32.MSG msg)
70
fixed (global::
Interop
.User32.MSG* __msg_native = &msg)
78
static extern unsafe int __PInvoke(global::
Interop
.User32.MSG* __msg_native);
88
public static partial bool GetClassInfoW(nint hInst, string lpszClass, ref global::
Interop
.User32.WNDCLASS wc)
93
fixed (global::
Interop
.User32.WNDCLASS* __wc_native = &wc)
104
static extern unsafe int __PInvoke(nint __hInst_native, ushort* __lpszClass_native, global::
Interop
.User32.WNDCLASS* __wc_native);
114
public static partial int GetMessageW(ref global::
Interop
.User32.MSG msg, nint hwnd, int msgMin, int msgMax)
118
fixed (global::
Interop
.User32.MSG* __msg_native = &msg)
126
static extern unsafe int __PInvoke(global::
Interop
.User32.MSG* __msg_native, nint __hwnd_native, int __msgMin_native, int __msgMax_native);
251
public static partial short RegisterClassW(ref global::
Interop
.User32.WNDCLASS wc)
256
fixed (global::
Interop
.User32.WNDCLASS* __wc_native = &wc)
267
static extern unsafe short __PInvoke(global::
Interop
.User32.WNDCLASS* __wc_native);
347
public static partial bool TranslateMessage(ref global::
Interop
.User32.MSG msg)
352
fixed (global::
Interop
.User32.MSG* __msg_native = &msg)
362
static extern unsafe int __PInvoke(global::
Interop
.User32.MSG* __msg_native);
560
internal static partial bool SetConsoleCtrlHandler(global::
Interop
.Kernel32.ConsoleCtrlHandlerRoutine handler, bool addOrRemove)
Microsoft\Win32\SessionSwitchReason.cs (9)
17
ConsoleConnect =
Interop
.Wtsapi32.WTS_CONSOLE_CONNECT,
22
ConsoleDisconnect =
Interop
.Wtsapi32.WTS_CONSOLE_DISCONNECT,
27
RemoteConnect =
Interop
.Wtsapi32.WTS_REMOTE_CONNECT,
32
RemoteDisconnect =
Interop
.Wtsapi32.WTS_REMOTE_DISCONNECT,
37
SessionLogon =
Interop
.Wtsapi32.WTS_SESSION_LOGON,
42
SessionLogoff =
Interop
.Wtsapi32.WTS_SESSION_LOGOFF,
47
SessionLock =
Interop
.Wtsapi32.WTS_SESSION_LOCK,
52
SessionUnlock =
Interop
.Wtsapi32.WTS_SESSION_UNLOCK,
57
SessionRemoteControl =
Interop
.Wtsapi32.WTS_SESSION_REMOTE_CONTROL
Microsoft\Win32\SystemEvents.cs (186)
41
private
Interop
.User32.WndProc? _windowProc;
42
private
Interop
.Kernel32.ConsoleCtrlHandlerRoutine? _consoleHandler;
77
IntPtr hwinsta =
Interop
.User32.GetProcessWindowStation();
83
Interop
.User32.USEROBJECTFLAGS flags = default;
85
if (
Interop
.User32.GetUserObjectInformationW(hwinsta,
Interop
.User32.UOI_FLAGS, &flags, (uint)sizeof(
Interop
.User32.USEROBJECTFLAGS), ref dummy))
87
if ((flags.dwFlags &
Interop
.User32.WSF_VISIBLE) == 0)
356
case
Interop
.User32.CTRL_LOGOFF_EVENT:
357
OnSessionEnded((IntPtr)1, (IntPtr)
Interop
.User32.ENDSESSION_LOGOFF);
360
case
Interop
.User32.CTRL_SHUTDOWN_EVENT:
374
s_defWindowProc =
Interop
.Kernel32.GetProcAddress(
Interop
.Kernel32.GetModuleHandle("user32.dll"), "DefWindowProcW");
391
IntPtr timerId =
Interop
.User32.SendMessageW(s_systemEvents!._windowHandle,
392
Interop
.User32.WM_CREATETIMER, (IntPtr)interval, IntPtr.Zero);
408
Interop
.Wtsapi32.WTSUnRegisterSessionNotification(s_systemEvents!._windowHandle);
417
if (
Interop
.User32.IsWindow(handle) && DefWndProc != IntPtr.Zero)
426
Interop
.User32.SetWindowLongW(handle,
Interop
.User32.GWL_WNDPROC, DefWndProc);
427
Interop
.User32.SetClassLongW(handle,
Interop
.User32.GCL_WNDPROC, DefWndProc);
431
Interop
.User32.SetWindowLongPtrW(handle,
Interop
.User32.GWL_WNDPROC, DefWndProc);
432
Interop
.User32.SetClassLongPtrW(handle,
Interop
.User32.GCL_WNDPROC, DefWndProc);
436
if (
Interop
.User32.IsWindow(handle) && !
Interop
.User32.DestroyWindow(handle))
441
Interop
.User32.PostMessageW(handle,
Interop
.User32.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
445
IntPtr hInstance =
Interop
.Kernel32.GetModuleHandle(null);
446
Interop
.User32.UnregisterClassW(s_className!, hInstance);
452
Interop
.Kernel32.SetConsoleCtrlHandler(_consoleHandler, false);
507
IntPtr retval =
Interop
.Kernel32.LoadLibrary(
Interop
.Libraries.Wtsapi32);
511
Interop
.Wtsapi32.WTSRegisterSessionNotification(s_systemEvents!._windowHandle,
Interop
.Wtsapi32.NOTIFY_FOR_THIS_SESSION);
514
Interop
.Kernel32.FreeLibrary(retval);
523
if (msg ==
Interop
.User32.WM_SETTINGCHANGE)
537
case
Interop
.User32.SPI_SETACCESSTIMEOUT:
538
case
Interop
.User32.SPI_SETFILTERKEYS:
539
case
Interop
.User32.SPI_SETHIGHCONTRAST:
540
case
Interop
.User32.SPI_SETMOUSEKEYS:
541
case
Interop
.User32.SPI_SETSCREENREADER:
542
case
Interop
.User32.SPI_SETSERIALKEYS:
543
case
Interop
.User32.SPI_SETSHOWSOUNDS:
544
case
Interop
.User32.SPI_SETSOUNDSENTRY:
545
case
Interop
.User32.SPI_SETSTICKYKEYS:
546
case
Interop
.User32.SPI_SETTOGGLEKEYS:
550
case
Interop
.User32.SPI_SETDESKWALLPAPER:
551
case
Interop
.User32.SPI_SETFONTSMOOTHING:
552
case
Interop
.User32.SPI_SETCURSORS:
553
case
Interop
.User32.SPI_SETDESKPATTERN:
554
case
Interop
.User32.SPI_SETGRIDGRANULARITY:
555
case
Interop
.User32.SPI_SETWORKAREA:
559
case
Interop
.User32.SPI_ICONHORIZONTALSPACING:
560
case
Interop
.User32.SPI_ICONVERTICALSPACING:
561
case
Interop
.User32.SPI_SETICONMETRICS:
562
case
Interop
.User32.SPI_SETICONS:
563
case
Interop
.User32.SPI_SETICONTITLELOGFONT:
564
case
Interop
.User32.SPI_SETICONTITLEWRAP:
568
case
Interop
.User32.SPI_SETDOUBLECLICKTIME:
569
case
Interop
.User32.SPI_SETDOUBLECLKHEIGHT:
570
case
Interop
.User32.SPI_SETDOUBLECLKWIDTH:
571
case
Interop
.User32.SPI_SETMOUSE:
572
case
Interop
.User32.SPI_SETMOUSEBUTTONSWAP:
573
case
Interop
.User32.SPI_SETMOUSEHOVERHEIGHT:
574
case
Interop
.User32.SPI_SETMOUSEHOVERTIME:
575
case
Interop
.User32.SPI_SETMOUSESPEED:
576
case
Interop
.User32.SPI_SETMOUSETRAILS:
577
case
Interop
.User32.SPI_SETSNAPTODEFBUTTON:
578
case
Interop
.User32.SPI_SETWHEELSCROLLLINES:
579
case
Interop
.User32.SPI_SETCURSORSHADOW:
580
case
Interop
.User32.SPI_SETHOTTRACKING:
581
case
Interop
.User32.SPI_SETTOOLTIPANIMATION:
582
case
Interop
.User32.SPI_SETTOOLTIPFADE:
586
case
Interop
.User32.SPI_SETKEYBOARDDELAY:
587
case
Interop
.User32.SPI_SETKEYBOARDPREF:
588
case
Interop
.User32.SPI_SETKEYBOARDSPEED:
589
case
Interop
.User32.SPI_SETLANGTOGGLE:
593
case
Interop
.User32.SPI_SETMENUDROPALIGNMENT:
594
case
Interop
.User32.SPI_SETMENUFADE:
595
case
Interop
.User32.SPI_SETMENUSHOWDELAY:
596
case
Interop
.User32.SPI_SETMENUANIMATION:
597
case
Interop
.User32.SPI_SETSELECTIONFADE:
601
case
Interop
.User32.SPI_SETLOWPOWERACTIVE:
602
case
Interop
.User32.SPI_SETLOWPOWERTIMEOUT:
603
case
Interop
.User32.SPI_SETPOWEROFFACTIVE:
604
case
Interop
.User32.SPI_SETPOWEROFFTIMEOUT:
608
case
Interop
.User32.SPI_SETSCREENSAVEACTIVE:
609
case
Interop
.User32.SPI_SETSCREENSAVERRUNNING:
610
case
Interop
.User32.SPI_SETSCREENSAVETIMEOUT:
614
case
Interop
.User32.SPI_SETKEYBOARDCUES:
615
case
Interop
.User32.SPI_SETCOMBOBOXANIMATION:
616
case
Interop
.User32.SPI_SETLISTBOXSMOOTHSCROLLING:
617
case
Interop
.User32.SPI_SETGRADIENTCAPTIONS:
618
case
Interop
.User32.SPI_SETUIEFFECTS:
619
case
Interop
.User32.SPI_SETACTIVEWINDOWTRACKING:
620
case
Interop
.User32.SPI_SETACTIVEWNDTRKZORDER:
621
case
Interop
.User32.SPI_SETACTIVEWNDTRKTIMEOUT:
622
case
Interop
.User32.SPI_SETANIMATION:
623
case
Interop
.User32.SPI_SETBORDER:
624
case
Interop
.User32.SPI_SETCARETWIDTH:
625
case
Interop
.User32.SPI_SETDRAGFULLWINDOWS:
626
case
Interop
.User32.SPI_SETDRAGHEIGHT:
627
case
Interop
.User32.SPI_SETDRAGWIDTH:
628
case
Interop
.User32.SPI_SETFOREGROUNDFLASHCOUNT:
629
case
Interop
.User32.SPI_SETFOREGROUNDLOCKTIMEOUT:
630
case
Interop
.User32.SPI_SETMINIMIZEDMETRICS:
631
case
Interop
.User32.SPI_SETNONCLIENTMETRICS:
632
case
Interop
.User32.SPI_SETSHOWIMEUI:
638
else if (msg ==
Interop
.User32.WM_SYSCOLORCHANGE)
652
_consoleHandler = new
Interop
.Kernel32.ConsoleCtrlHandlerRoutine(ConsoleHandlerProc);
654
if (!
Interop
.Kernel32.SetConsoleCtrlHandler(_consoleHandler, true))
660
IntPtr hInstance =
Interop
.Kernel32.GetModuleHandle(null);
671
Interop
.User32.WNDCLASS windowClass = new
Interop
.User32.WNDCLASS
673
hbrBackground = (IntPtr)(
Interop
.User32.COLOR_WINDOW + 1),
679
if (
Interop
.User32.RegisterClassW(ref windowClass) == 0)
687
_windowHandle =
Interop
.User32.CreateWindowExW(
691
Interop
.User32.WS_POPUP,
758
int thread =
Interop
.User32.GetWindowThreadProcessId(s_systemEvents!._windowHandle, &pid);
759
Debug.Assert(s_windowThread == null || thread !=
Interop
.Kernel32.GetCurrentThreadId(), "Don't call MarshaledInvoke on the system events thread");
769
s_threadCallbackMessage =
Interop
.User32.RegisterWindowMessageW("SystemEventsThreadCallbackMessage");
782
Interop
.User32.PostMessageW(s_systemEvents!._windowHandle, s_threadCallbackMessage, IntPtr.Zero, IntPtr.Zero);
793
int res = (int)
Interop
.User32.SendMessageW(s_systemEvents._windowHandle,
794
Interop
.User32.WM_KILLTIMER, timerId, IntPtr.Zero);
809
IntPtr res =
Interop
.User32.SetTimer(_windowHandle, timerId, (int)wParam, IntPtr.Zero);
847
bool res =
Interop
.User32.KillTimer(_windowHandle, wParam);
860
case
Interop
.User32.PBT_APMSUSPEND:
861
case
Interop
.User32.PBT_APMSTANDBY:
865
case
Interop
.User32.PBT_APMRESUMECRITICAL:
866
case
Interop
.User32.PBT_APMRESUMESUSPEND:
867
case
Interop
.User32.PBT_APMRESUMESTANDBY:
871
case
Interop
.User32.PBT_APMBATTERYLOW:
872
case
Interop
.User32.PBT_APMPOWERSTATUSCHANGE:
873
case
Interop
.User32.PBT_APMOEMEVENT:
895
if (((unchecked((int)(long)lParam)) &
Interop
.User32.ENDSESSION_LOGOFF) != 0)
916
if ((((long)lParam) &
Interop
.User32.ENDSESSION_LOGOFF) != 0)
1078
case
Interop
.User32.WM_SETTINGCHANGE:
1089
Interop
.User32.PostMessageW(_windowHandle,
Interop
.User32.WM_REFLECT + msg, wParam, newStringPtr);
1091
case
Interop
.User32.WM_WTSSESSION_CHANGE:
1094
case
Interop
.User32.WM_SYSCOLORCHANGE:
1095
case
Interop
.User32.WM_COMPACTING:
1096
case
Interop
.User32.WM_DISPLAYCHANGE:
1097
case
Interop
.User32.WM_FONTCHANGE:
1098
case
Interop
.User32.WM_PALETTECHANGED:
1099
case
Interop
.User32.WM_TIMECHANGE:
1100
case
Interop
.User32.WM_TIMER:
1101
case
Interop
.User32.WM_THEMECHANGED:
1102
Interop
.User32.PostMessageW(_windowHandle,
Interop
.User32.WM_REFLECT + msg, wParam, lParam);
1105
case
Interop
.User32.WM_CREATETIMER:
1108
case
Interop
.User32.WM_KILLTIMER:
1111
case
Interop
.User32.WM_REFLECT +
Interop
.User32.WM_SETTINGCHANGE:
1114
OnUserPreferenceChanging(msg -
Interop
.User32.WM_REFLECT, wParam, lParam);
1115
OnUserPreferenceChanged(msg -
Interop
.User32.WM_REFLECT, wParam, lParam);
1133
case
Interop
.User32.WM_REFLECT +
Interop
.User32.WM_SYSCOLORCHANGE:
1134
OnUserPreferenceChanging(msg -
Interop
.User32.WM_REFLECT, wParam, lParam);
1135
OnUserPreferenceChanged(msg -
Interop
.User32.WM_REFLECT, wParam, lParam);
1138
case
Interop
.User32.WM_REFLECT +
Interop
.User32.WM_THEMECHANGED:
1142
case
Interop
.User32.WM_QUERYENDSESSION:
1145
case
Interop
.User32.WM_ENDSESSION:
1149
case
Interop
.User32.WM_POWERBROADCAST:
1154
case
Interop
.User32.WM_REFLECT +
Interop
.User32.WM_COMPACTING:
1158
case
Interop
.User32.WM_REFLECT +
Interop
.User32.WM_DISPLAYCHANGE:
1163
case
Interop
.User32.WM_REFLECT +
Interop
.User32.WM_FONTCHANGE:
1167
case
Interop
.User32.WM_REFLECT +
Interop
.User32.WM_PALETTECHANGED:
1171
case
Interop
.User32.WM_REFLECT +
Interop
.User32.WM_TIMECHANGE:
1175
case
Interop
.User32.WM_REFLECT +
Interop
.User32.WM_TIMER:
1179
case
Interop
.User32.WM_DESTROY:
1180
Interop
.User32.PostQuitMessage(0);
1194
return
Interop
.User32.DefWindowProcW(hWnd, msg, wParam, lParam);
1212
Interop
.User32.MSG msg = default;
1214
while (
Interop
.User32.GetMessageW(ref msg, _windowHandle, 0, 0) > 0)
1216
Interop
.User32.TranslateMessage(ref msg);
1217
Interop
.User32.DispatchMessageW(ref msg);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs (1)
19
return
Interop
.Kernel32.FreeLibrary(handle);