]> git.saurik.com Git - wxWidgets.git/commitdiff
Enable the HWND of the task dialog to be fetched with GetHandle if it is being used.
authorRobin Dunn <robin@alldunn.com>
Sat, 10 Sep 2011 03:26:37 +0000 (03:26 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 10 Sep 2011 03:26:37 +0000 (03:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69041 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/progdlg.h
src/msw/progdlg.cpp

index 8102c9fdf13955e4a2cdbed5ec4fadd05b20d9d7..459002410f2c5199c5411915b6d55a4fcc8011d4 100644 (file)
@@ -47,6 +47,8 @@ public:
     // Must provide overload to avoid hiding it (and warnings about it)
     virtual void Update() { wxGenericProgressDialog::Update(); }
 
+    virtual WXWidget GetHandle() const;
+
 private:
     // Performs common routines to Update() and Pulse(). Requires the
     // shared object to have been entered.
index a39706ed2994d15e1e43701460acd46dbecea7a6..09cba141b7bb22f23516435bc48c0c91019e3878 100644 (file)
@@ -518,6 +518,23 @@ void wxProgressDialog::Resume()
 #endif // wxHAS_MSW_TASKDIALOG
 }
 
+WXWidget wxProgressDialog::GetHandle() const 
+{ 
+#ifdef wxHAS_MSW_TASKDIALOG
+    if ( HasNativeTaskDialog() )
+    {
+        HWND hwnd;
+        {
+            wxCriticalSectionLocker locker(m_sharedData->m_cs);
+            m_sharedData->m_state = m_state;
+            hwnd = m_sharedData->m_hwnd;
+        }
+        return hwnd;
+    }
+#endif
+    return wxGenericProgressDialog::GetHandle();
+}
+
 int wxProgressDialog::GetValue() const
 {
 #ifdef wxHAS_MSW_TASKDIALOG