2015-04-06 16:41:33 -05:00
// 6 january 2015
# define UNICODE
# define _UNICODE
# define STRICT
# define STRICT_TYPED_ITEMIDS
# define CINTERFACE
# define COBJMACROS
// see https://github.com/golang/go/issues/9916#issuecomment-74812211
# define INITGUID
// get Windows version right; right now Windows XP
# define WINVER 0x0501
# define _WIN32_WINNT 0x0501
# define _WIN32_WINDOWS 0x0501 /* according to Microsoft's winperf.h */
# define _WIN32_IE 0x0600 /* according to Microsoft's sdkddkver.h */
# define NTDDI_VERSION 0x05010000 /* according to Microsoft's sdkddkver.h */
# include <windows.h>
# include <commctrl.h>
# include <stdint.h>
# include <uxtheme.h>
# include <string.h>
# include <wchar.h>
# include <windowsx.h>
# include <vsstyle.h>
# include <vssym32.h>
# include <stdarg.h>
# include <oleacc.h>
# include <stdio.h>
2015-04-15 17:51:04 -05:00
# include "../uipriv.h"
# include "../ui_windows.h"
2015-04-06 16:41:33 -05:00
2015-04-07 01:55:33 -05:00
// ui internal window messages
enum {
// redirected WM_COMMAND and WM_NOTIFY
msgCOMMAND = WM_APP + 0x40 , // start offset just to be safe
msgNOTIFY ,
2015-04-08 20:08:53 -05:00
msgUpdateChild , // fake because Windows seems to SWP_NOSIZE MoveWindow()s and SetWindowPos()s that don't change the window size (even if SWP_NOSIZE isn't specified)
2015-04-18 17:02:16 -05:00
msgCanDestroyNow ,
2015-04-07 01:55:33 -05:00
} ;
2015-04-17 09:40:52 -05:00
# define HWND(c) ((HWND) uiControlHandle(uiControl(c)))
# define uiParentHWND(p) ((HWND) uiParentHandle(p))
2015-04-20 19:26:21 -05:00
// debug.c
2015-04-06 16:41:33 -05:00
extern HRESULT logLastError ( const char * ) ;
extern HRESULT logHRESULT ( const char * , HRESULT ) ;
extern HRESULT logMemoryExhausted ( const char * ) ;
2015-04-20 19:26:21 -05:00
// init.c
2015-04-06 16:41:33 -05:00
extern HINSTANCE hInstance ;
extern int nCmdShow ;
extern HFONT hMessageFont ;
2015-04-12 11:38:25 -05:00
extern HBRUSH hollowBrush ;
2015-04-20 19:26:21 -05:00
// util.c
2015-04-12 11:38:25 -05:00
extern int windowClassOf ( HWND , . . . ) ;
2015-04-06 16:41:33 -05:00
2015-04-20 19:26:21 -05:00
// text.c
2015-04-06 16:41:33 -05:00
extern WCHAR * toUTF16 ( const char * ) ;
2015-04-09 10:12:01 -05:00
extern char * toUTF8 ( const WCHAR * ) ;
extern WCHAR * windowText ( HWND ) ;
2015-04-07 10:39:15 -05:00
2015-04-20 19:26:21 -05:00
// comctl32.c
2015-04-07 01:11:31 -05:00
extern BOOL ( * WINAPI fv_SetWindowSubclass ) ( HWND , SUBCLASSPROC , UINT_PTR , DWORD_PTR ) ;
extern BOOL ( * WINAPI fv_RemoveWindowSubclass ) ( HWND , SUBCLASSPROC , UINT_PTR ) ;
extern LRESULT ( * WINAPI fv_DefSubclassProc ) ( HWND , UINT , WPARAM , LPARAM ) ;
extern const char * initCommonControls ( void ) ;
2015-04-20 19:26:21 -05:00
// window.c
2015-04-06 16:41:33 -05:00
extern ATOM registerWindowClass ( HICON , HCURSOR ) ;
2015-04-10 18:56:23 -05:00
2015-04-20 19:26:21 -05:00
// parent.c
2015-04-12 11:38:25 -05:00
extern HWND initialParent ;
2015-04-12 18:19:06 -05:00
extern const char * initParent ( HICON , HCURSOR ) ;
2015-04-20 19:26:21 -05:00
// menu.c
extern HMENU makeMenubar ( void ) ;