2 * Copyright 2013 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wine/debug.h"
31 #include "wine/unicode.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(atl
);
35 /***********************************************************************
36 * AtlGetVersion [atl110.@]
38 DWORD WINAPI
AtlGetVersion(void *pReserved
)
43 /**********************************************************************
44 * AtlAxWin class window procedure
46 static LRESULT CALLBACK
AtlAxWin_wndproc( HWND hWnd
, UINT wMsg
, WPARAM wParam
, LPARAM lParam
)
48 if ( wMsg
== WM_CREATE
)
50 DWORD len
= GetWindowTextLengthW( hWnd
) + 1;
51 WCHAR
*ptr
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
54 GetWindowTextW( hWnd
, ptr
, len
);
55 AtlAxCreateControlEx( ptr
, hWnd
, NULL
, NULL
, NULL
, NULL
, NULL
);
56 HeapFree( GetProcessHeap(), 0, ptr
);
59 return DefWindowProcW( hWnd
, wMsg
, wParam
, lParam
);
62 BOOL WINAPI
AtlAxWinInit(void)
65 const WCHAR AtlAxWin110
[] = {'A','t','l','A','x','W','i','n','1','1','0',0};
66 const WCHAR AtlAxWinLic110
[] = {'A','t','l','A','x','W','i','n','L','i','c','1','1','0',0};
70 if ( FAILED( OleInitialize(NULL
) ) )
73 wcex
.cbSize
= sizeof(wcex
);
74 wcex
.style
= CS_GLOBALCLASS
| CS_DBLCLKS
;
77 wcex
.hInstance
= GetModuleHandleW( NULL
);
80 wcex
.hbrBackground
= NULL
;
81 wcex
.lpszMenuName
= NULL
;
84 wcex
.lpfnWndProc
= AtlAxWin_wndproc
;
85 wcex
.lpszClassName
= AtlAxWin110
;
86 if ( !RegisterClassExW( &wcex
) )
89 wcex
.lpszClassName
= AtlAxWinLic110
;
90 if ( !RegisterClassExW( &wcex
) )