[User32]
[reactos.git] / reactos / dll / win32 / user32 / controls / icontitle.c
index 465a1a4..6daf27e 100644 (file)
 
 #include <wine/debug.h>
 
-#ifdef __REACTOS__
-#define MAKEINTATOMW(atom)  ((LPCWSTR)((ULONG_PTR)((WORD)(atom))))
-#define ICONTITLE_CLASS_ATOM MAKEINTATOMW(32772)
-#endif
-
 static BOOL bMultiLineTitle;
 static HFONT hIconTitleFont;
 
@@ -35,13 +30,13 @@ static HFONT hIconTitleFont;
  */
 const struct builtin_class_descr ICONTITLE_builtin_class =
 {
-    (LPCWSTR)ICONTITLE_CLASS_ATOM, /* name */
-    0,                    /* style */
-    NULL,                 /* procA (winproc is Unicode only) */
-    IconTitleWndProc,     /* procW */
-    0,                    /* extra */
-    IDC_ARROW,            /* cursor */
-    0                     /* brush */
+    WC_ICONTITLE,     /* name */
+    0,                /* style */
+    NULL,             /* procA (winproc is Unicode only) */
+    IconTitleWndProc, /* procW */
+    0,                /* extra */
+    IDC_ARROW,        /* cursor */
+    0                 /* brush */
 };
 
 
@@ -194,6 +189,18 @@ LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg,
     HWND owner = GetWindow( hWnd, GW_OWNER );
 
     if (!IsWindow(hWnd)) return 0;
+#ifdef __REACTOS__ // Do this now, remove after Server side is fixed.
+    PWND pWnd;
+
+    pWnd = ValidateHwnd(hWnd);
+    if (pWnd)
+    {
+       if (!pWnd->fnid)
+       {
+          NtUserSetWindowFNID(hWnd, FNID_ICONTITLE);
+       }
+    }    
+#endif    
 
     switch( msg )
     {
@@ -206,6 +213,11 @@ LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg,
                 hIconTitleFont = CreateFontIndirectA( &logFont );
             }
             return (hIconTitleFont ? 0 : -1);
+#ifdef __REACTOS__
+        case WM_DESTROY:
+          NtUserSetWindowFNID(hWnd, FNID_DESTROY);
+          break;
+#endif
        case WM_NCHITTEST:
             return HTCAPTION;
        case WM_NCMOUSEMOVE: