]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - wtf/win/MainThreadWin.cpp
JavaScriptCore-576.tar.gz
[apple/javascriptcore.git] / wtf / win / MainThreadWin.cpp
index 9f1eaa68222e2b9e6a6bc299ea5fb74e1b22cc02..ee70b59b670aa1b4b3fe930161fc299f2acd7f97 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,7 +32,7 @@
 
 #include "Assertions.h"
 #include "Threading.h"
-#if !PLATFORM(WINCE)
+#if !OS(WINCE)
 #include <windows.h>
 #endif
 
@@ -55,15 +56,26 @@ void initializeMainThreadPlatform()
     if (threadingWindowHandle)
         return;
 
+    HWND hWndParent = 0;
+#if OS(WINCE)
+    WNDCLASS wcex;
+    memset(&wcex, 0, sizeof(WNDCLASS));
+#else
     WNDCLASSEX wcex;
     memset(&wcex, 0, sizeof(WNDCLASSEX));
     wcex.cbSize = sizeof(WNDCLASSEX);
+#endif
     wcex.lpfnWndProc    = ThreadingWindowWndProc;
     wcex.lpszClassName  = kThreadingWindowClassName;
+#if OS(WINCE)
+    RegisterClass(&wcex);
+#else
     RegisterClassEx(&wcex);
+    hWndParent = HWND_MESSAGE;
+#endif
 
     threadingWindowHandle = CreateWindow(kThreadingWindowClassName, 0, 0,
-       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, 0, 0);
+       CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, hWndParent, 0, 0, 0);
     threadingFiredMessage = RegisterWindowMessage(L"com.apple.WebKit.MainThreadFired");
 }