|
回 nevcry 的帖子
nevcry:求教版主 如何利用SetWindowPos api 来实现 画面铺满窗口呢?即播放器里边的全屏幕拉伸模式..
1、如果你是根据APlayer.dll文件来创建APlayer的,可创建个AxWindow关联,然后设置该Window,大致代码: - m_hModule = ::LoadLibraryEx(pcszPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
- ...
- hr = spCF->CreateInstance(pUnkOuter, __uuidof(APlayer3Lib::IPlayer), m_pAPlayer);
- m_hAPlayerWnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, _T("AtlAxWin71"), _T(""), WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, g_hWnd, NULL, NULL, NULL);
- hr = AtlAxAttachControl(m_pAPlayer, m_hAPlayerWnd, NULL);
- ...
- SetWindowPos(m_hAPlayerWnd, ...); // 可设置位置
2、如果你是根据注册表来创建APlayer的,更方便了,大致代码: - m_hAPlayerWnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, _T(ATLAXWIN_CLASS), _T("APlayer3.Player"), WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, m_hWnd, NULL, NULL, NULL);
- SetWindowPos(m_hAPlayerWnd, HWND_TOPMOST, 0, 0, iWidth, iHeight, SWP_SHOWWINDOW);
|