159 references to IMsoComponent
System.Windows.Forms (26)
System\Windows\Forms\Application.ComponentManager.cs (8)
27
public AgileComPointer<
IMsoComponent
> component;
33
private AgileComPointer<
IMsoComponent
>? _activeComponent;
34
private AgileComPointer<
IMsoComponent
>? _trackingComponent;
62
IMsoComponent
* component,
218
AgileComPointer<
IMsoComponent
>? prevActive = _activeComponent;
223
AgileComPointer<
IMsoComponent
>? requestingComponent = entry.component;
354
IMsoComponent
** ppic,
358
AgileComPointer<
IMsoComponent
>? component = dwgac switch
System\Windows\Forms\Application.ComponentThreadContext.cs (17)
15
/// <see cref="ThreadContext"/> that supports <see cref="
IMsoComponent
"/>.
19
IMsoComponent
.Interface,
20
IManagedWrapper<
IMsoComponent
>
140
bool result = _componentManager.FRegisterComponent(ComHelpers.GetComPointer<
IMsoComponent
>(this), &info, &id);
243
using ComScope<
IMsoComponent
> component = new(null);
356
BOOL
IMsoComponent
.Interface.FDebugMessage(nint hInst, uint msg, WPARAM wparam, LPARAM lparam)
359
BOOL
IMsoComponent
.Interface.FPreTranslateMessage(MSG* msg)
362
void
IMsoComponent
.Interface.OnEnterState(msocstate uStateID, BOOL fEnter)
384
void
IMsoComponent
.Interface.OnAppActivate(BOOL fActive, uint dwOtherThreadID)
388
void
IMsoComponent
.Interface.OnLoseActivation()
392
void
IMsoComponent
.Interface.OnActivationChange(
393
IMsoComponent
* component,
402
BOOL
IMsoComponent
.Interface.FDoIdle(msoidlef grfidlef)
408
BOOL
IMsoComponent
.Interface.FContinueMessageLoop(
466
BOOL
IMsoComponent
.Interface.FQueryTerminate(BOOL fPromptUser) => true;
468
void
IMsoComponent
.Interface.Terminate()
478
HWND
IMsoComponent
.Interface.HwndGetWindow(msocWindow dwWhich, uint dwReserved) => HWND.Null;
System\Windows\Forms\Application.LightThreadContext.cs (1)
11
/// Lighter weight <see cref="ThreadContext"/> that doesn't support <see cref="
IMsoComponent
"/>.
System.Windows.Forms.Primitives (94)
Microsoft\Office\IMsoComponent.cs (73)
12
internal unsafe struct IMsoComponent : IComIID, IVTable<
IMsoComponent
,
IMsoComponent
.Vtbl>
14
static void IVTable<
IMsoComponent
, Vtbl>.PopulateVTable(Vtbl* vtable)
32
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, Guid*, void**, HRESULT> QueryInterface_1;
33
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, uint> AddRef_2;
34
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, uint> Release_3;
35
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, nint, uint, WPARAM, LPARAM, BOOL> FDebugMessage_4;
36
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, MSG*, BOOL> FPreTranslateMessage_5;
37
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, msocstate, BOOL, void> OnEnterState_6;
38
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, BOOL, uint, void> OnAppActivate_7;
39
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, void> OnLoseActivation_8;
40
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*,
IMsoComponent
*, BOOL, MSOCRINFO*, BOOL, nint, uint, void> OnActivationChange_9;
41
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, msoidlef, BOOL> FDoIdle_10;
42
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, msoloop, void*, MSG*, BOOL> FContinueMessageLoop_11;
43
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, BOOL, BOOL> FQueryTerminate_12;
44
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, void> Terminate_13;
45
internal delegate* unmanaged[Stdcall]<
IMsoComponent
*, msocWindow, uint, HWND> HwndGetWindow_14;
50
private static BOOL FDebugMessage(
IMsoComponent
* @this, nint hInst, uint msg, WPARAM wParam, LPARAM lParam)
51
=> UnwrapAndInvoke<
IMsoComponent
, Interface, BOOL>(@this, o => o.FDebugMessage(hInst, msg, wParam, lParam));
54
private static BOOL FPreTranslateMessage(
IMsoComponent
* @this, MSG* msg)
55
=> UnwrapAndInvoke<
IMsoComponent
, Interface, BOOL>(@this, o => o.FPreTranslateMessage(msg));
58
private static void OnEnterState(
IMsoComponent
* @this, msocstate uStateID, BOOL fEnter)
59
=> UnwrapAndInvoke<
IMsoComponent
, Interface>(@this, o => o.OnEnterState(uStateID, fEnter));
62
private static void OnAppActivate(
IMsoComponent
* @this, BOOL fActive, uint dwOtherThreadID)
63
=> UnwrapAndInvoke<
IMsoComponent
, Interface>(@this, o => o.OnAppActivate(fActive, dwOtherThreadID));
66
private static void OnLoseActivation(
IMsoComponent
* @this)
67
=> UnwrapAndInvoke<
IMsoComponent
, Interface>(@this, o => o.OnLoseActivation());
71
IMsoComponent
* @this,
72
IMsoComponent
* pic,
78
=> UnwrapAndInvoke<
IMsoComponent
, Interface>(
83
private static BOOL FDoIdle(
IMsoComponent
* @this, msoidlef grfidlef)
84
=> UnwrapAndInvoke<
IMsoComponent
, Interface, BOOL>(@this, o => o.FDoIdle(grfidlef));
87
private static BOOL FContinueMessageLoop(
IMsoComponent
* @this, msoloop uReason, void* pvLoopData, MSG* pMsgPeeked)
88
=> UnwrapAndInvoke<
IMsoComponent
, Interface, BOOL>(@this, o => o.FContinueMessageLoop(uReason, pvLoopData, pMsgPeeked));
91
private static BOOL FQueryTerminate(
IMsoComponent
* @this, BOOL fPromptUser)
92
=> UnwrapAndInvoke<
IMsoComponent
, Interface, BOOL>(@this, o => o.FQueryTerminate(fPromptUser));
95
private static void Terminate(
IMsoComponent
* @this)
96
=> UnwrapAndInvoke<
IMsoComponent
, Interface>(@this, o => o.Terminate());
99
private static HWND HwndGetWindow(
IMsoComponent
* @this, msocWindow dwWhich, uint dwReserved)
100
=> UnwrapAndInvoke<
IMsoComponent
, Interface, HWND>(@this, o => o.HwndGetWindow(dwWhich, dwReserved));
127
fixed (
IMsoComponent
* pThis = &this)
128
return ((delegate* unmanaged[Stdcall]<
IMsoComponent
*, Guid*, void**, HRESULT>)_lpVtbl[0])(pThis, riid, ppvObject);
134
fixed (
IMsoComponent
* pThis = &this)
135
return ((delegate* unmanaged[Stdcall]<
IMsoComponent
*, uint>)_lpVtbl[1])(pThis);
141
fixed (
IMsoComponent
* pThis = &this)
142
return ((delegate* unmanaged[Stdcall]<
IMsoComponent
*, uint>)_lpVtbl[2])(pThis);
148
fixed (
IMsoComponent
* pThis = &this)
149
return ((delegate* unmanaged[Stdcall]<
IMsoComponent
*, nint, uint, WPARAM, LPARAM, BOOL>)_lpVtbl[3])(
156
fixed (
IMsoComponent
* pThis = &this)
157
return ((delegate* unmanaged[Stdcall]<
IMsoComponent
*, MSG*, BOOL>)_lpVtbl[4])(pThis, msg);
163
fixed (
IMsoComponent
* pThis = &this)
164
((delegate* unmanaged[Stdcall]<
IMsoComponent
*, msocstate, BOOL, void>)_lpVtbl[5])(pThis, uStateID, fEnter);
170
fixed (
IMsoComponent
* pThis = &this)
171
((delegate* unmanaged[Stdcall]<
IMsoComponent
*, BOOL, uint, void>)_lpVtbl[6])(pThis, fActive, dwOtherThreadID);
177
fixed (
IMsoComponent
* pThis = &this)
178
((delegate* unmanaged[Stdcall]<
IMsoComponent
*, void>)_lpVtbl[7])(pThis);
181
/// <inheritdoc cref="Interface.OnActivationChange(
IMsoComponent
*, BOOL, MSOCRINFO*, BOOL, nint, uint)"/>
182
public void OnActivationChange(
IMsoComponent
* pic, BOOL fSameComponent, MSOCRINFO* pcrinfo, BOOL fHostIsActivating, nint pchostinfo, uint dwReserved)
184
fixed (
IMsoComponent
* pThis = &this)
185
((delegate* unmanaged[Stdcall]<
IMsoComponent
*,
IMsoComponent
*, BOOL, MSOCRINFO*, BOOL, nint, uint, void>)_lpVtbl[8])
192
fixed (
IMsoComponent
* pThis = &this)
193
return ((delegate* unmanaged[Stdcall]<
IMsoComponent
*, msoidlef, BOOL>)_lpVtbl[9])(pThis, grfidlef);
199
fixed (
IMsoComponent
* pThis = &this)
200
return ((delegate* unmanaged[Stdcall]<
IMsoComponent
*, msoloop, void*, MSG*, BOOL>)_lpVtbl[10])
207
fixed (
IMsoComponent
* pThis = &this)
208
return ((delegate* unmanaged[Stdcall]<
IMsoComponent
*, BOOL, BOOL>)_lpVtbl[11])(pThis, fPromptUser);
214
fixed (
IMsoComponent
* pThis = &this)
215
((delegate* unmanaged[Stdcall]<
IMsoComponent
*, void>)_lpVtbl[12])(pThis);
221
fixed (
IMsoComponent
* pThis = &this)
222
return ((delegate* unmanaged[Stdcall]<
IMsoComponent
*, msocWindow, uint, HWND>)_lpVtbl[13])(pThis, dwWhich, dwReserved);
384
IMsoComponent
* pic,
Microsoft\Office\IMsoComponentManager.cs (17)
73
/// <inheritdoc cref="Interface.FRegisterComponent(
IMsoComponent
*, MSOCRINFO*, nuint*)"/>
74
public BOOL FRegisterComponent(
IMsoComponent
* piComponent, MSOCRINFO* pcrinfo, nuint* dwComponentID)
77
return ((delegate* unmanaged[Stdcall]<IMsoComponentManager*,
IMsoComponent
*, MSOCRINFO*, nuint*, BOOL>)_lpVtbl[5])
179
/// <inheritdoc cref="Interface.FGetActiveComponent(msogac,
IMsoComponent
**, MSOCRINFO*, uint)"/>
180
public BOOL FGetActiveComponent(msogac dwgac,
IMsoComponent
** ppic, MSOCRINFO* pcrinfo, uint dwReserved)
183
return ((delegate* unmanaged[Stdcall]<IMsoComponentManager*, msogac,
IMsoComponent
**, MSOCRINFO*, uint, BOOL>)_lpVtbl[17])
261
IMsoComponent
* piComponent,
297
/// (via <see cref="
IMsoComponent
.FPreTranslateMessage(MSG*)"/> and typically gets first chance
318
/// (via <see cref="
IMsoComponent
.FPreTranslateMessage(MSG*)"/>) rather than to the active component.
324
/// than give the tracking component idle time via <see cref="
IMsoComponent
.FDoIdle(msoidlef)"/>.
351
/// <see cref="
IMsoComponent
.OnEnterState(msocstate, BOOL)"/> (see "Comments on State Contexts" in
406
/// via <see cref="
IMsoComponent
.OnEnterState(msocstate, BOOL)"/> (see "Comments on State Contexts", above).
445
/// Called periodically by a component during <see cref="
IMsoComponent
.FDoIdle(msoidlef)"/>.
461
/// <see cref="
IMsoComponent
.FContinueMessageLoop(msoloop, void*, MSG*)"/> during each loop iteration.
462
/// When <see cref="
IMsoComponent
.FContinueMessageLoop(msoloop, void*, MSG*)"/> returns <see cref="BOOL.FALSE"/>,
469
/// to (by returning <see cref="BOOL.FALSE"/> from <see cref="
IMsoComponent
.FContinueMessageLoop(msoloop, void*, MSG*)"/>),
532
IMsoComponent
** ppic,
Microsoft\Office\IMsoComponentManager.NativeAdapter.cs (2)
34
BOOL Interface.FRegisterComponent(
IMsoComponent
* piComponent, MSOCRINFO* pcrinfo, nuint* dwComponentID)
117
BOOL Interface.FGetActiveComponent(msogac dwgac,
IMsoComponent
** ppic, MSOCRINFO* pcrinfo, uint dwReserved)
Microsoft\Office\msocstate.cs (1)
7
/// State IDs passed to <see cref="
IMsoComponent
.OnEnterState(msocstate, BOOL)" /> and
Microsoft\Office\msoloop.cs (1)
8
/// The host should remain in message loop until <see cref="
IMsoComponent
.FContinueMessageLoop(msoloop, void*, MSG*)" />
System.Windows.Forms.Tests (39)
System\Windows\Forms\Application.ComponentManagerTests.cs (39)
44
Mock<
IMsoComponent
.Interface> mock = new(MockBehavior.Strict);
45
using var component = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock.Object));
58
Mock<
IMsoComponent
.Interface> mock = new(MockBehavior.Strict);
59
using var component = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock.Object));
71
Mock<
IMsoComponent
.Interface> mock = new(MockBehavior.Strict);
72
using var component = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock.Object));
91
Mock<
IMsoComponent
.Interface> mock = new(MockBehavior.Strict);
92
using var component = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock.Object));
107
Mock<
IMsoComponent
.Interface> mock = new(MockBehavior.Strict);
108
using var component = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock.Object));
121
Mock<
IMsoComponent
.Interface> mock = new(MockBehavior.Strict);
122
using var component = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock.Object));
152
Mock<
IMsoComponent
.Interface> mock = new(MockBehavior.Strict);
153
using var component = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock.Object));
183
Mock<
IMsoComponent
.Interface> mock = new(MockBehavior.Strict);
184
using var component = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(new MockWrapper(mock.Object)));
214
Mock<
IMsoComponent
.Interface> mock = new(MockBehavior.Strict);
215
using var component = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock.Object));
297
Mock<
IMsoComponent
.Interface> mock1 = new(MockBehavior.Strict);
298
using var component1 = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock1.Object));
300
Mock<
IMsoComponent
.Interface> mock2 = new(MockBehavior.Strict);
301
using var component2 = ComHelpers.GetComScope<
IMsoComponent
>(new MockWrapper(mock2.Object));
336
using ComScope<
IMsoComponent
> component = new(null);
342
private class MockWrapper :
IMsoComponent
.Interface, IManagedWrapper<
IMsoComponent
>
344
private readonly
IMsoComponent
.Interface _mock;
345
public MockWrapper(
IMsoComponent
.Interface mock) => _mock = mock;
347
BOOL
IMsoComponent
.Interface.FDebugMessage(nint hInst, uint msg, WPARAM wParam, LPARAM lParam)
350
BOOL
IMsoComponent
.Interface.FPreTranslateMessage(MSG* msg)
353
void
IMsoComponent
.Interface.OnEnterState(msocstate uStateID, BOOL fEnter)
356
void
IMsoComponent
.Interface.OnAppActivate(BOOL fActive, uint dwOtherThreadID)
359
void
IMsoComponent
.Interface.OnLoseActivation() => _mock.OnLoseActivation();
361
void
IMsoComponent
.Interface.OnActivationChange(
362
IMsoComponent
* pic,
369
BOOL
IMsoComponent
.Interface.FDoIdle(msoidlef grfidlef) => _mock.FDoIdle(grfidlef);
371
BOOL
IMsoComponent
.Interface.FContinueMessageLoop(
376
BOOL
IMsoComponent
.Interface.FQueryTerminate(BOOL fPromptUser) => _mock.FQueryTerminate(fPromptUser);
378
void
IMsoComponent
.Interface.Terminate() => _mock.Terminate();
380
HWND
IMsoComponent
.Interface.HwndGetWindow(msocWindow uWhich, uint dwReserved)