You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

319 lines
14 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: winstl/window/creation_functions.h (originally MWBase.h, ::SynesisWin)
  3. *
  4. * Purpose: Window creation functions.
  5. *
  6. * Created: 7th May 2000
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2000-2009, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. /** \file winstl/window/creation_functions.h
  40. *
  41. * \brief [C, C++] Control creation functions
  42. * (\ref group__library__windows_window "Windows Window" Library).
  43. */
  44. #ifndef WINSTL_INCL_WINSTL_WINDOW_H_CREATION_FUNCTIONS
  45. #define WINSTL_INCL_WINSTL_WINDOW_H_CREATION_FUNCTIONS
  46. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  47. # define WINSTL_VER_WINSTL_WINDOW_H_CREATION_FUNCTIONS_MAJOR 2
  48. # define WINSTL_VER_WINSTL_WINDOW_H_CREATION_FUNCTIONS_MINOR 0
  49. # define WINSTL_VER_WINSTL_WINDOW_H_CREATION_FUNCTIONS_REVISION 3
  50. # define WINSTL_VER_WINSTL_WINDOW_H_CREATION_FUNCTIONS_EDIT 17
  51. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  52. /* /////////////////////////////////////////////////////////////////////////
  53. * Includes
  54. */
  55. #ifndef WINSTL_INCL_WINSTL_H_WINSTL
  56. # include <winstl/winstl.h>
  57. #endif /* !WINSTL_INCL_WINSTL_H_WINSTL */
  58. #ifdef __cplusplus
  59. # ifndef STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_STRING_H_FWD
  60. # include <stlsoft/shims/access/string/fwd.h>
  61. # endif /* !STLSOFT_INCL_STLSOFT_SHIMS_ACCESS_STRING_H_FWD */
  62. #endif /* __cplusplus */
  63. /* /////////////////////////////////////////////////////////////////////////
  64. * Namespace
  65. */
  66. #if !defined(_WINSTL_NO_NAMESPACE) && \
  67. !defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  68. # if defined(_STLSOFT_NO_NAMESPACE)
  69. /* There is no stlsoft namespace, so must define ::winstl */
  70. namespace winstl
  71. {
  72. # else
  73. /* Define stlsoft::winstl_project */
  74. namespace stlsoft
  75. {
  76. namespace winstl_project
  77. {
  78. # endif /* _STLSOFT_NO_NAMESPACE */
  79. #endif /* !_WINSTL_NO_NAMESPACE */
  80. /* /////////////////////////////////////////////////////////////////////////
  81. * C functions
  82. */
  83. STLSOFT_INLINE HWND winstl__CreateWindowA( LPCSTR lpClassName
  84. , LPCSTR lpWindowName
  85. , DWORD dwStyle
  86. , int X
  87. , int Y
  88. , int nWidth
  89. , int nHeight
  90. , HWND hWndParent
  91. , HMENU hMenu
  92. , HINSTANCE hInstance
  93. , LPVOID lpParam)
  94. {
  95. return STLSOFT_NS_GLOBAL(CreateWindowA)(lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  96. }
  97. STLSOFT_INLINE HWND winstl__CreateWindowW( LPCWSTR lpClassName
  98. , LPCWSTR lpWindowName
  99. , DWORD dwStyle
  100. , int X
  101. , int Y
  102. , int nWidth
  103. , int nHeight
  104. , HWND hWndParent
  105. , HMENU hMenu
  106. , HINSTANCE hInstance
  107. , LPVOID lpParam)
  108. {
  109. return STLSOFT_NS_GLOBAL(CreateWindowW)(lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  110. }
  111. STLSOFT_INLINE HWND winstl__CreateWindow( LPCTSTR lpClassName
  112. , LPCTSTR lpWindowName
  113. , DWORD dwStyle
  114. , int X
  115. , int Y
  116. , int nWidth
  117. , int nHeight
  118. , HWND hWndParent
  119. , HMENU hMenu
  120. , HINSTANCE hInstance
  121. , LPVOID lpParam)
  122. {
  123. return STLSOFT_NS_GLOBAL(CreateWindow)(lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  124. }
  125. STLSOFT_INLINE HWND winstl__CreateWindowExA(DWORD dwExStyle
  126. , LPCSTR lpClassName
  127. , LPCSTR lpWindowName
  128. , DWORD dwStyle
  129. , int X
  130. , int Y
  131. , int nWidth
  132. , int nHeight
  133. , HWND hWndParent
  134. , HMENU hMenu
  135. , HINSTANCE hInstance
  136. , LPVOID lpParam)
  137. {
  138. return STLSOFT_NS_GLOBAL(CreateWindowExA)(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  139. }
  140. STLSOFT_INLINE HWND winstl__CreateWindowExW(DWORD dwExStyle
  141. , LPCWSTR lpClassName
  142. , LPCWSTR lpWindowName
  143. , DWORD dwStyle
  144. , int X
  145. , int Y
  146. , int nWidth
  147. , int nHeight
  148. , HWND hWndParent
  149. , HMENU hMenu
  150. , HINSTANCE hInstance
  151. , LPVOID lpParam)
  152. {
  153. return STLSOFT_NS_GLOBAL(CreateWindowExW)(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  154. }
  155. STLSOFT_INLINE HWND winstl__CreateWindowEx( DWORD dwExStyle
  156. , LPCTSTR lpClassName
  157. , LPCTSTR lpWindowName
  158. , DWORD dwStyle
  159. , int X
  160. , int Y
  161. , int nWidth
  162. , int nHeight
  163. , HWND hWndParent
  164. , HMENU hMenu
  165. , HINSTANCE hInstance
  166. , LPVOID lpParam)
  167. {
  168. return STLSOFT_NS_GLOBAL(CreateWindowEx)(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  169. }
  170. /* /////////////////////////////////////////////////////////////////////////
  171. * Namespace
  172. */
  173. #ifdef STLSOFT_DOCUMENTATION_SKIP_SECTION
  174. namespace winstl
  175. {
  176. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  177. /* /////////////////////////////////////////////////////////////////////////
  178. * C++ functions
  179. */
  180. #ifdef __cplusplus
  181. # ifndef _WINSTL_NO_NAMESPACE
  182. /*
  183. inline HWND CreateWindowA( LPCSTR lpClassName
  184. , LPCSTR lpWindowName
  185. , DWORD dwStyle
  186. , int X
  187. , int Y
  188. , int nWidth
  189. , int nHeight
  190. , HWND hWndParent
  191. , HMENU hMenu
  192. , HINSTANCE hInstance
  193. , LPVOID lpParam)
  194. {
  195. return winstl__CreateWindowA(lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  196. }
  197. inline HWND CreateWindowW( LPCWSTR lpClassName
  198. , LPCWSTR lpWindowName
  199. , DWORD dwStyle
  200. , int X
  201. , int Y
  202. , int nWidth
  203. , int nHeight
  204. , HWND hWndParent
  205. , HMENU hMenu
  206. , HINSTANCE hInstance
  207. , LPVOID lpParam)
  208. {
  209. return winstl__CreateWindowW(lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  210. }
  211. inline HWND CreateWindow( LPCTSTR lpClassName
  212. , LPCTSTR lpWindowName
  213. , DWORD dwStyle
  214. , int X
  215. , int Y
  216. , int nWidth
  217. , int nHeight
  218. , HWND hWndParent
  219. , HMENU hMenu
  220. , HINSTANCE hInstance
  221. , LPVOID lpParam)
  222. {
  223. return winstl__CreateWindow(lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  224. }
  225. */
  226. inline HWND CreateWindowExA(DWORD dwExStyle
  227. , LPCSTR lpClassName
  228. , LPCSTR lpWindowName
  229. , DWORD dwStyle
  230. , int X
  231. , int Y
  232. , int nWidth
  233. , int nHeight
  234. , HWND hWndParent
  235. , HMENU hMenu
  236. , HINSTANCE hInstance
  237. , LPVOID lpParam)
  238. {
  239. return winstl__CreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  240. }
  241. inline HWND CreateWindowExW(DWORD dwExStyle
  242. , LPCWSTR lpClassName
  243. , LPCWSTR lpWindowName
  244. , DWORD dwStyle
  245. , int X
  246. , int Y
  247. , int nWidth
  248. , int nHeight
  249. , HWND hWndParent
  250. , HMENU hMenu
  251. , HINSTANCE hInstance
  252. , LPVOID lpParam)
  253. {
  254. return winstl__CreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  255. }
  256. /*
  257. inline HWND CreateWindowEx( DWORD dwExStyle
  258. , LPCTSTR lpClassName
  259. , LPCTSTR lpWindowName
  260. , DWORD dwStyle
  261. , int X
  262. , int Y
  263. , int nWidth
  264. , int nHeight
  265. , HWND hWndParent
  266. , HMENU hMenu
  267. , HINSTANCE hInstance
  268. , LPVOID lpParam)
  269. {
  270. return winstl__CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  271. }
  272. */
  273. # endif /* !_WINSTL_NO_NAMESPACE */
  274. #endif /* __cplusplus */
  275. /* ////////////////////////////////////////////////////////////////////// */
  276. #ifndef _WINSTL_NO_NAMESPACE
  277. # if defined(_STLSOFT_NO_NAMESPACE) || \
  278. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  279. } /* namespace winstl */
  280. # else
  281. } /* namespace winstl_project */
  282. } /* namespace stlsoft */
  283. # endif /* _STLSOFT_NO_NAMESPACE */
  284. #endif /* !_WINSTL_NO_NAMESPACE */
  285. /* ////////////////////////////////////////////////////////////////////// */
  286. #endif /* WINSTL_INCL_WINSTL_WINDOW_H_CREATION_FUNCTIONS */
  287. /* ///////////////////////////// end of file //////////////////////////// */