src/mess/tools/imgtool/windows/assocdlg.c
| r7901 | r7902 | |
| 126 | 126 | break; |
| 127 | 127 | |
| 128 | 128 | case WM_COMMAND: |
| 129 | | if (HIWORD(wparam) == BN_CLICKED) |
| 130 | | { |
| 131 | | l = GetWindowLongPtr(dialog, GWLP_USERDATA); |
| 132 | | dlginfo = (assocdlg_info *) l; |
| 133 | | id = LOWORD(wparam); |
| 129 | id = LOWORD(wparam); |
| 134 | 130 | |
| 135 | | if ((id == IDOK) || (id == IDCANCEL)) |
| 131 | if ((id == IDOK) || (id == IDCANCEL)) |
| 132 | { |
| 133 | if (id == IDOK) |
| 136 | 134 | { |
| 137 | | if (id == IDOK) |
| 135 | l = GetWindowLongPtr(dialog, GWLP_USERDATA); |
| 136 | dlginfo = (assocdlg_info *)l; |
| 137 | |
| 138 | for (i = 0; i < dlginfo->extension_count; i++) |
| 138 | 139 | { |
| 139 | | for (i = 0; i < dlginfo->extension_count; i++) |
| 140 | | { |
| 141 | | is_set = SendMessage(GetDlgItem(dialog, CONTROL_START + i), BM_GETCHECK, 0, 0); |
| 140 | is_set = SendMessage(GetDlgItem(dialog, CONTROL_START + i), BM_GETCHECK, 0, 0); |
| 142 | 141 | |
| 143 | | t_extension = tstring_from_utf8(dlginfo->extensions[i]); |
| 144 | | _sntprintf(buf, ARRAY_LENGTH(buf), TEXT(".%s"), t_extension); |
| 145 | | free(t_extension); |
| 146 | | currently_set = win_is_extension_associated(&assoc_info, buf); |
| 142 | t_extension = tstring_from_utf8(dlginfo->extensions[i]); |
| 143 | _sntprintf(buf, ARRAY_LENGTH(buf), TEXT(".%s"), t_extension); |
| 144 | free(t_extension); |
| 145 | currently_set = win_is_extension_associated(&assoc_info, buf); |
| 147 | 146 | |
| 148 | | if (is_set && !currently_set) |
| 149 | | win_associate_extension(&assoc_info, buf, TRUE); |
| 150 | | else if (!is_set && currently_set) |
| 151 | | win_associate_extension(&assoc_info, buf, FALSE); |
| 152 | | } |
| 147 | if (is_set && !currently_set) |
| 148 | win_associate_extension(&assoc_info, buf, TRUE); |
| 149 | else if (!is_set && currently_set) |
| 150 | win_associate_extension(&assoc_info, buf, FALSE); |
| 153 | 151 | } |
| 154 | | |
| 155 | | EndDialog(dialog, id); |
| 156 | 152 | } |
| 153 | |
| 154 | EndDialog(dialog, id); |
| 157 | 155 | } |
| 158 | 156 | break; |
| 159 | 157 | } |