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

[NETSHELL] LanStatusUI: Fix the Network Connection Systray icon opening several dialog windows when cable isn't connected #6905

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Connierollstheball
Copy link
Contributor

Purpose

Prevents the Icon from opening up more than one window + Changes the window that's opened from the Connection Properties dialog to the Network Connections Folder (like in Server '03, which is the expected result as per the JIRA issue).

JIRA issue: CORE-19562

Proposed changes

  • Changes the window being opened by the Disconnected Systray icon from the Connection Properties Dialog for the respective Adapter to the Network Connections Folder.
  • Prevents the icon from opening the window more than once (if it's already open, find it and bring it to the top instead).

@github-actions github-actions bot added the shell All PR's related to the shell (and shell extensions) label May 18, 2024
WCHAR buffer[100];

LoadStringW(netshell_hInstance, IDS_NETWORKCONNECTION, buffer, _countof(buffer));
HWND prophwnd = FindWindow(NULL, buffer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes assumptions about how Explorer formats its window titles? IShellWindows is a lot more work so I guess we can let it slide for now.

dll/shellext/netshell/lanstatusui.cpp Outdated Show resolved Hide resolved
@binarymaster binarymaster added the bugfix For bugfix PRs. label May 18, 2024
@binarymaster binarymaster added this to New PRs in ReactOS PRs via automation May 18, 2024
dll/shellext/netshell/lanstatusui.cpp Outdated Show resolved Hide resolved
dll/shellext/netshell/lanstatusui.cpp Outdated Show resolved Hide resolved
ReactOS PRs automation moved this from New PRs to WIP / Waiting on contributor May 19, 2024
Copy link
Member

@GeoB99 GeoB99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
Thanks for your interest in ReactOS!
We ask our contributors to use their full real name when committing.
Please amend your commit with your full name, and update this PR.

To change this for future PR's, you can update it for globally (for the system):

git config --global user.name "Your Name"
git config --global user.email you@example.com

Or just for the current repository:

git config user.name "Your Name"
git config user.email you@example.com

Also please update your name in GitHub profile settings.

Regards.
GeoB99

@Connierollstheball
Copy link
Contributor Author

I should've sent this when I actually did the commits yesterday, but everything should be okay now.
Besides that, I'll wait until CSIDL_CONNECTIONS is fixed by someone else and then I'll also implement the ShellExecuteEx thingy.

@whindsaks
Copy link
Contributor

I'll wait until CSIDL_CONNECTIONS is fixed

You may continue now.

Comment on lines 824 to 827
LoadStringW(netshell_hInstance, IDS_NETWORKCONNECTION, buffer, _countof(buffer));
HWND hWndProp = FindWindow(NULL, buffer);

/* If the window is already opened, prevent it from opening again */
if (hWndProp != NULL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LoadStringW(netshell_hInstance, IDS_NETWORKCONNECTION, buffer, _countof(buffer));
HWND hWndProp = FindWindow(NULL, buffer);
/* If the window is already opened, prevent it from opening again */
if (hWndProp != NULL)
/* If the window is already opened, prevent it from opening again */
LoadStringW(netshell_hInstance, IDS_NETWORKCONNECTION, buffer, _countof(buffer));
HWND hWndProp = FindWindow(NULL, buffer);
if (hWndProp)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the window is already opened, prevent it from opening again

Granted, the way it is currently done is sensitive to the current UI language being used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think shell32 is supposed to check IShellWindows to see if the PIDL is already open somewhere when the reuse windows option is on. I don't think shdocvw implements the window list yet so the hack this PR is using is good enough for now.

@HBelusca HBelusca requested review from GeoB99 and whindsaks May 24, 2024 13:58
Copy link
Contributor

@tkreuzer tkreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code lgtm, but it needs to be sqashed into one commit and meet our standards for commit mesages.
For @Connierollstheball: You can do that yourself or ask for a merger to do so.
For anyone who wants to merge this: make sure to squash and fix the commit message, then you can ignore this request for change.

@Connierollstheball
Copy link
Contributor Author

I'll just let a merger (I don't know who exactly I could ask in particular for this) do whatever needs to be done so this PR can be merged.

Copy link
Member

@GeoB99 GeoB99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still haven't amended your PR to use your real name.
Capture
Please follow our contribution guidelines if you want your patch to get shipped, otherwise it won't get accepted. Thanks for your understanding.

@Connierollstheball
Copy link
Contributor Author

Sorry, I realised I missed a few steps when I was changing my git name to my full name and ammending it to the PR 😅
Everything should actually be good to go now, I made sure to follow everything correctly when updating this to my full name.

@HBelusca HBelusca requested a review from GeoB99 May 30, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix For bugfix PRs. shell All PR's related to the shell (and shell extensions)
Projects
ReactOS PRs
  
WIP / Waiting on contributor
6 participants