Skip to content

Commit

Permalink
Initial push
Browse files Browse the repository at this point in the history
  • Loading branch information
gus33000 committed Jul 31, 2019
1 parent 75ddb31 commit 8cdb9a2
Show file tree
Hide file tree
Showing 46 changed files with 7,116 additions and 0 deletions.
44 changes: 44 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
MIT License

Copyright (c) 2019 LumiaWOA

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

_____________________________________________________________________________

Copyright (c) 2018 Konstantin Preißer, www.preisser-it.de


Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions TaskDialog/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2018 Konstantin Preißer, www.preisser-it.de


Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
56 changes: 56 additions & 0 deletions TaskDialog/TaskDialog.WindowSubclassHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;

namespace KPreisser.UI
{
public partial class TaskDialog
{
private class WindowSubclassHandler : UI.WindowSubclassHandler
{
private readonly TaskDialog _taskDialog;

private bool _processedShowWindowMessage;

public WindowSubclassHandler(TaskDialog taskDialog)
: base(taskDialog?._hwndDialog ?? throw new ArgumentNullException(nameof(taskDialog)))
{
_taskDialog = taskDialog;
}

protected override unsafe IntPtr WndProc(int msg, IntPtr wParam, IntPtr lParam)
{
switch (msg)
{
case TaskDialogNativeMethods.WM_WINDOWPOSCHANGED:
IntPtr result = base.WndProc(msg, wParam, lParam);

ref TaskDialogNativeMethods.WINDOWPOS windowPos =
ref *(TaskDialogNativeMethods.WINDOWPOS*)lParam;

if ((windowPos.flags & TaskDialogNativeMethods.WINDOWPOS_FLAGS.SWP_SHOWWINDOW) ==
TaskDialogNativeMethods.WINDOWPOS_FLAGS.SWP_SHOWWINDOW &&
!_processedShowWindowMessage)
{
_processedShowWindowMessage = true;

// The task dialog window has been shown for the first time.
_taskDialog.OnShown(EventArgs.Empty);
}

return result;

case ContinueButtonClickHandlingMessage:
// We received the message which we posted earlier when
// handling a TDN_BUTTON_CLICKED notification, so we should
// no longer ignore such notifications.
_taskDialog._ignoreButtonClickedNotifications = false;

// Do not forward the message to the base class.
return IntPtr.Zero;

default:
return base.WndProc(msg, wParam, lParam);
}
}
}
}
}
Loading

0 comments on commit 8cdb9a2

Please sign in to comment.