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-06 20:53:31 -05:00
# include "uipriv.h"
2015-04-07 02:02:07 -05:00
# 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-07 01:55:33 -05:00
} ;
2015-04-06 16:41:33 -05:00
// debug_windows.c
extern HRESULT logLastError ( const char * ) ;
extern HRESULT logHRESULT ( const char * , HRESULT ) ;
extern HRESULT logMemoryExhausted ( const char * ) ;
// init_windows.c
extern HINSTANCE hInstance ;
extern int nCmdShow ;
extern HFONT hMessageFont ;
2015-04-06 23:23:01 -05:00
extern HWND initialParent ;
2015-04-06 16:41:33 -05:00
2015-04-09 08:23:44 -05:00
// text_windows.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
// container_windows.c
2015-04-07 01:55:33 -05:00
extern BOOL sharedWndProc ( HWND , UINT , WPARAM , LPARAM , LRESULT * ) ;
2015-04-09 12:51:01 -05:00
extern void resize ( uiControl * , HWND , RECT , RECT ) ;
2015-04-06 16:41:33 -05:00
2015-04-07 01:11:31 -05:00
// comctl32_windows.c
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-06 16:41:33 -05:00
// window_windows.c
extern ATOM registerWindowClass ( HICON , HCURSOR ) ;
2015-04-10 18:56:23 -05:00
// initparent_windows.c
extern const char * initInitialParent ( HICON , HCURSOR ) ;