2 * Win32 structure conversion functions
4 * Copyright 1996 Martin von Loewis
14 void STRUCT32_POINT32to16(const POINT32
* p32
,POINT
* p16
)
20 void STRUCT32_POINT16to32(const POINT
* p16
,POINT32
* p32
)
26 void STRUCT32_SIZE16to32(const SIZE
* p16
, SIZE32
* p32
)
33 void STRUCT32_MSG16to32(MSG
*msg16
,MSG32
*msg32
)
35 msg32
->hwnd
=(DWORD
)msg16
->hwnd
;
36 msg32
->message
=msg16
->message
;
37 msg32
->wParam
=msg16
->wParam
;
38 msg32
->lParam
=msg16
->lParam
;
39 msg32
->time
=msg16
->time
;
40 msg32
->pt
.x
=msg16
->pt
.x
;
41 msg32
->pt
.y
=msg16
->pt
.y
;
44 void STRUCT32_MSG32to16(MSG32
*msg32
,MSG
*msg16
)
46 msg16
->hwnd
=(HWND
)msg32
->hwnd
;
47 msg16
->message
=msg32
->message
;
48 msg16
->wParam
=msg32
->wParam
;
49 msg16
->lParam
=msg32
->lParam
;
50 msg16
->time
=msg32
->time
;
51 msg16
->pt
.x
=msg32
->pt
.x
;
52 msg16
->pt
.y
=msg32
->pt
.y
;
55 void STRUCT32_RECT32to16(const RECT32
* r32
,RECT
*r16
)
57 r16
->left
= r32
->left
;
58 r16
->right
= r32
->right
;
60 r16
->bottom
= r32
->bottom
;
63 void STRUCT32_RECT16to32(const RECT
* r16
,RECT32
*r32
)
65 r32
->left
= r16
->left
;
66 r32
->right
= r16
->right
;
68 r32
->bottom
= r16
->bottom
;
71 void STRUCT32_MINMAXINFO32to16(const MINMAXINFO32
*from
,MINMAXINFO
*to
)
73 STRUCT32_POINT32to16(&from
->ptReserved
,&to
->ptReserved
);
74 STRUCT32_POINT32to16(&from
->ptMaxSize
,&to
->ptMaxSize
);
75 STRUCT32_POINT32to16(&from
->ptMaxPosition
,&to
->ptMaxPosition
);
76 STRUCT32_POINT32to16(&from
->ptMinTrackSize
,&to
->ptMinTrackSize
);
77 STRUCT32_POINT32to16(&from
->ptMaxTrackSize
,&to
->ptMaxTrackSize
);
80 void STRUCT32_MINMAXINFO16to32(const MINMAXINFO
*from
,MINMAXINFO32
*to
)
82 STRUCT32_POINT16to32(&from
->ptReserved
,&to
->ptReserved
);
83 STRUCT32_POINT16to32(&from
->ptMaxSize
,&to
->ptMaxSize
);
84 STRUCT32_POINT16to32(&from
->ptMaxPosition
,&to
->ptMaxPosition
);
85 STRUCT32_POINT16to32(&from
->ptMinTrackSize
,&to
->ptMinTrackSize
);
86 STRUCT32_POINT16to32(&from
->ptMaxTrackSize
,&to
->ptMaxTrackSize
);
89 void STRUCT32_WINDOWPOS32to16(const WINDOWPOS32
* from
,WINDOWPOS
* to
)
92 to
->hwndInsertAfter
=from
->hwndInsertAfter
;
96 to
->flags
=from
->flags
;
99 void STRUCT32_WINDOWPOS16to32(const WINDOWPOS
* from
,WINDOWPOS32
* to
)
102 to
->hwndInsertAfter
=from
->hwndInsertAfter
;
106 to
->flags
=from
->flags
;
109 void STRUCT32_NCCALCSIZE32to16Flat(const NCCALCSIZE_PARAMS32
* from
,
110 NCCALCSIZE_PARAMS
* to
)
112 STRUCT32_RECT32to16(from
->rgrc
,to
->rgrc
);
113 STRUCT32_RECT32to16(from
->rgrc
+1,to
->rgrc
+1);
114 STRUCT32_RECT32to16(from
->rgrc
+2,to
->rgrc
+2);
117 void STRUCT32_NCCALCSIZE16to32Flat(const NCCALCSIZE_PARAMS
* from
,
118 NCCALCSIZE_PARAMS32
* to
)
120 STRUCT32_RECT16to32(from
->rgrc
,to
->rgrc
);
121 STRUCT32_RECT16to32(from
->rgrc
+1,to
->rgrc
+1);
122 STRUCT32_RECT16to32(from
->rgrc
+2,to
->rgrc
+2);
125 /* The strings are not copied */
126 void STRUCT32_CREATESTRUCT32to16(const CREATESTRUCT32
* from
,CREATESTRUCT
* to
)
128 to
->lpCreateParams
= (LPVOID
)from
->lpCreateParams
;
129 to
->hInstance
= from
->hInstance
;
130 to
->hMenu
= from
->hMenu
;
131 to
->hwndParent
= from
->hwndParent
;
135 to
->style
= from
->style
;
136 to
->dwExStyle
= from
->dwExStyle
;
139 void STRUCT32_CREATESTRUCT16to32(const CREATESTRUCT
* from
,CREATESTRUCT32
*to
)
141 to
->lpCreateParams
= (DWORD
)from
->lpCreateParams
;
142 to
->hInstance
= from
->hInstance
;
143 to
->hMenu
= from
->hMenu
;
144 to
->hwndParent
= from
->hwndParent
;
148 to
->style
= from
->style
;
149 to
->dwExStyle
= from
->dwExStyle
;