mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 16:32:57 +00:00
[SHELL32] Implement and use SHOpenPropSheet (#7432)
- Implement SHOpenPropSheetW. - Reuse already opened propertysheets and format dialogs by finding the existing unique stub window. - Default .lnk property dialog to the shortcut tab.
This commit is contained in:
parent
53f498c968
commit
2aadf2eb26
22 changed files with 577 additions and 596 deletions
|
@ -9,6 +9,39 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
HWND
|
||||
CStubWindow32::FindStubWindow(UINT Type, LPCWSTR Path)
|
||||
{
|
||||
for (HWND hWnd, hWndAfter = NULL;;)
|
||||
{
|
||||
hWnd = hWndAfter = FindWindowExW(NULL, hWndAfter, CSTUBWINDOW32_CLASSNAME, Path);
|
||||
if (!hWnd || !Path)
|
||||
return NULL;
|
||||
if (GetPropW(hWnd, GetTypePropName()) == ULongToHandle(Type))
|
||||
return hWnd;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT
|
||||
CStubWindow32::CreateStub(UINT Type, LPCWSTR Path, const POINT *pPt)
|
||||
{
|
||||
if (HWND hWnd = FindStubWindow(Type, Path))
|
||||
{
|
||||
::SwitchToThisWindow(::GetLastActivePopup(hWnd), TRUE);
|
||||
return HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS);
|
||||
}
|
||||
RECT rcPosition = { pPt ? pPt->x : CW_USEDEFAULT, pPt ? pPt->y : CW_USEDEFAULT, 0, 0 };
|
||||
DWORD Style = WS_DISABLED | WS_CLIPSIBLINGS | WS_CAPTION;
|
||||
DWORD ExStyle = WS_EX_WINDOWEDGE | WS_EX_APPWINDOW;
|
||||
if (!Create(NULL, rcPosition, Path, Style, ExStyle))
|
||||
{
|
||||
ERR("StubWindow32 creation failed\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
::SetPropW(*this, GetTypePropName(), ULongToHandle(Type));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
SHILClone(
|
||||
_In_opt_ LPCITEMIDLIST pidl,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue