Skip to content

Commit c01d197

Browse files
committed
Update to 2.1
1 parent 54dbe26 commit c01d197

File tree

5 files changed

+53
-5
lines changed

5 files changed

+53
-5
lines changed

SharpShell/SharedAssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Shared Assembly Information for all projects in SharpShell.
66
[assembly: AssemblyCompany("Dave Kerr")]
77
[assembly: AssemblyProduct("SharpShell")]
8-
[assembly: AssemblyCopyright("Copyright © Dave Kerr 2013")]
8+
[assembly: AssemblyCopyright("Copyright © Dave Kerr 2014")]
99

1010
// Version information for an assembly consists of the following four values:
1111
//
@@ -17,5 +17,5 @@
1717
// You can specify all the values or you can default the Build and Revision Numbers
1818
// by using the '*' as shown below:
1919
// [assembly: AssemblyVersion("1.0.*")]
20-
[assembly: AssemblyVersion("2.0.0.0")]
21-
[assembly: AssemblyFileVersion("2.0.0.0")]
20+
[assembly: AssemblyVersion("2.1.0.0")]
21+
[assembly: AssemblyFileVersion("2.1.0.0")]

SharpShell/SharpShell/Interop/IInputObject.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface IInputObject
1919
/// <param name="msg">A pointer to an MSG structure that contains the message that caused the activation change. This value may be NULL.</param>
2020
/// <returns>If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.</returns>
2121
[PreserveSig]
22-
int UIActivateIO(int fActivate, ref MSG msg);
22+
int UIActivateIO(bool fActivate, ref MSG msg);
2323

2424
/// <summary>
2525
/// Determines if one of the object's windows has the keyboard focus.
Binary file not shown.

SharpShell/SharpShell/SharpDeskBand/SharpDeskBand.cs

+46-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace SharpShell.SharpDeskBand
1010
{
1111
[ServerType(ServerType.ShellDeskBand)]
12-
public abstract class SharpDeskBand : SharpShellServer, IDeskBand2, IPersistStream, IObjectWithSite
12+
public abstract class SharpDeskBand : SharpShellServer, IDeskBand2, IPersistStream, IObjectWithSite, IInputObject
1313
{
1414
protected SharpDeskBand()
1515
{
@@ -372,6 +372,51 @@ int IDeskBand2.GetCompositionState(out bool pfCompositionEnabled)
372372

373373
#endregion
374374

375+
#region Implementation of IInputObject
376+
377+
/// <summary>
378+
/// UI-activates or deactivates the object.
379+
/// </summary>
380+
/// <param name="fActivate">Indicates if the object is being activated or deactivated. If this value is nonzero, the object is being activated. If this value is zero, the object is being deactivated.</param>
381+
/// <param name="msg">A pointer to an MSG structure that contains the message that caused the activation change. This value may be NULL.</param>
382+
/// <returns>
383+
/// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
384+
/// </returns>
385+
int IInputObject.UIActivateIO(bool fActivate, ref MSG msg)
386+
{
387+
// Set the focus to the UI if requested.
388+
if (fActivate)
389+
lazyDeskBand.Value.Focus();
390+
391+
// We're done.
392+
return WinError.S_OK;
393+
}
394+
395+
/// <summary>
396+
/// Determines if one of the object's windows has the keyboard focus.
397+
/// </summary>
398+
/// <returns>
399+
/// Returns S_OK if one of the object's windows has the keyboard focus, or S_FALSE otherwise.
400+
/// </returns>
401+
int IInputObject.HasFocusIO()
402+
{
403+
return lazyDeskBand.Value.ContainsFocus ? WinError.S_OK : WinError.S_FALSE;
404+
}
405+
406+
/// <summary>
407+
/// Enables the object to process keyboard accelerators.
408+
/// </summary>
409+
/// <param name="msg">The address of an MSG structure that contains the keyboard message that is being translated.</param>
410+
/// <returns>
411+
/// Returns S_OK if the accelerator was translated, or S_FALSE otherwise.
412+
/// </returns>
413+
int IInputObject.TranslateAcceleratorIO(ref MSG msg)
414+
{
415+
return WinError.S_OK;
416+
}
417+
418+
#endregion
419+
375420
#region Custom Registration and Unregistration
376421

377422
/// <summary>

SharpShell/SharpShell/SharpShell.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<WarningLevel>4</WarningLevel>
3333
<PlatformTarget>AnyCPU</PlatformTarget>
3434
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
35+
<DocumentationFile>
36+
</DocumentationFile>
3537
</PropertyGroup>
3638
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3739
<DebugType>pdbonly</DebugType>
@@ -41,6 +43,7 @@
4143
<ErrorReport>prompt</ErrorReport>
4244
<WarningLevel>4</WarningLevel>
4345
<DocumentationFile>bin\Release\SharpShell.xml</DocumentationFile>
46+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4447
</PropertyGroup>
4548
<PropertyGroup>
4649
<SignAssembly>true</SignAssembly>

0 commit comments

Comments
 (0)