aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/VSIX
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-20 20:10:28 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-20 20:10:28 +0300
commite6c909c6d72d827175f75f77b2b7ed0f3a6feb71 (patch)
treedaa8412eeb63dc20c1b2c31d5de7e335a0d571c0 /Software/Visual_Studio/VSIX
parent7c0f64ad7bc21f1a703c4aa8f77cdde999b13896 (diff)
downloadTango-e6c909c6d72d827175f75f77b2b7ed0f3a6feb71.tar.gz
Tango-e6c909c6d72d827175f75f77b2b7ed0f3a6feb71.zip
Working on PPC.
Added some fields to DB Job. Added Customers Table.
Diffstat (limited to 'Software/Visual_Studio/VSIX')
-rw-r--r--Software/Visual_Studio/VSIX/Tango.BuildExtensions/WindowInfo.cs31
1 files changed, 27 insertions, 4 deletions
diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/WindowInfo.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/WindowInfo.cs
index 535ee7ce1..f9681ea31 100644
--- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/WindowInfo.cs
+++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/WindowInfo.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
@@ -27,6 +28,19 @@ namespace Tango.BuildExtensions
[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
+ [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
+ static extern IntPtr SendMessageTimeout(IntPtr windowHandle, uint Msg, IntPtr wParam, IntPtr lParam, SendMessageTimeoutFlags flags, uint timeout, out IntPtr result);
+
+ [Flags]
+ enum SendMessageTimeoutFlags : uint
+ {
+ SMTO_NORMAL = 0x0,
+ SMTO_BLOCK = 0x1,
+ SMTO_ABORTIFHUNG = 0x2,
+ SMTO_NOTIMEOUTIFNOTHUNG = 0x8,
+ SMTO_ERRORONEXIT = 0x20
+ }
+
private static List<IntPtr> GetAllChildrenHandles(IntPtr hParent, int maxCount)
{
List<IntPtr> result = new List<IntPtr>();
@@ -35,6 +49,7 @@ namespace Tango.BuildExtensions
IntPtr currChild = IntPtr.Zero;
while (true && ct < maxCount)
{
+ Debug.WriteLine("FindWindowEx: " + hParent);
currChild = FindWindowEx(hParent, prevChild, null, null);
if (currChild == IntPtr.Zero) break;
result.Add(currChild);
@@ -48,9 +63,9 @@ namespace Tango.BuildExtensions
{
// helper for GetCaptionText
uint WM_GETTEXTLENGTH = 0x000E;
- int result = SendMessage(hTextBox, WM_GETTEXTLENGTH,
- 0, 0);
- return result;
+ IntPtr result = IntPtr.Zero;
+ SendMessageTimeout(hTextBox, WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero, SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out result);
+ return (int)result;
}
private static string GetCaptionText(IntPtr hTextBox)
@@ -102,7 +117,14 @@ namespace Tango.BuildExtensions
desktop.Parent = null;
windows.Add(desktop);
- FillWindows(desktop, desktop.Children);
+ try
+ {
+ FillWindows(desktop, desktop.Children);
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine(ex.ToString());
+ }
return windows;
}
@@ -140,6 +162,7 @@ namespace Tango.BuildExtensions
if (child.Caption != null)
{
+ Debug.WriteLine(parent.Caption + " | " + child.Caption);
windows.Add(child);
}