@@ -248,7 +248,8 @@ INT_PTR CALLBACK popup(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
248
248
case WM_COMMAND:
249
249
if (HIWORD (wParam) == LBN_SELCHANGE)
250
250
{
251
- capturing_WnE = -5 ;
251
+ if (capturing_WnE == -4 ) capturing_WnE = -5 ;
252
+ else if (capturing_WnE == -6 ) capturing_WnE = -7 ;
252
253
EnableWindow (GetDlgItem (hDlg, IDC_TEST), TRUE );
253
254
break ;
254
255
}
@@ -268,6 +269,17 @@ INT_PTR CALLBACK popup(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
268
269
ShowWindow (GetDlgItem (hDlg, IDC_ERASER), SW_SHOW);
269
270
capturing_WnE = 0 ;
270
271
}
272
+ if (capturing_WnE == -6 || capturing_WnE == -7 )
273
+ {
274
+ ShowWindow (GetDlgItem (hDlg, IDC_LIST1), SW_HIDE);
275
+ ShowWindow (GetDlgItem (hDlg, IDC_S7), SW_SHOW);
276
+ ShowWindow (GetDlgItem (hDlg, IDC_S8), SW_SHOW);
277
+ ShowWindow (GetDlgItem (hDlg, IDC_S9), SW_SHOW);
278
+ ShowWindow (GetDlgItem (hDlg, IDC_WINDOW), SW_SHOW);
279
+ ShowWindow (GetDlgItem (hDlg, IDC_PEN), SW_SHOW);
280
+ ShowWindow (GetDlgItem (hDlg, IDC_ERASER), SW_SHOW);
281
+ capturing_WnE = -1 ;
282
+ }
271
283
EnableWindow (GetDlgItem (hDlg, IDC_SAVE), FALSE );
272
284
EnableWindow (GetDlgItem (hDlg, IDC_START), FALSE );
273
285
EnableWindow (GetDlgItem (hDlg, IDC_TEST), FALSE );
@@ -293,8 +305,8 @@ INT_PTR CALLBACK popup(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
293
305
}
294
306
case IDC_TEST:
295
307
{
296
- if (capturing_WnE == 4 ) capturing_WnE = 5 ;
297
- else if (capturing_WnE == -5 )
308
+ if (capturing_WnE == 4 || capturing_WnE == 6 ) capturing_WnE = 5 ;
309
+ else if (capturing_WnE == -5 || capturing_WnE == - 7 )
298
310
{
299
311
int index = SendMessage (GetDlgItem (hDlg, IDC_LIST1), LB_GETCURSEL, 0 , 0 );
300
312
SendMessage (GetDlgItem (hDlg, IDC_LIST1), LB_DELETESTRING, index, 0 );
@@ -309,11 +321,13 @@ INT_PTR CALLBACK popup(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
309
321
i++;
310
322
}
311
323
EnableWindow (GetDlgItem (hDlg, IDC_TEST), FALSE );
312
- capturing_WnE = -4 ;
324
+ if (capturing_WnE == -5 ) capturing_WnE = -4 ;
325
+ else if (capturing_WnE == -7 ) capturing_WnE = -6 ;
313
326
}
314
327
else
315
328
{
316
- capturing_WnE = -4 ;
329
+ if (capturing_WnE == 0 ) capturing_WnE = -4 ;
330
+ if (capturing_WnE == -1 ) capturing_WnE = -6 ;
317
331
KillTimer (hDlg, 1 );
318
332
KillTimer (hDlg, 2 );
319
333
KillTimer (hDlg, 3 );
@@ -330,6 +344,7 @@ INT_PTR CALLBACK popup(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
330
344
ShowWindow (GetDlgItem (hDlg, IDC_WINDOW), SW_HIDE);
331
345
ShowWindow (GetDlgItem (hDlg, IDC_PEN), SW_HIDE);
332
346
ShowWindow (GetDlgItem (hDlg, IDC_ERASER), SW_HIDE);
347
+ SendMessage (GetDlgItem (hDlg, IDC_LIST1), LB_RESETCONTENT, 0 , 0 );
333
348
for (auto it = config_data[" pen_and_eraser_save" ].begin (); it != config_data[" pen_and_eraser_save" ].end (); it++)
334
349
{
335
350
string key = it.key ();
@@ -1857,7 +1872,8 @@ void* capture_Element()
1857
1872
capturing_WnE = -1 ;
1858
1873
SetDlgItemText (hwnd_popup, IDC_S6, L" 当前控件组合不支持,请重新捕获" );
1859
1874
EnableWindow (GetDlgItem (hwnd_popup, IDC_START), TRUE );
1860
- EnableWindow (GetDlgItem (hwnd_popup, IDC_TEST), FALSE );
1875
+ EnableWindow (GetDlgItem (hwnd_popup, IDC_TEST), TRUE );
1876
+ SetDlgItemText (hwnd_popup, IDC_TEST, L" 已捕获列表" );
1861
1877
SetDlgItemText (hwnd_popup, IDC_WINDOW, L" 未获取" );
1862
1878
SetDlgItemText (hwnd_popup, IDC_PEN, L" 未获取" );
1863
1879
SetDlgItemText (hwnd_popup, IDC_ERASER, L" 未获取" );
@@ -1888,7 +1904,8 @@ void* capture_Element()
1888
1904
capturing_WnE = -1 ;
1889
1905
SetDlgItemText (hwnd_popup, IDC_S6, L" 无法定位控件,请重新捕获" );
1890
1906
EnableWindow (GetDlgItem (hwnd_popup, IDC_START), TRUE );
1891
- EnableWindow (GetDlgItem (hwnd_popup, IDC_TEST), FALSE );
1907
+ EnableWindow (GetDlgItem (hwnd_popup, IDC_TEST), TRUE );
1908
+ SetDlgItemText (hwnd_popup, IDC_TEST, L" 已捕获列表" );
1892
1909
SetDlgItemText (hwnd_popup, IDC_WINDOW, L" 未获取" );
1893
1910
SetDlgItemText (hwnd_popup, IDC_PEN, L" 未获取" );
1894
1911
SetDlgItemText (hwnd_popup, IDC_ERASER, L" 未获取" );
@@ -1927,7 +1944,8 @@ void* capture_Element()
1927
1944
capturing_WnE = -1 ;
1928
1945
SetDlgItemText (hwnd_popup, IDC_S6, L" 当前控件组合不支持,请重新捕获" );
1929
1946
EnableWindow (GetDlgItem (hwnd_popup, IDC_START), TRUE );
1930
- EnableWindow (GetDlgItem (hwnd_popup, IDC_TEST), FALSE );
1947
+ EnableWindow (GetDlgItem (hwnd_popup, IDC_TEST), TRUE );
1948
+ SetDlgItemText (hwnd_popup, IDC_TEST, L" 已捕获列表" );
1931
1949
SetDlgItemText (hwnd_popup, IDC_WINDOW, L" 未获取" );
1932
1950
SetDlgItemText (hwnd_popup, IDC_PEN, L" 未获取" );
1933
1951
SetDlgItemText (hwnd_popup, IDC_ERASER, L" 未获取" );
0 commit comments