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
30 #include "wine/debug.h"
40 #include "wine/unicode.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(atl
);
45 IOleClientSite IOleClientSite_iface
;
46 IOleContainer IOleContainer_iface
;
47 IOleInPlaceSiteWindowless IOleInPlaceSiteWindowless_iface
;
48 IOleInPlaceFrame IOleInPlaceFrame_iface
;
49 IOleControlSite IOleControlSite_iface
;
56 BOOL fActive
, fInPlace
, fWindowless
;
59 static const WCHAR wine_atl_iocsW
[] = {'_','_','W','I','N','E','_','A','T','L','_','I','O','C','S','\0'};
61 /**********************************************************************
62 * AtlAxWin class window procedure
64 static LRESULT CALLBACK
AtlAxWin_wndproc( HWND hWnd
, UINT wMsg
, WPARAM wParam
, LPARAM lParam
)
66 if ( wMsg
== WM_CREATE
)
68 DWORD len
= GetWindowTextLengthW( hWnd
) + 1;
69 WCHAR
*ptr
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
72 GetWindowTextW( hWnd
, ptr
, len
);
73 AtlAxCreateControlEx( ptr
, hWnd
, NULL
, NULL
, NULL
, NULL
, NULL
);
74 HeapFree( GetProcessHeap(), 0, ptr
);
77 return DefWindowProcW( hWnd
, wMsg
, wParam
, lParam
);
80 /***********************************************************************
81 * AtlAxWinInit [atl100.@]
82 * Initializes the control-hosting code: registering the AtlAxWin,
83 * AtlAxWin7 and AtlAxWinLic7 window classes and some messages.
89 BOOL WINAPI
AtlAxWinInit(void)
93 #if _ATL_VER <= _ATL_VER_30
94 #define ATL_NAME_SUFFIX 0
95 #elif _ATL_VER == _ATL_VER_80
96 #define ATL_NAME_SUFFIX '8','0',0
97 #elif _ATL_VER == _ATL_VER_90
98 #define ATL_NAME_SUFFIX '9','0',0
99 #elif _ATL_VER == _ATL_VER_100
100 #define ATL_NAME_SUFFIX '1','0','0',0
101 #elif _ATL_VER == _ATL_VER_110
102 #define ATL_NAME_SUFFIX '1','1','0',0
104 #error Unsupported version
107 const WCHAR AtlAxWinW
[] = {'A','t','l','A','x','W','i','n',ATL_NAME_SUFFIX
};
109 FIXME("version %04x semi-stub\n", _ATL_VER
);
111 if ( FAILED( OleInitialize(NULL
) ) )
114 wcex
.cbSize
= sizeof(wcex
);
115 wcex
.style
= CS_GLOBALCLASS
| (_ATL_VER
> _ATL_VER_30
? CS_DBLCLKS
: 0);
118 wcex
.hInstance
= GetModuleHandleW( NULL
);
121 wcex
.hbrBackground
= NULL
;
122 wcex
.lpszMenuName
= NULL
;
125 wcex
.lpfnWndProc
= AtlAxWin_wndproc
;
126 wcex
.lpszClassName
= AtlAxWinW
;
127 if ( !RegisterClassExW( &wcex
) )
130 if(_ATL_VER
> _ATL_VER_30
) {
131 const WCHAR AtlAxWinLicW
[] = {'A','t','l','A','x','W','i','n','L','i','c',ATL_NAME_SUFFIX
};
133 wcex
.lpszClassName
= AtlAxWinLicW
;
134 if ( !RegisterClassExW( &wcex
) )
141 /***********************************************************************
142 * Atl container component implementation
145 /****** IOleClientSite *****/
146 static inline IOCS
*impl_from_IOleClientSite(IOleClientSite
*iface
)
148 return CONTAINING_RECORD(iface
, IOCS
, IOleClientSite_iface
);
151 static HRESULT
IOCS_Detach( IOCS
*This
) /* remove subclassing */
155 SetWindowLongPtrW( This
->hWnd
, GWLP_WNDPROC
, (ULONG_PTR
) This
->OrigWndProc
);
156 RemovePropW( This
->hWnd
, wine_atl_iocsW
);
161 IOleObject
*control
= This
->control
;
163 This
->control
= NULL
;
164 IOleObject_Close( control
, OLECLOSE_NOSAVE
);
165 IOleObject_SetClientSite( control
, NULL
);
166 IOleObject_Release( control
);
171 static HRESULT WINAPI
OleClientSite_QueryInterface(IOleClientSite
*iface
, REFIID riid
, void **ppv
)
173 IOCS
*This
= impl_from_IOleClientSite(iface
);
175 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
179 if (IsEqualIID(&IID_IUnknown
, riid
) ||
180 IsEqualIID(&IID_IOleClientSite
, riid
))
184 else if (IsEqualIID(&IID_IOleContainer
, riid
))
186 *ppv
= &This
->IOleContainer_iface
;
188 else if (IsEqualIID(&IID_IOleInPlaceSite
, riid
) ||
189 IsEqualIID(&IID_IOleInPlaceSiteEx
, riid
) ||
190 IsEqualIID(&IID_IOleInPlaceSiteWindowless
, riid
))
192 *ppv
= &This
->IOleInPlaceSiteWindowless_iface
;
194 else if (IsEqualIID(&IID_IOleInPlaceFrame
, riid
))
196 *ppv
= &This
->IOleInPlaceFrame_iface
;
198 else if (IsEqualIID(&IID_IOleControlSite
, riid
))
200 *ppv
= &This
->IOleControlSite_iface
;
205 IOleClientSite_AddRef(iface
);
209 WARN("unsupported interface %s\n", debugstr_guid(riid
));
210 return E_NOINTERFACE
;
213 static ULONG WINAPI
OleClientSite_AddRef(IOleClientSite
*iface
)
215 IOCS
*This
= impl_from_IOleClientSite(iface
);
216 ULONG ref
= InterlockedIncrement(&This
->ref
);
217 TRACE("(%p)->(%d)\n", This
, ref
);
221 static ULONG WINAPI
OleClientSite_Release(IOleClientSite
*iface
)
223 IOCS
*This
= impl_from_IOleClientSite(iface
);
224 ULONG ref
= InterlockedDecrement(&This
->ref
);
226 TRACE("(%p)->(%d)\n", This
, ref
);
231 HeapFree( GetProcessHeap(), 0, This
);
237 static HRESULT WINAPI
OleClientSite_SaveObject(IOleClientSite
*iface
)
239 IOCS
*This
= impl_from_IOleClientSite(iface
);
240 FIXME( "(%p) - stub\n", This
);
244 static HRESULT WINAPI
OleClientSite_GetMoniker(IOleClientSite
*iface
, DWORD dwAssign
, DWORD dwWhichMoniker
, IMoniker
**ppmk
)
246 IOCS
*This
= impl_from_IOleClientSite(iface
);
248 FIXME( "(%p, 0x%x, 0x%x, %p)\n", This
, dwAssign
, dwWhichMoniker
, ppmk
);
252 static HRESULT WINAPI
OleClientSite_GetContainer(IOleClientSite
*iface
, IOleContainer
**container
)
254 IOCS
*This
= impl_from_IOleClientSite(iface
);
255 TRACE("(%p, %p)\n", This
, container
);
256 return IOleClientSite_QueryInterface(iface
, &IID_IOleContainer
, (void**)container
);
259 static HRESULT WINAPI
OleClientSite_ShowObject(IOleClientSite
*iface
)
261 IOCS
*This
= impl_from_IOleClientSite(iface
);
262 FIXME( "(%p) - stub\n", This
);
266 static HRESULT WINAPI
OleClientSite_OnShowWindow(IOleClientSite
*iface
, BOOL fShow
)
268 IOCS
*This
= impl_from_IOleClientSite(iface
);
269 FIXME( "(%p, %s) - stub\n", This
, fShow
? "TRUE" : "FALSE" );
273 static HRESULT WINAPI
OleClientSite_RequestNewObjectLayout(IOleClientSite
*iface
)
275 IOCS
*This
= impl_from_IOleClientSite(iface
);
276 FIXME( "(%p) - stub\n", This
);
281 /****** IOleContainer *****/
282 static inline IOCS
*impl_from_IOleContainer(IOleContainer
*iface
)
284 return CONTAINING_RECORD(iface
, IOCS
, IOleContainer_iface
);
287 static HRESULT WINAPI
OleContainer_QueryInterface( IOleContainer
* iface
, REFIID riid
, void** ppv
)
289 IOCS
*This
= impl_from_IOleContainer(iface
);
290 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppv
);
293 static ULONG WINAPI
OleContainer_AddRef(IOleContainer
* iface
)
295 IOCS
*This
= impl_from_IOleContainer(iface
);
296 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
299 static ULONG WINAPI
OleContainer_Release(IOleContainer
* iface
)
301 IOCS
*This
= impl_from_IOleContainer(iface
);
302 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
305 static HRESULT WINAPI
OleContainer_ParseDisplayName(IOleContainer
* iface
, IBindCtx
* pbc
,
306 LPOLESTR pszDisplayName
, ULONG
* pchEaten
, IMoniker
** ppmkOut
)
308 IOCS
*This
= impl_from_IOleContainer(iface
);
309 FIXME( "(%p,%p,%s,%p,%p) - stub\n", This
, pbc
, debugstr_w(pszDisplayName
), pchEaten
, ppmkOut
);
313 static HRESULT WINAPI
OleContainer_EnumObjects(IOleContainer
* iface
, DWORD grfFlags
, IEnumUnknown
** ppenum
)
315 IOCS
*This
= impl_from_IOleContainer(iface
);
316 FIXME( "(%p, %u, %p) - stub\n", This
, grfFlags
, ppenum
);
320 static HRESULT WINAPI
OleContainer_LockContainer(IOleContainer
* iface
, BOOL fLock
)
322 IOCS
*This
= impl_from_IOleContainer(iface
);
323 FIXME( "(%p, %s) - stub\n", This
, fLock
?"TRUE":"FALSE" );
328 /****** IOleInPlaceSiteWindowless *******/
329 static inline IOCS
*impl_from_IOleInPlaceSiteWindowless(IOleInPlaceSiteWindowless
*iface
)
331 return CONTAINING_RECORD(iface
, IOCS
, IOleInPlaceSiteWindowless_iface
);
334 static HRESULT WINAPI
OleInPlaceSiteWindowless_QueryInterface(IOleInPlaceSiteWindowless
*iface
, REFIID riid
, void **ppv
)
336 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
337 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppv
);
340 static ULONG WINAPI
OleInPlaceSiteWindowless_AddRef(IOleInPlaceSiteWindowless
*iface
)
342 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
343 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
346 static ULONG WINAPI
OleInPlaceSiteWindowless_Release(IOleInPlaceSiteWindowless
*iface
)
348 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
349 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
352 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetWindow(IOleInPlaceSiteWindowless
* iface
, HWND
* phwnd
)
354 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
356 TRACE("(%p,%p)\n", This
, phwnd
);
361 static HRESULT WINAPI
OleInPlaceSiteWindowless_ContextSensitiveHelp(IOleInPlaceSiteWindowless
* iface
, BOOL fEnterMode
)
363 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
364 FIXME("(%p,%d) - stub\n", This
, fEnterMode
);
368 static HRESULT WINAPI
OleInPlaceSiteWindowless_CanInPlaceActivate(IOleInPlaceSiteWindowless
*iface
)
370 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
371 TRACE("(%p)\n", This
);
375 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnInPlaceActivate(IOleInPlaceSiteWindowless
*iface
)
377 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
379 TRACE("(%p)\n", This
);
381 This
->fInPlace
= TRUE
;
385 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnUIActivate(IOleInPlaceSiteWindowless
*iface
)
387 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
389 TRACE("(%p)\n", This
);
393 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetWindowContext(IOleInPlaceSiteWindowless
*iface
,
394 IOleInPlaceFrame
**frame
, IOleInPlaceUIWindow
**ppDoc
, LPRECT lprcPosRect
,
395 LPRECT lprcClipRect
, LPOLEINPLACEFRAMEINFO lpFrameInfo
)
397 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
399 TRACE("(%p,%p,%p,%p,%p,%p)\n", This
, frame
, ppDoc
, lprcPosRect
, lprcClipRect
, lpFrameInfo
);
402 *lprcClipRect
= This
->size
;
404 *lprcPosRect
= This
->size
;
408 *frame
= &This
->IOleInPlaceFrame_iface
;
409 IOleInPlaceFrame_AddRef(*frame
);
417 lpFrameInfo
->fMDIApp
= FALSE
;
418 lpFrameInfo
->hwndFrame
= This
->hWnd
;
419 lpFrameInfo
->haccel
= NULL
;
420 lpFrameInfo
->cAccelEntries
= 0;
426 static HRESULT WINAPI
OleInPlaceSiteWindowless_Scroll(IOleInPlaceSiteWindowless
*iface
, SIZE scrollExtent
)
428 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
429 FIXME("(%p) - stub\n", This
);
433 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnUIDeactivate(IOleInPlaceSiteWindowless
*iface
, BOOL fUndoable
)
435 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
436 FIXME("(%p,%d) - stub\n", This
, fUndoable
);
440 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnInPlaceDeactivate(IOleInPlaceSiteWindowless
*iface
)
442 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
444 TRACE("(%p)\n", This
);
446 This
->fInPlace
= This
->fWindowless
= FALSE
;
450 static HRESULT WINAPI
OleInPlaceSiteWindowless_DiscardUndoState(IOleInPlaceSiteWindowless
*iface
)
452 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
453 FIXME("(%p) - stub\n", This
);
457 static HRESULT WINAPI
OleInPlaceSiteWindowless_DeactivateAndUndo(IOleInPlaceSiteWindowless
*iface
)
459 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
460 FIXME("(%p) - stub\n", This
);
464 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnPosRectChange(IOleInPlaceSiteWindowless
*iface
, LPCRECT lprcPosRect
)
466 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
467 FIXME("(%p,%p) - stub\n", This
, lprcPosRect
);
471 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnInPlaceActivateEx( IOleInPlaceSiteWindowless
*iface
, BOOL
* pfNoRedraw
, DWORD dwFlags
)
473 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
477 This
->fActive
= This
->fInPlace
= TRUE
;
478 if ( dwFlags
& ACTIVATE_WINDOWLESS
)
479 This
->fWindowless
= TRUE
;
483 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnInPlaceDeactivateEx( IOleInPlaceSiteWindowless
*iface
, BOOL fNoRedraw
)
485 IOCS
*This
= impl_from_IOleInPlaceSiteWindowless(iface
);
489 This
->fActive
= This
->fInPlace
= This
->fWindowless
= FALSE
;
492 static HRESULT WINAPI
OleInPlaceSiteWindowless_RequestUIActivate( IOleInPlaceSiteWindowless
*iface
)
497 static HRESULT WINAPI
OleInPlaceSiteWindowless_CanWindowlessActivate( IOleInPlaceSiteWindowless
*iface
)
502 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetCapture( IOleInPlaceSiteWindowless
*iface
)
507 static HRESULT WINAPI
OleInPlaceSiteWindowless_SetCapture( IOleInPlaceSiteWindowless
*iface
, BOOL fCapture
)
512 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetFocus( IOleInPlaceSiteWindowless
*iface
)
517 static HRESULT WINAPI
OleInPlaceSiteWindowless_SetFocus( IOleInPlaceSiteWindowless
*iface
, BOOL fFocus
)
522 static HRESULT WINAPI
OleInPlaceSiteWindowless_GetDC( IOleInPlaceSiteWindowless
*iface
, LPCRECT pRect
, DWORD grfFlags
, HDC
* phDC
)
527 static HRESULT WINAPI
OleInPlaceSiteWindowless_ReleaseDC( IOleInPlaceSiteWindowless
*iface
, HDC hDC
)
532 static HRESULT WINAPI
OleInPlaceSiteWindowless_InvalidateRect( IOleInPlaceSiteWindowless
*iface
, LPCRECT pRect
, BOOL fErase
)
537 static HRESULT WINAPI
OleInPlaceSiteWindowless_InvalidateRgn( IOleInPlaceSiteWindowless
*iface
, HRGN hRGN
, BOOL fErase
)
542 static HRESULT WINAPI
OleInPlaceSiteWindowless_ScrollRect( IOleInPlaceSiteWindowless
*iface
, INT dx
, INT dy
, LPCRECT pRectScroll
, LPCRECT pRectClip
)
547 static HRESULT WINAPI
OleInPlaceSiteWindowless_AdjustRect( IOleInPlaceSiteWindowless
*iface
, LPRECT prc
)
552 static HRESULT WINAPI
OleInPlaceSiteWindowless_OnDefWindowMessage( IOleInPlaceSiteWindowless
*iface
, UINT msg
, WPARAM wParam
, LPARAM lParam
, LRESULT
* plResult
)
559 /****** IOleInPlaceFrame *******/
560 static inline IOCS
*impl_from_IOleInPlaceFrame(IOleInPlaceFrame
*iface
)
562 return CONTAINING_RECORD(iface
, IOCS
, IOleInPlaceFrame_iface
);
565 static HRESULT WINAPI
OleInPlaceFrame_QueryInterface(IOleInPlaceFrame
*iface
, REFIID riid
, void **ppv
)
567 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
568 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppv
);
571 static ULONG WINAPI
OleInPlaceFrame_AddRef(IOleInPlaceFrame
*iface
)
573 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
574 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
577 static ULONG WINAPI
OleInPlaceFrame_Release(IOleInPlaceFrame
*iface
)
579 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
580 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
583 static HRESULT WINAPI
OleInPlaceFrame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phWnd
)
585 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
587 TRACE( "(%p,%p)\n", This
, phWnd
);
593 static HRESULT WINAPI
OleInPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame
*iface
, BOOL fEnterMode
)
595 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
597 FIXME( "(%p,%d) - stub\n", This
, fEnterMode
);
601 static HRESULT WINAPI
OleInPlaceFrame_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
603 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
605 FIXME( "(%p,%p) - stub\n", This
, lprectBorder
);
609 static HRESULT WINAPI
OleInPlaceFrame_RequestBorderSpace(IOleInPlaceFrame
*iface
, LPCBORDERWIDTHS pborderwidths
)
611 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
613 FIXME( "(%p,%p) - stub\n", This
, pborderwidths
);
617 static HRESULT WINAPI
OleInPlaceFrame_SetBorderSpace(IOleInPlaceFrame
*iface
, LPCBORDERWIDTHS pborderwidths
)
619 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
621 FIXME( "(%p,%p) - stub\n", This
, pborderwidths
);
625 static HRESULT WINAPI
OleInPlaceFrame_SetActiveObject(IOleInPlaceFrame
*iface
, IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
627 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
629 FIXME( "(%p,%p,%s) - stub\n", This
, pActiveObject
, debugstr_w(pszObjName
) );
633 static HRESULT WINAPI
OleInPlaceFrame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
, LPOLEMENUGROUPWIDTHS lpMenuWidths
)
635 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
637 FIXME( "(%p,%p,%p) - stub\n", This
, hmenuShared
, lpMenuWidths
);
641 static HRESULT WINAPI
OleInPlaceFrame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
, HOLEMENU holemenu
, HWND hwndActiveObject
)
643 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
645 FIXME( "(%p,%p,%p,%p) - stub\n", This
, hmenuShared
, holemenu
, hwndActiveObject
);
649 static HRESULT WINAPI
OleInPlaceFrame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
651 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
653 FIXME( "(%p, %p) - stub\n", This
, hmenuShared
);
657 static HRESULT WINAPI
OleInPlaceFrame_SetStatusText(IOleInPlaceFrame
*iface
, LPCOLESTR pszStatusText
)
659 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
661 FIXME( "(%p, %s) - stub\n", This
, debugstr_w( pszStatusText
) );
665 static HRESULT WINAPI
OleInPlaceFrame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
667 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
669 FIXME( "(%p, %d) - stub\n", This
, fEnable
);
673 static HRESULT WINAPI
OleInPlaceFrame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
, WORD wID
)
675 IOCS
*This
= impl_from_IOleInPlaceFrame(iface
);
677 FIXME( "(%p, %p, %x) - stub\n", This
, lpmsg
, wID
);
682 /****** IOleControlSite *******/
683 static inline IOCS
*impl_from_IOleControlSite(IOleControlSite
*iface
)
685 return CONTAINING_RECORD(iface
, IOCS
, IOleControlSite_iface
);
688 static HRESULT WINAPI
OleControlSite_QueryInterface(IOleControlSite
*iface
, REFIID riid
, void **ppv
)
690 IOCS
*This
= impl_from_IOleControlSite(iface
);
691 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppv
);
694 static ULONG WINAPI
OleControlSite_AddRef(IOleControlSite
*iface
)
696 IOCS
*This
= impl_from_IOleControlSite(iface
);
697 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
700 static ULONG WINAPI
OleControlSite_Release(IOleControlSite
*iface
)
702 IOCS
*This
= impl_from_IOleControlSite(iface
);
703 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
706 static HRESULT WINAPI
OleControlSite_OnControlInfoChanged( IOleControlSite
* This
)
711 static HRESULT WINAPI
OleControlSite_LockInPlaceActive( IOleControlSite
* This
, BOOL fLock
)
716 static HRESULT WINAPI
OleControlSite_GetExtendedControl( IOleControlSite
* This
, IDispatch
** ppDisp
)
721 static HRESULT WINAPI
OleControlSite_TransformCoords( IOleControlSite
* This
, POINTL
* pPtlHimetric
, POINTF
* pPtfContainer
, DWORD dwFlags
)
726 static HRESULT WINAPI
OleControlSite_TranslateAccelerator( IOleControlSite
* This
, MSG
* pMsg
, DWORD grfModifiers
)
731 static HRESULT WINAPI
OleControlSite_OnFocus( IOleControlSite
* This
, BOOL fGotFocus
)
736 static HRESULT WINAPI
OleControlSite_ShowPropertyFrame( IOleControlSite
* This
)
743 static const IOleClientSiteVtbl OleClientSite_vtbl
= {
744 OleClientSite_QueryInterface
,
745 OleClientSite_AddRef
,
746 OleClientSite_Release
,
747 OleClientSite_SaveObject
,
748 OleClientSite_GetMoniker
,
749 OleClientSite_GetContainer
,
750 OleClientSite_ShowObject
,
751 OleClientSite_OnShowWindow
,
752 OleClientSite_RequestNewObjectLayout
754 static const IOleContainerVtbl OleContainer_vtbl
= {
755 OleContainer_QueryInterface
,
757 OleContainer_Release
,
758 OleContainer_ParseDisplayName
,
759 OleContainer_EnumObjects
,
760 OleContainer_LockContainer
762 static const IOleInPlaceSiteWindowlessVtbl OleInPlaceSiteWindowless_vtbl
= {
763 OleInPlaceSiteWindowless_QueryInterface
,
764 OleInPlaceSiteWindowless_AddRef
,
765 OleInPlaceSiteWindowless_Release
,
766 OleInPlaceSiteWindowless_GetWindow
,
767 OleInPlaceSiteWindowless_ContextSensitiveHelp
,
768 OleInPlaceSiteWindowless_CanInPlaceActivate
,
769 OleInPlaceSiteWindowless_OnInPlaceActivate
,
770 OleInPlaceSiteWindowless_OnUIActivate
,
771 OleInPlaceSiteWindowless_GetWindowContext
,
772 OleInPlaceSiteWindowless_Scroll
,
773 OleInPlaceSiteWindowless_OnUIDeactivate
,
774 OleInPlaceSiteWindowless_OnInPlaceDeactivate
,
775 OleInPlaceSiteWindowless_DiscardUndoState
,
776 OleInPlaceSiteWindowless_DeactivateAndUndo
,
777 OleInPlaceSiteWindowless_OnPosRectChange
,
778 OleInPlaceSiteWindowless_OnInPlaceActivateEx
,
779 OleInPlaceSiteWindowless_OnInPlaceDeactivateEx
,
780 OleInPlaceSiteWindowless_RequestUIActivate
,
781 OleInPlaceSiteWindowless_CanWindowlessActivate
,
782 OleInPlaceSiteWindowless_GetCapture
,
783 OleInPlaceSiteWindowless_SetCapture
,
784 OleInPlaceSiteWindowless_GetFocus
,
785 OleInPlaceSiteWindowless_SetFocus
,
786 OleInPlaceSiteWindowless_GetDC
,
787 OleInPlaceSiteWindowless_ReleaseDC
,
788 OleInPlaceSiteWindowless_InvalidateRect
,
789 OleInPlaceSiteWindowless_InvalidateRgn
,
790 OleInPlaceSiteWindowless_ScrollRect
,
791 OleInPlaceSiteWindowless_AdjustRect
,
792 OleInPlaceSiteWindowless_OnDefWindowMessage
794 static const IOleInPlaceFrameVtbl OleInPlaceFrame_vtbl
=
796 OleInPlaceFrame_QueryInterface
,
797 OleInPlaceFrame_AddRef
,
798 OleInPlaceFrame_Release
,
799 OleInPlaceFrame_GetWindow
,
800 OleInPlaceFrame_ContextSensitiveHelp
,
801 OleInPlaceFrame_GetBorder
,
802 OleInPlaceFrame_RequestBorderSpace
,
803 OleInPlaceFrame_SetBorderSpace
,
804 OleInPlaceFrame_SetActiveObject
,
805 OleInPlaceFrame_InsertMenus
,
806 OleInPlaceFrame_SetMenu
,
807 OleInPlaceFrame_RemoveMenus
,
808 OleInPlaceFrame_SetStatusText
,
809 OleInPlaceFrame_EnableModeless
,
810 OleInPlaceFrame_TranslateAccelerator
812 static const IOleControlSiteVtbl OleControlSite_vtbl
=
814 OleControlSite_QueryInterface
,
815 OleControlSite_AddRef
,
816 OleControlSite_Release
,
817 OleControlSite_OnControlInfoChanged
,
818 OleControlSite_LockInPlaceActive
,
819 OleControlSite_GetExtendedControl
,
820 OleControlSite_TransformCoords
,
821 OleControlSite_TranslateAccelerator
,
822 OleControlSite_OnFocus
,
823 OleControlSite_ShowPropertyFrame
826 static void IOCS_OnSize( IOCS
* This
, LPCRECT rect
)
830 This
->size
.left
= rect
->left
; This
->size
.right
= rect
->right
; This
->size
.top
= rect
->top
; This
->size
.bottom
= rect
->bottom
;
832 if ( !This
->control
)
835 inPix
.cx
= rect
->right
- rect
->left
;
836 inPix
.cy
= rect
->bottom
- rect
->top
;
837 AtlPixelToHiMetric( &inPix
, &inHi
);
838 IOleObject_SetExtent( This
->control
, DVASPECT_CONTENT
, &inHi
);
840 if ( This
->fInPlace
)
842 IOleInPlaceObject
*wl
;
844 if ( SUCCEEDED( IOleObject_QueryInterface( This
->control
, &IID_IOleInPlaceObject
, (void**)&wl
) ) )
846 IOleInPlaceObject_SetObjectRects( wl
, rect
, rect
);
847 IOleInPlaceObject_Release( wl
);
852 static void IOCS_OnShow( IOCS
*This
, BOOL fShow
)
854 if (!This
->control
|| This
->fActive
|| !fShow
)
857 This
->fActive
= TRUE
;
860 static void IOCS_OnDraw( IOCS
*This
)
864 if ( !This
->control
|| !This
->fWindowless
)
867 if ( SUCCEEDED( IOleObject_QueryInterface( This
->control
, &IID_IViewObject
, (void**)&view
) ) )
869 HDC dc
= GetDC( This
->hWnd
);
872 rect
.left
= This
->size
.left
; rect
.top
= This
->size
.top
;
873 rect
.bottom
= This
->size
.bottom
; rect
.right
= This
->size
.right
;
875 IViewObject_Draw( view
, DVASPECT_CONTENT
, ~0, NULL
, NULL
, 0, dc
, &rect
, &rect
, NULL
, 0 );
876 IViewObject_Release( view
);
877 ReleaseDC( This
->hWnd
, dc
);
881 static LRESULT
IOCS_OnWndProc( IOCS
*This
, HWND hWnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
883 WNDPROC OrigWndProc
= This
->OrigWndProc
;
894 r
.right
= LOWORD( lParam
);
895 r
.bottom
= HIWORD( lParam
);
896 IOCS_OnSize( This
, &r
);
900 IOCS_OnShow( This
, (BOOL
) wParam
);
907 return CallWindowProcW( OrigWndProc
, hWnd
, uMsg
, wParam
, lParam
);
910 static LRESULT CALLBACK
AtlHost_wndproc( HWND hWnd
, UINT wMsg
, WPARAM wParam
, LPARAM lParam
)
912 IOCS
*This
= (IOCS
*) GetPropW( hWnd
, wine_atl_iocsW
);
913 return IOCS_OnWndProc( This
, hWnd
, wMsg
, wParam
, lParam
);
916 static HRESULT
IOCS_Attach( IOCS
*This
, HWND hWnd
, IUnknown
*pUnkControl
) /* subclass hWnd */
919 IUnknown_QueryInterface( pUnkControl
, &IID_IOleObject
, (void**)&This
->control
);
920 IOleObject_SetClientSite( This
->control
, &This
->IOleClientSite_iface
);
921 SetPropW( hWnd
, wine_atl_iocsW
, This
);
922 This
->OrigWndProc
= (WNDPROC
)SetWindowLongPtrW( hWnd
, GWLP_WNDPROC
, (ULONG_PTR
) AtlHost_wndproc
);
927 static HRESULT
IOCS_Init( IOCS
*This
)
930 static const WCHAR AXWIN
[] = {'A','X','W','I','N',0};
932 IOleObject_SetHostNames( This
->control
, AXWIN
, AXWIN
);
934 GetClientRect( This
->hWnd
, &rect
);
935 IOCS_OnSize( This
, &rect
);
936 IOleObject_DoVerb( This
->control
, OLEIVERB_INPLACEACTIVATE
, NULL
, &This
->IOleClientSite_iface
,
937 0, This
->hWnd
, &rect
);
942 /**********************************************************************
943 * Create new instance of Atl host component and attach it to window *
945 static HRESULT
IOCS_Create( HWND hWnd
, IUnknown
*pUnkControl
, IUnknown
**container
)
954 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(IOCS
));
957 return E_OUTOFMEMORY
;
959 This
->IOleClientSite_iface
.lpVtbl
= &OleClientSite_vtbl
;
960 This
->IOleContainer_iface
.lpVtbl
= &OleContainer_vtbl
;
961 This
->IOleInPlaceSiteWindowless_iface
.lpVtbl
= &OleInPlaceSiteWindowless_vtbl
;
962 This
->IOleInPlaceFrame_iface
.lpVtbl
= &OleInPlaceFrame_vtbl
;
963 This
->IOleControlSite_iface
.lpVtbl
= &OleControlSite_vtbl
;
966 This
->OrigWndProc
= NULL
;
968 This
->fWindowless
= This
->fActive
= This
->fInPlace
= FALSE
;
970 hr
= IOCS_Attach( This
, hWnd
, pUnkControl
);
971 if ( SUCCEEDED( hr
) )
972 hr
= IOCS_Init( This
);
973 if ( SUCCEEDED( hr
) )
974 *container
= (IUnknown
*)&This
->IOleClientSite_iface
;
978 HeapFree(GetProcessHeap(), 0, This
);
985 /***********************************************************************
986 * AtlAxCreateControl [atl100.@]
988 HRESULT WINAPI
AtlAxCreateControl(LPCOLESTR lpszName
, HWND hWnd
,
989 IStream
*pStream
, IUnknown
**ppUnkContainer
)
991 return AtlAxCreateControlEx( lpszName
, hWnd
, pStream
, ppUnkContainer
,
1004 static enum content
get_content_type(LPCOLESTR name
, CLSID
*control_id
)
1006 WCHAR new_urlW
[MAX_PATH
];
1007 DWORD size
= MAX_PATH
;
1008 WCHAR mshtml_prefixW
[] = {'m','s','h','t','m','l',':','\0'};
1010 if (!name
|| !name
[0])
1012 WARN("name %s\n", wine_dbgstr_w(name
));
1016 if (CLSIDFromString(name
, control_id
) == S_OK
||
1017 CLSIDFromProgID(name
, control_id
) == S_OK
)
1020 if (PathIsURLW (name
) ||
1021 UrlApplySchemeW(name
, new_urlW
, &size
, URL_APPLY_GUESSSCHEME
|URL_APPLY_GUESSFILE
) == S_OK
)
1023 *control_id
= CLSID_WebBrowser
;
1027 if (!strncmpiW(name
, mshtml_prefixW
, 7))
1029 FIXME("mshtml prefix not implemented\n");
1030 *control_id
= CLSID_WebBrowser
;
1037 /***********************************************************************
1038 * AtlAxCreateControlLicEx [atl100.@]
1041 * See http://www.codeproject.com/com/cwebpage.asp for some background
1044 HRESULT WINAPI
AtlAxCreateControlLicEx(LPCOLESTR lpszName
, HWND hWnd
,
1045 IStream
*pStream
, IUnknown
**ppUnkContainer
, IUnknown
**ppUnkControl
,
1046 REFIID iidSink
, IUnknown
*punkSink
, BSTR lic
)
1050 IOleObject
*pControl
;
1051 IUnknown
*pUnkControl
= NULL
;
1052 IPersistStreamInit
*pPSInit
;
1053 IUnknown
*pContainer
= NULL
;
1054 enum content content
;
1056 TRACE("(%s %p %p %p %p %p %p %s)\n", debugstr_w(lpszName
), hWnd
, pStream
,
1057 ppUnkContainer
, ppUnkControl
, iidSink
, punkSink
, debugstr_w(lic
));
1060 FIXME("semi stub\n");
1062 if (ppUnkContainer
) *ppUnkContainer
= NULL
;
1063 if (ppUnkControl
) *ppUnkControl
= NULL
;
1065 content
= get_content_type(lpszName
, &controlId
);
1067 if (content
== IsEmpty
)
1070 if (content
== IsUnknown
)
1071 return CO_E_CLASSSTRING
;
1073 hRes
= CoCreateInstance( &controlId
, 0, CLSCTX_ALL
, &IID_IOleObject
,
1074 (void**) &pControl
);
1075 if ( FAILED( hRes
) )
1077 WARN( "cannot create ActiveX control %s instance - error 0x%08x\n",
1078 debugstr_guid( &controlId
), hRes
);
1082 hRes
= IOleObject_QueryInterface( pControl
, &IID_IPersistStreamInit
, (void**) &pPSInit
);
1083 if ( SUCCEEDED( hRes
) )
1086 IPersistStreamInit_InitNew( pPSInit
);
1088 IPersistStreamInit_Load( pPSInit
, pStream
);
1089 IPersistStreamInit_Release( pPSInit
);
1091 WARN("cannot get IID_IPersistStreamInit out of control\n");
1093 IOleObject_QueryInterface( pControl
, &IID_IUnknown
, (void**) &pUnkControl
);
1094 IOleObject_Release( pControl
);
1097 hRes
= AtlAxAttachControl( pUnkControl
, hWnd
, &pContainer
);
1098 if ( FAILED( hRes
) )
1099 WARN("cannot attach control to window\n");
1101 if ( content
== IsURL
)
1103 IWebBrowser2
*browser
;
1105 hRes
= IOleObject_QueryInterface( pControl
, &IID_IWebBrowser2
, (void**) &browser
);
1107 WARN( "Cannot query IWebBrowser2 interface: %08x\n", hRes
);
1111 IWebBrowser2_put_Visible( browser
, VARIANT_TRUE
); /* it seems that native does this on URL (but do not on MSHTML:! why? */
1113 V_VT(&url
) = VT_BSTR
;
1114 V_BSTR(&url
) = SysAllocString( lpszName
);
1116 hRes
= IWebBrowser2_Navigate2( browser
, &url
, NULL
, NULL
, NULL
, NULL
);
1117 if ( FAILED( hRes
) )
1118 WARN( "IWebBrowser2::Navigate2 failed: %08x\n", hRes
);
1119 SysFreeString( V_BSTR(&url
) );
1121 IWebBrowser2_Release( browser
);
1127 *ppUnkContainer
= pContainer
;
1129 IUnknown_AddRef( pContainer
);
1133 *ppUnkControl
= pUnkControl
;
1135 IUnknown_AddRef( pUnkControl
);
1139 IUnknown_Release( pUnkControl
);
1141 IUnknown_Release( pContainer
);
1146 /***********************************************************************
1147 * AtlAxAttachControl [atl100.@]
1149 HRESULT WINAPI
AtlAxAttachControl(IUnknown
*control
, HWND hWnd
, IUnknown
**container
)
1153 TRACE("(%p %p %p)\n", control
, hWnd
, container
);
1156 return E_INVALIDARG
;
1158 hr
= IOCS_Create( hWnd
, control
, container
);
1159 return hWnd
? hr
: S_FALSE
;
1162 /**********************************************************************
1163 * Helper function for AX_ConvertDialogTemplate
1165 static inline BOOL
advance_array(WORD
**pptr
, DWORD
*palloc
, DWORD
*pfilled
, const WORD
*data
, DWORD size
)
1167 if ( (*pfilled
+ size
) > *palloc
)
1169 *palloc
= ((*pfilled
+size
) + 0xFF) & ~0xFF;
1170 *pptr
= HeapReAlloc( GetProcessHeap(), 0, *pptr
, *palloc
* sizeof(WORD
) );
1174 RtlMoveMemory( *pptr
+*pfilled
, data
, size
* sizeof(WORD
) );
1179 /**********************************************************************
1180 * Convert ActiveX control templates to AtlAxWin class instances
1182 static LPDLGTEMPLATEW
AX_ConvertDialogTemplate(LPCDLGTEMPLATEW src_tmpl
)
1184 #define GET_WORD(x) (*(const WORD *)(x))
1185 #define GET_DWORD(x) (*(const DWORD *)(x))
1186 #define PUT_BLOCK(x,y) do {if (!advance_array(&output, &allocated, &filled, (x), (y))) return NULL;} while (0)
1187 #define PUT_WORD(x) do {WORD w = (x);PUT_BLOCK(&w, 1);} while(0)
1188 const WORD
*tmp
, *src
= (const WORD
*)src_tmpl
;
1190 DWORD allocated
, filled
; /* in WORDs */
1192 WORD signature
, dlgver
, rescount
;
1195 filled
= 0; allocated
= 256;
1196 output
= HeapAlloc( GetProcessHeap(), 0, allocated
* sizeof(WORD
) );
1202 signature
= GET_WORD(src
);
1203 dlgver
= GET_WORD(src
+ 1);
1204 if (signature
== 1 && dlgver
== 0xFFFF)
1208 style
= GET_DWORD(src
);
1210 rescount
= GET_WORD(src
++);
1212 if ( GET_WORD(src
) == 0xFFFF ) /* menu */
1215 src
+= strlenW(src
) + 1;
1216 if ( GET_WORD(src
) == 0xFFFF ) /* class */
1219 src
+= strlenW(src
) + 1;
1220 src
+= strlenW(src
) + 1; /* title */
1221 if ( style
& (DS_SETFONT
| DS_SHELLFONT
) )
1224 src
+= strlenW(src
) + 1;
1228 style
= GET_DWORD(src
);
1230 rescount
= GET_WORD(src
++);
1232 if ( GET_WORD(src
) == 0xFFFF ) /* menu */
1235 src
+= strlenW(src
) + 1;
1236 if ( GET_WORD(src
) == 0xFFFF ) /* class */
1239 src
+= strlenW(src
) + 1;
1240 src
+= strlenW(src
) + 1; /* title */
1241 if ( style
& DS_SETFONT
)
1244 src
+= strlenW(src
) + 1;
1247 PUT_BLOCK(tmp
, src
-tmp
);
1251 src
= (const WORD
*)( ( ((ULONG_PTR
)src
) + 3) & ~3); /* align on DWORD boundary */
1252 filled
= (filled
+ 1) & ~1; /* depends on DWORD-aligned allocation unit */
1259 PUT_BLOCK(tmp
, src
-tmp
);
1262 if ( GET_WORD(src
) == 0xFFFF ) /* class */
1267 src
+= strlenW(src
) + 1;
1269 src
+= strlenW(src
) + 1; /* title */
1270 if ( GET_WORD(tmp
) == '{' ) /* all this mess created because of this line */
1272 static const WCHAR AtlAxWin
[] = {'A','t','l','A','x','W','i','n', 0};
1273 PUT_BLOCK(AtlAxWin
, sizeof(AtlAxWin
)/sizeof(WCHAR
));
1274 PUT_BLOCK(tmp
, strlenW(tmp
)+1);
1276 PUT_BLOCK(tmp
, src
-tmp
);
1278 if ( GET_WORD(src
) )
1280 WORD size
= (GET_WORD(src
)+sizeof(WORD
)-1) / sizeof(WORD
); /* quite ugly :( Maybe use BYTE* instead of WORD* everywhere ? */
1281 PUT_BLOCK(src
, size
);
1290 return (LPDLGTEMPLATEW
) output
;
1293 /***********************************************************************
1294 * AtlAxCreateDialogA [atl100.@]
1296 * Creates a dialog window
1299 * hInst [I] Application instance
1300 * name [I] Dialog box template name
1301 * owner [I] Dialog box parent HWND
1302 * dlgProc [I] Dialog box procedure
1303 * param [I] This value will be passed to dlgProc as WM_INITDIALOG's message lParam
1306 * Window handle of dialog window.
1308 HWND WINAPI
AtlAxCreateDialogA(HINSTANCE hInst
, LPCSTR name
, HWND owner
, DLGPROC dlgProc
,LPARAM param
)
1314 if (IS_INTRESOURCE(name
))
1315 return AtlAxCreateDialogW( hInst
, (LPCWSTR
) name
, owner
, dlgProc
, param
);
1317 length
= MultiByteToWideChar( CP_ACP
, 0, name
, -1, NULL
, 0 );
1318 nameW
= HeapAlloc( GetProcessHeap(), 0, length
* sizeof(WCHAR
) );
1321 MultiByteToWideChar( CP_ACP
, 0, name
, -1, nameW
, length
);
1322 res
= AtlAxCreateDialogW( hInst
, nameW
, owner
, dlgProc
, param
);
1323 HeapFree( GetProcessHeap(), 0, nameW
);
1328 /***********************************************************************
1329 * AtlAxCreateDialogW [atl100.@]
1331 * See AtlAxCreateDialogA
1334 HWND WINAPI
AtlAxCreateDialogW(HINSTANCE hInst
, LPCWSTR name
, HWND owner
, DLGPROC dlgProc
,LPARAM param
)
1338 LPCDLGTEMPLATEW ptr
;
1339 LPDLGTEMPLATEW newptr
;
1342 TRACE("(%p %s %p %p %lx)\n", hInst
, debugstr_w(name
), owner
, dlgProc
, param
);
1344 hrsrc
= FindResourceW( hInst
, name
, (LPWSTR
)RT_DIALOG
);
1347 hgl
= LoadResource (hInst
, hrsrc
);
1350 ptr
= LockResource ( hgl
);
1353 FreeResource( hgl
);
1356 newptr
= AX_ConvertDialogTemplate( ptr
);
1359 res
= CreateDialogIndirectParamW( hInst
, newptr
, owner
, dlgProc
, param
);
1360 HeapFree( GetProcessHeap(), 0, newptr
);
1363 FreeResource ( hrsrc
);
1367 /***********************************************************************
1368 * AtlAxGetHost [atl100.@]
1371 HRESULT WINAPI
AtlAxGetHost(HWND hWnd
, IUnknown
**host
)
1375 TRACE("(%p, %p)\n", hWnd
, host
);
1379 This
= (IOCS
*) GetPropW( hWnd
, wine_atl_iocsW
);
1382 WARN("No container attached to %p\n", hWnd
);
1386 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, &IID_IUnknown
, (void**)host
);
1389 /***********************************************************************
1390 * AtlAxGetControl [atl100.@]
1393 HRESULT WINAPI
AtlAxGetControl(HWND hWnd
, IUnknown
**pUnk
)
1397 TRACE( "(%p, %p)\n", hWnd
, pUnk
);
1401 This
= (IOCS
*) GetPropW( hWnd
, wine_atl_iocsW
);
1402 if ( !This
|| !This
->control
)
1404 WARN("No control attached to %p\n", hWnd
);
1408 return IOleObject_QueryInterface( This
->control
, &IID_IUnknown
, (void**) pUnk
);
1411 /***********************************************************************
1412 * AtlAxDialogBoxW [atl100.35]
1415 INT_PTR WINAPI
AtlAxDialogBoxW(HINSTANCE hInstance
, LPCWSTR lpTemplateName
, HWND hWndParent
, DLGPROC lpDialogProc
,
1418 FIXME("(%p %s %p %p %lx)\n", hInstance
, debugstr_w(lpTemplateName
), hWndParent
, lpDialogProc
, dwInitParam
);
1422 /***********************************************************************
1423 * AtlAxDialogBoxA [atl100.36]
1426 INT_PTR WINAPI
AtlAxDialogBoxA(HINSTANCE hInstance
, LPCSTR lpTemplateName
, HWND hWndParent
, DLGPROC lpDialogProc
,
1429 FIXME("(%p %s %p %p %lx)\n", hInstance
, debugstr_a(lpTemplateName
), hWndParent
, lpDialogProc
, dwInitParam
);
1433 /***********************************************************************
1434 * AtlAxCreateControlLic [atl100.59]
1437 HRESULT WINAPI
AtlAxCreateControlLic(const WCHAR
*lpTricsData
, HWND hwnd
, IStream
*stream
, IUnknown
**container
, BSTR lic
)
1439 return AtlAxCreateControlLicEx(lpTricsData
, hwnd
, stream
, container
, NULL
, NULL
, NULL
, lic
);
1442 /***********************************************************************
1443 * AtlAxCreateControlEx [atl100.@]
1446 HRESULT WINAPI
AtlAxCreateControlEx(const WCHAR
*lpTricsData
, HWND hwnd
, IStream
*stream
,
1447 IUnknown
**container
, IUnknown
**control
, REFIID iidSink
, IUnknown
*punkSink
)
1449 return AtlAxCreateControlLicEx(lpTricsData
, hwnd
, stream
, container
, control
, iidSink
, punkSink
, NULL
);