Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scolling behaviour with network discovery #1886

Open
dcoder42 opened this issue Mar 29, 2024 · 0 comments
Open

Fix scolling behaviour with network discovery #1886

dcoder42 opened this issue Mar 29, 2024 · 0 comments
Labels
Enhancement/Feature Request An Enhancement/Feature request by the community

Comments

@dcoder42
Copy link

Is your feature request related to a problem? Please describe.

The "FixFolderScroll" setting is fixing a scrolling issue when double clicking an item in the left treeview in Windows Explorer but there is another issue (at least) in Windows 10 that is also causing these unwanted scroll effects. When Samba servers are available on the network and you open Explorer for the first time the Explorer scans for Samba machines on the network and after some time they are added to the Network folder on the bottom. This causes unwanted scrolling behaviour. I fixed this by not allowing items to be added to the Network folder when the Network folder is not being selected.

LRESULT CALLBACK CExplorerBHO::SubclassTreeProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData )
{
	if (GetTlsData()->bho == NULL)
		return DefSubclassProc(hWnd, uMsg, wParam, lParam);

	if (uMsg==TVM_EXPAND)
	{
		HTREEITEM hItem=(HTREEITEM)lParam;

		wchar_t szText[256];
		memset(szText, 0, sizeof(szText));

		TV_ITEM tvi;
		tvi.mask = TVIF_TEXT | TVIF_HANDLE;
		tvi.hItem=hItem;
		tvi.cchTextMax = 256;
		tvi.pszText = szText;
		SendMessage(hWnd, TVM_GETITEM, 0, (WPARAM)&tvi);
		USES_CONVERSION;
		char* pszText = W2A(szText);

		__int64 nParent = (__int64)TreeView_GetParent(hWnd, hItem);
		__int64 nParent2 = (__int64)TreeView_GetParent(hWnd, nParent);

		if ((TVE_EXPAND == wParam) && !((tvi.state & TVIS_SELECTED)&TVIS_SELECTED))
		{
			if ((0 == strcmp(pszText, "Netzwerk")) || (0 == strcmp(pszText, "Network")))
			{
				if (nParent2 == 0)
					return 0;
			}
		}
	}
	...

Maybe something like this can be added as an option to Open-Shell. Unfortunately i did not find a translated resource of "Network" so i hardcoded it...

Describe the solution you'd like


Area of issue

Windows Explorer

Alternatives you've considered

No response

Additional context

No response

@dcoder42 dcoder42 added the Enhancement/Feature Request An Enhancement/Feature request by the community label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement/Feature Request An Enhancement/Feature request by the community
Projects
None yet
Development

No branches or pull requests

1 participant