return true;
}
+static BOOL CALLBACK ShowChildWindow(HWND hWnd, LPARAM lParam)
+{
+ ShowWindow(hWnd, static_cast<int>(lParam));
+ return TRUE;
+}
+
INT_PTR CALLBACK Settings_BluetoothDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
ListBox_GetCount(hList) > 0);
if (!IsBluetoothAvailable()) {
- ShowWindow(GetDlgItem(hDlg, IDC_STATIC_BLUETOOTH_NOT_AVAILABLE), SW_SHOW);
+ // Set defaults
Button_SetCheck(GetDlgItem(hDlg, IDC_ENABLE_BLUETOOTH_MUTE), BST_UNCHECKED);
Button_Enable(GetDlgItem(hDlg, IDC_ENABLE_BLUETOOTH_MUTE), FALSE);
Button_SetCheck(GetDlgItem(hDlg, IDC_ENABLE_BLUETOOTH_MUTE_DEVICE_LIST), BST_UNCHECKED);
Button_Enable(GetDlgItem(hDlg, IDC_ENABLE_BLUETOOTH_MUTE_DEVICE_LIST), FALSE);
- }
- else {
+
+ // Hide all child windows, except the notice
+ EnumChildWindows(hDlg, ShowChildWindow, SW_HIDE);
+
+ HWND hBtNotAvail = GetDlgItem(hDlg, IDC_STATIC_BLUETOOTH_NOT_AVAILABLE);
+ RECT r;
+ GetClientRect(hBtNotAvail, &r);
+ const int margin = 20;
+ SetWindowPos(
+ hBtNotAvail, HWND_TOP,
+ margin, margin, r.right, r.bottom,
+ SWP_SHOWWINDOW);
+ } else {
ShowWindow(GetDlgItem(hDlg, IDC_STATIC_BLUETOOTH_NOT_AVAILABLE), SW_HIDE);
}
return TRUE;
return true;
}
+static BOOL CALLBACK ShowChildWindow(HWND hWnd, LPARAM lParam)
+{
+ ShowWindow(hWnd, static_cast<int>(lParam));
+ return TRUE;
+}
+
INT_PTR CALLBACK Settings_WifiDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
ListBox_GetCount(hList) > 0);
if (!IsWlanAvailable()) {
- ShowWindow(GetDlgItem(hDlg, IDC_STATIC_WLAN_NOT_AVAILABLE), SW_SHOW);
+ // Set defaults
Button_SetCheck(GetDlgItem(hDlg, IDC_ENABLE_WIFI_MUTE), BST_UNCHECKED);
Button_Enable(GetDlgItem(hDlg, IDC_ENABLE_WIFI_MUTE), FALSE);
Button_SetCheck(GetDlgItem(hDlg, IDC_IS_PERMITLIST), BST_UNCHECKED);
Button_Enable(GetDlgItem(hDlg, IDC_IS_PERMITLIST), FALSE);
- }
- else {
+
+ // Hide all child windows, except the notice
+ EnumChildWindows(hDlg, ShowChildWindow, SW_HIDE);
+
+ HWND hWifiNotAvail = GetDlgItem(hDlg, IDC_STATIC_WLAN_NOT_AVAILABLE);
+ RECT r;
+ GetClientRect(hWifiNotAvail, &r);
+ const int margin = 20;
+ SetWindowPos(
+ hWifiNotAvail, HWND_TOP,
+ margin, margin, r.right, r.bottom,
+ SWP_SHOWWINDOW);
+ } else {
ShowWindow(GetDlgItem(hDlg, IDC_STATIC_WLAN_NOT_AVAILABLE), SW_HIDE);
}
return TRUE;
if (isMuteList_ && it != std::end(networks_)
|| !isMuteList_ && it == std::end(networks_)) {
size_t profileNameLen = lstrlen(net->strProfileName);
- TCHAR* wiFiName = new TCHAR[profileNameLen + 1];
+ wchar_t* wiFiName = new wchar_t[profileNameLen + 1];
StringCchCopy(wiFiName, profileNameLen + 1, net->strProfileName);
SendMessage(hNotifyWnd_, WM_WIFISTATUSCHANGED, 1,
reinterpret_cast<LPARAM>(wiFiName));
if (isMuteList_ && it != std::end(networks_)
|| !isMuteList_ && it == std::end(networks_)) {
size_t profileNameLen = lstrlen(wcnd->strProfileName);
- TCHAR* wiFiName = new TCHAR[profileNameLen + 1];
+ wchar_t* wiFiName = new wchar_t[profileNameLen + 1];
StringCchCopy(wiFiName, profileNameLen + 1, wcnd->strProfileName);
SendMessage(hNotifyWnd_, WM_WIFISTATUSCHANGED, connected,
reinterpret_cast<LPARAM>(wiFiName));