Permalink
Browse files

[project @ 2004-07-23 22:26:14 by ross]

bypass another macro (CreateWindowW)
  • Loading branch information...
1 parent 90e0d26 commit 944f88dc52425edaf97926351bce05ec96180b60 ross committed Jul 23, 2004
Showing with 10 additions and 24 deletions.
  1. +6 −6 Graphics/Win32/Control.hsc
  2. +4 −18 Graphics/Win32/Window.hsc
View
@@ -51,7 +51,7 @@ createButton
createButton nm wstyle bstyle mb_x mb_y mb_w mb_h mb_parent mb_menu h =
withTString nm $ \ c_nm ->
failIfNull "CreateButton" $
- c_CreateWindow buttonStyle c_nm (wstyle .|. bstyle)
+ c_CreateWindowEx 0 buttonStyle c_nm (wstyle .|. bstyle)
(maybePos mb_x) (maybePos mb_y) (maybePos mb_w) (maybePos mb_h)
(maybePtr mb_parent) (maybePtr mb_menu) h nullPtr
@@ -112,7 +112,7 @@ createComboBox
createComboBox nm wstyle cstyle mb_x mb_y mb_w mb_h parent mb_menu h =
withTString nm $ \ c_nm ->
failIfNull "CreateComboBox" $
- c_CreateWindow comboBoxStyle c_nm (wstyle .|. cstyle)
+ c_CreateWindowEx 0 comboBoxStyle c_nm (wstyle .|. cstyle)
(maybePos mb_x) (maybePos mb_y) (maybePos mb_w) (maybePos mb_h)
parent (maybePtr mb_menu) h nullPtr
@@ -153,7 +153,7 @@ createEditWindow
createEditWindow nm wstyle estyle mb_x mb_y mb_w mb_h parent mb_menu h =
withTString nm $ \ c_nm ->
failIfNull "CreateEditWindow" $
- c_CreateWindow editStyle c_nm (wstyle .|. estyle)
+ c_CreateWindowEx 0 editStyle c_nm (wstyle .|. estyle)
(maybePos mb_x) (maybePos mb_y) (maybePos mb_w) (maybePos mb_h)
parent (maybePtr mb_menu) h nullPtr
@@ -194,7 +194,7 @@ createListBox
createListBox nm wstyle lstyle mb_x mb_y mb_w mb_h parent mb_menu h =
withTString nm $ \ c_nm ->
failIfNull "CreateListBox" $
- c_CreateWindow listBoxStyle c_nm (wstyle .|. lstyle)
+ c_CreateWindowEx 0 listBoxStyle c_nm (wstyle .|. lstyle)
(maybePos mb_x) (maybePos mb_y) (maybePos mb_w) (maybePos mb_h)
parent (maybePtr mb_menu) h nullPtr
@@ -231,7 +231,7 @@ createScrollbar
createScrollbar nm wstyle sstyle mb_x mb_y mb_w mb_h parent mb_menu h =
withTString nm $ \ c_nm ->
failIfNull "CreateScrollbar" $
- c_CreateWindow scrollBarStyle c_nm (wstyle .|. sstyle)
+ c_CreateWindowEx 0 scrollBarStyle c_nm (wstyle .|. sstyle)
(maybePos mb_x) (maybePos mb_y) (maybePos mb_w) (maybePos mb_h)
parent (maybePtr mb_menu) h nullPtr
@@ -272,7 +272,7 @@ createStaticWindow
createStaticWindow nm wstyle sstyle mb_x mb_y mb_w mb_h parent mb_menu h =
withTString nm $ \ c_nm ->
failIfNull "CreateStaticWindow" $
- c_CreateWindow staticStyle c_nm (wstyle .|. sstyle)
+ c_CreateWindowEx 0 staticStyle c_nm (wstyle .|. sstyle)
(maybePos mb_x) (maybePos mb_y) (maybePos mb_w) (maybePos mb_h)
parent (maybePtr mb_menu) h nullPtr
View
@@ -191,31 +191,17 @@ createWindow
Maybe Pos -> Maybe Pos -> Maybe Pos -> Maybe Pos ->
Maybe HWND -> Maybe HMENU -> HINSTANCE -> WindowClosure ->
IO HWND
-createWindow cname wname style mb_x mb_y mb_w mb_h mb_parent mb_menu inst closure = do
- -- Freeing the title/window name has been reported
- -- to cause a crash, so let's not do it.
- -- withTString wname $ \ c_wname -> do
- c_wname <- newTString wname
- wnd <- failIfNull "CreateWindow" $
- c_CreateWindow cname c_wname style
- (maybePos mb_x) (maybePos mb_y) (maybePos mb_w) (maybePos mb_h)
- (maybePtr mb_parent) (maybePtr mb_menu) inst nullPtr
- setWindowClosure wnd closure
- return wnd
-foreign import stdcall unsafe "windows.h CreateWindowW"
- c_CreateWindow
- :: ClassName -> LPCTSTR -> WindowStyle ->
- Pos -> Pos -> Pos -> Pos ->
- HWND -> HMENU -> HINSTANCE -> LPVOID ->
- IO HWND
+createWindow = createWindowEx 0
+-- apparently CreateWindowA/W are just macros for CreateWindowExA/W
createWindowEx
:: WindowStyle -> ClassName -> String -> WindowStyle
-> Maybe Pos -> Maybe Pos -> Maybe Pos -> Maybe Pos
-> Maybe HWND -> Maybe HMENU -> HINSTANCE -> WindowClosure
-> IO HWND
createWindowEx estyle cname wname wstyle mb_x mb_y mb_w mb_h mb_parent mb_menu inst closure = do
- -- see CreateWindow comment.
+ -- Freeing the title/window name has been reported
+ -- to cause a crash, so let's not do it.
-- withTString wname $ \ c_wname -> do
c_wname <- newTString wname
wnd <- failIfNull "CreateWindowEx" $

0 comments on commit 944f88d

Please sign in to comment.