* -- ICC_WIN95_CLASSES
*/
-#include "comctl32.h"
-
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "commctrl.h"
+#include "winerror.h"
+#include "winreg.h"
#define NO_SHLWAPI_STREAM
-#include <shlwapi.h>
+#include "shlwapi.h"
+#include "comctl32.h"
+#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
return pwszBuf;
}
-static BOOL create_manifest(BOOL install, BOOL bV6)
-{
- WCHAR *pwszBuf;
- HRSRC hResInfo;
- HGLOBAL hResData;
- PVOID pManifest;
- DWORD cbManifest, cbWritten;
- HANDLE hFile;
- BOOL bRet = FALSE;
-
- if (bV6)
- hResInfo = FindResourceW(COMCTL32_hModule, L"WINE_MANIFEST", (LPWSTR)RT_MANIFEST);
- else
- hResInfo = FindResourceW(COMCTL32_hModule, L"WINE_MANIFESTV5", (LPWSTR)RT_MANIFEST);
-
- if (!hResInfo)
- return FALSE;
-
- cbManifest = SizeofResource(COMCTL32_hModule, hResInfo);
- if (!cbManifest)
- return FALSE;
-
- hResData = LoadResource(COMCTL32_hModule, hResInfo);
- if (!hResData)
- return FALSE;
-
- pManifest = LockResource(hResData);
- if (!pManifest)
- return FALSE;
-
- pwszBuf = GetManifestPath(TRUE, bV6);
- if (!pwszBuf)
- return FALSE;
-
- if (install)
- {
- hFile = CreateFileW(pwszBuf, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
- if (hFile != INVALID_HANDLE_VALUE)
- {
- if (WriteFile(hFile, pManifest, cbManifest, &cbWritten, NULL) && cbWritten == cbManifest)
- bRet = TRUE;
-
- CloseHandle(hFile);
-
- if (!bRet)
- DeleteFileW(pwszBuf);
- else
- TRACE("created %s\n", debugstr_w(pwszBuf));
- }
- }
- else
- bRet = DeleteFileW(pwszBuf);
-
- HeapFree(GetProcessHeap(), 0, pwszBuf);
-
- return bRet;
-}
-
static HANDLE CreateComctl32ActCtx(BOOL bV6)
{
HANDLE ret;
}
else
{
- BUTTON_Register();
+ BUTTON_Register ();
+ COMBO_Register ();
+ COMBOLBOX_Register ();
+ EDIT_Register ();
+ LISTBOX_Register ();
+ STATIC_Register ();
+
TOOLBARv6_Register();
}
}
else
{
BUTTON_Unregister();
+ COMBO_Unregister ();
+ COMBOLBOX_Unregister ();
+ EDIT_Unregister ();
+ LISTBOX_Unregister ();
+ STATIC_Unregister ();
+
TOOLBARv6_Unregister ();
}
return TRUE;
}
+#endif /* __REACTOS__ */
+
+#ifndef __REACTOS__
+static void unregister_versioned_classes(void)
+{
+#define VERSION "6.0.2600.2982!"
+ static const char *classes[] =
+ {
+ VERSION WC_BUTTONA,
+ VERSION WC_COMBOBOXA,
+ VERSION "ComboLBox",
+ VERSION WC_EDITA,
+ VERSION WC_LISTBOXA,
+ VERSION WC_STATICA,
+ };
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(classes); i++)
+ UnregisterClassA(classes[i], NULL);
+
+#undef VERSION
+}
#endif
/***********************************************************************
TREEVIEW_Register ();
UPDOWN_Register ();
+ BUTTON_Register ();
+ COMBO_Register ();
+ COMBOLBOX_Register ();
+ EDIT_Register ();
+ LISTBOX_Register ();
+ STATIC_Register ();
+
/* subclass user32 controls */
THEMING_Initialize ();
#else
TRACKBAR_Unregister ();
TREEVIEW_Unregister ();
UPDOWN_Unregister ();
+
+ unregister_versioned_classes ();
+
#else
UninitializeClasses();
#endif
if (uMenuID) {
WCHAR szText[256];
- if (!LoadStringW (hInst, uMenuID, szText, sizeof(szText)/sizeof(szText[0])))
+ if (!LoadStringW (hInst, uMenuID, szText, ARRAY_SIZE(szText)))
szText[0] = '\0';
SendMessageW (hwndStatus, SB_SETTEXTW,
HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
{
TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline));
-
-#ifdef __REACTOS__
-
- if (!create_manifest(bInstall, TRUE))
- {
- ERR("Failed to install comctl32 v6 manifest!\n");
- return HRESULT_FROM_WIN32(GetLastError());
- }
-
- if (!create_manifest(bInstall, FALSE))
- {
- ERR("Failed to install comctl32 v5 manifest!\n");
- return HRESULT_FROM_WIN32(GetLastError());
- }
-#endif
-
return S_OK;
}
TRACE ("(%p, %p, %lx, %lx)\n", hWnd, pfnSubclass, uIDSubclass, dwRef);
+ if (!hWnd || !pfnSubclass)
+ return FALSE;
+
/* Since the window procedure that we set here has two additional arguments,
* we can't simply set it as the new window procedure of the window. So we
* set our own window procedure and then calculate the other two arguments
{lCentre + 1, l2 - 3},
};
hOldPen = SelectObject(hDC, hPen);
- PolyPolyline(hDC, aptInsertMark, adwPolyPoints, sizeof(adwPolyPoints)/sizeof(adwPolyPoints[0]));
+ PolyPolyline(hDC, aptInsertMark, adwPolyPoints, ARRAY_SIZE(adwPolyPoints));
SelectObject(hDC, hOldPen);
DeleteObject(hPen);
}