2 * Active Template Library ActiveX functions (atl.dll)
4 * Copyright 2006 Andrey Turkin
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "wine/debug.h"
40 #include "wine/unicode.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(atl
);
44 /**********************************************************************
45 * AtlAxWin class window procedure
47 LRESULT
static CALLBACK
AtlAxWin_wndproc( HWND hWnd
, UINT wMsg
, WPARAM wParam
, LPARAM lParam
)
49 if ( wMsg
== WM_CREATE
)
51 DWORD len
= GetWindowTextLengthW( hWnd
) + 1;
52 WCHAR
*ptr
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
55 GetWindowTextW( hWnd
, ptr
, len
);
56 AtlAxCreateControl( ptr
, hWnd
, NULL
, NULL
);
57 HeapFree( GetProcessHeap(), 0, ptr
);
60 return DefWindowProcW( hWnd
, wMsg
, wParam
, lParam
);
63 /***********************************************************************
64 * AtlAxWinInit [ATL.@]
65 * Initializes the control-hosting code: registering the AtlAxWin,
66 * AtlAxWin7 and AtlAxWinLic7 window classes and some messages.
72 BOOL WINAPI
AtlAxWinInit(void)
75 const WCHAR AtlAxWin
[] = {'A','t','l','A','x','W','i','n',0};
79 if ( FAILED( OleInitialize(NULL
) ) )
82 wcex
.cbSize
= sizeof(wcex
);
86 wcex
.hInstance
= GetModuleHandleW( NULL
);
89 wcex
.hbrBackground
= NULL
;
90 wcex
.lpszMenuName
= NULL
;
93 wcex
.lpfnWndProc
= AtlAxWin_wndproc
;
94 wcex
.lpszClassName
= AtlAxWin
;
95 if ( !RegisterClassExW( &wcex
) )