ntdll/tests: Skip test if LdrAddRefDll is missing.
[wine.git] / dlls / atl90 / atl90.c
blob1b46dcb06b88c093390708899fd3ab25554fd2b4
1 /*
2 * Copyright 2013 Zhenbo Li
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
19 #include <stdarg.h>
20 #include <stdio.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winerror.h"
27 #include "winuser.h"
28 #include "atlbase.h"
30 #include "wine/debug.h"
31 #include "wine/unicode.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(atl);
35 /***********************************************************************
36 * AtlGetVersion [atl90.@]
38 DWORD WINAPI AtlGetVersion(void *reserved)
40 return _ATL_VER;
43 /**********************************************************************
44 * AtlAxWin class window procedure
46 static LRESULT CALLBACK AtlAxWin_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
48 if ( msg == WM_CREATE )
50 DWORD len = GetWindowTextLengthW( hwnd ) + 1;
51 WCHAR *ptr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
52 if (!ptr)
53 return 1;
54 GetWindowTextW( hwnd, ptr, len );
55 AtlAxCreateControlEx( ptr, hwnd, NULL, NULL, NULL, NULL, NULL );
56 HeapFree( GetProcessHeap(), 0, ptr );
57 return 0;
59 return DefWindowProcW( hwnd, msg, wparam, lparam );
62 BOOL WINAPI AtlAxWinInit(void)
64 WNDCLASSEXW wcex;
65 const WCHAR AtlAxWin90[] = {'A','t','l','A','x','W','i','n','9','0',0};
66 const WCHAR AtlAxWinLic90[] = {'A','t','l','A','x','W','i','n','L','i','c','9','0',0};
68 FIXME("semi-stub\n");
70 if ( FAILED( OleInitialize(NULL) ) )
71 return FALSE;
73 wcex.cbSize = sizeof(wcex);
74 wcex.style = CS_GLOBALCLASS | CS_DBLCLKS;
75 wcex.cbClsExtra = 0;
76 wcex.cbWndExtra = 0;
77 wcex.hInstance = GetModuleHandleW( NULL );
78 wcex.hIcon = NULL;
79 wcex.hCursor = NULL;
80 wcex.hbrBackground = NULL;
81 wcex.lpszMenuName = NULL;
82 wcex.hIconSm = 0;
84 wcex.lpfnWndProc = AtlAxWin_wndproc;
85 wcex.lpszClassName = AtlAxWin90;
86 if ( !RegisterClassExW( &wcex ) )
87 return FALSE;
89 wcex.lpszClassName = AtlAxWinLic90;
90 if ( !RegisterClassExW( &wcex ) )
91 return FALSE;
93 return TRUE;