- taskmanagersimple.zip
- TaskManagerSimple
- taskmanager.zip
- TaskManager
- Core
- AppRestartRecovery
- Core.csproj
- Dialogs
- Common
- TaskDialogs
- Interop
- NetworkList
- PowerManagement
- Properties
- PropertySystem
- SafeHandles
- Shell
- Common
- CommonFileDialogs
- Controls
- Design
- ShellObjects.cd
- ShellThumbnailClassDiagram.cd
- DesktopWindowManager
- ExplorerBrowser
- Interop
- Common
- Dialogs
- ExplorerBrowser
- KnownFolders
- PropertySystem
- StockIcons
- Taskbar
- KnownFolders
- Properties
- PropertySystem
- Shell.csproj
- StockIcons
- Taskbar
- TaskManager.sln
- TaskManager
|
//Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using Microsoft.WindowsAPICodePack.Taskbar;
using MS.WindowsAPICodePack.Internal;
namespace Microsoft.WindowsAPICodePack.Shell
{
internal static class WindowUtilities
{
internal static System.Drawing.Point GetParentOffsetOfChild(IntPtr hwnd, IntPtr hwndParent)
{
var childScreenCoord = new CoreNativeMethods.POINT(0, 0);
TabbedThumbnailNativeMethods.ClientToScreen(
hwnd, ref childScreenCoord);
var parentScreenCoord = new CoreNativeMethods.POINT(0, 0);
TabbedThumbnailNativeMethods.ClientToScreen(
hwndParent, ref parentScreenCoord);
System.Drawing.Point offset = new System.Drawing.Point(
childScreenCoord.X - parentScreenCoord.X,
childScreenCoord.Y - parentScreenCoord.Y);
return offset;
}
internal static System.Drawing.Size GetNonClientArea(IntPtr hwnd)
{
var c = new CoreNativeMethods.POINT(0, 0);
TabbedThumbnailNativeMethods.ClientToScreen(hwnd, ref c);
var r = new CoreNativeMethods.RECT();
TabbedThumbnailNativeMethods.GetWindowRect(hwnd, ref r);
return new System.Drawing.Size(c.X - r.left, c.Y - r.top);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.