diff --git a/src/helper.c b/src/helper.c index d569058c..62130063 100644 --- a/src/helper.c +++ b/src/helper.c @@ -1828,6 +1828,7 @@ VOID NTAPI _app_queuenotifyinformation ( PR_STRING signature_str; PR_STRING localized_string; HICON hicon; + HDWP hdefer; BOOLEAN is_iconset; context = arglist; @@ -1896,7 +1897,16 @@ VOID NTAPI _app_queuenotifyinformation ( if (_r_obj_isstringempty (signature_str)) _r_obj_movereference (&signature_str, _r_locale_getstring_ex (IDS_SIGN_UNSIGNED)); - _r_ctrl_settablestring (context->hwnd, IDC_SIGNATURE_ID, &localized_string->sr, IDC_SIGNATURE_TEXT, &signature_str->sr); + hdefer = BeginDeferWindowPos (2); + + _r_ctrl_settablestring ( + context->hwnd, + &hdefer, + IDC_SIGNATURE_ID, + &localized_string->sr, + IDC_SIGNATURE_TEXT, + &signature_str->sr + ); // set address string _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_ADDRESS), L":")); @@ -1904,7 +1914,14 @@ VOID NTAPI _app_queuenotifyinformation ( if (_r_obj_isstringempty (address_str)) _r_obj_movereference (&address_str, _r_obj_createstring (SZ_EMPTY)); - _r_ctrl_settablestring (context->hwnd, IDC_ADDRESS_ID, &localized_string->sr, IDC_ADDRESS_TEXT, &address_str->sr); + _r_ctrl_settablestring ( + context->hwnd, + &hdefer, + IDC_ADDRESS_ID, + &localized_string->sr, + IDC_ADDRESS_TEXT, + &address_str->sr + ); // set host string _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_HOST), L":")); @@ -1912,9 +1929,19 @@ VOID NTAPI _app_queuenotifyinformation ( if (_r_obj_isstringempty (host_str)) _r_obj_movereference (&host_str, _r_obj_createstring (SZ_EMPTY)); - _r_ctrl_settablestring (context->hwnd, IDC_HOST_ID, &localized_string->sr, IDC_HOST_TEXT, &host_str->sr); + _r_ctrl_settablestring ( + context->hwnd, + &hdefer, + IDC_HOST_ID, + &localized_string->sr, + IDC_HOST_TEXT, + &host_str->sr + ); _r_obj_dereference (localized_string); + + if (hdefer) + EndDeferWindowPos (hdefer); } } diff --git a/src/notifications.c b/src/notifications.c index 729f53fa..2fbc4445 100644 --- a/src/notifications.c +++ b/src/notifications.c @@ -383,6 +383,7 @@ VOID _app_notify_show ( PR_STRING string; PR_STRING localized_string; PR_STRING display_name; + HDWP hdefer; BOOLEAN is_fullscreenmode; ptr_app = _app_getappitem (ptr_log->app_hash); @@ -405,45 +406,50 @@ VOID _app_notify_show ( SetWindowText (hwnd, window_title); + hdefer = BeginDeferWindowPos (2); + // print name _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_NAME), L":")); display_name = _app_getappdisplayname (ptr_app, TRUE); - _r_ctrl_settablestring (hwnd, IDC_FILE_ID, &localized_string->sr, IDC_FILE_TEXT, display_name ? &display_name->sr : &empty_sr); + _r_ctrl_settablestring (hwnd, &hdefer, IDC_FILE_ID, &localized_string->sr, IDC_FILE_TEXT, display_name ? &display_name->sr : &empty_sr); // print signature _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_SIGNATURE), L":")); - _r_ctrl_settablestring (hwnd, IDC_SIGNATURE_ID, &localized_string->sr, IDC_SIGNATURE_TEXT, &loading_sr); + _r_ctrl_settablestring (hwnd, &hdefer, IDC_SIGNATURE_ID, &localized_string->sr, IDC_SIGNATURE_TEXT, &loading_sr); // print address _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_ADDRESS), L":")); - _r_ctrl_settablestring (hwnd, IDC_ADDRESS_ID, &localized_string->sr, IDC_ADDRESS_TEXT, &loading_sr); + _r_ctrl_settablestring (hwnd, &hdefer, IDC_ADDRESS_ID, &localized_string->sr, IDC_ADDRESS_TEXT, &loading_sr); // print host _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_HOST), L":")); - _r_ctrl_settablestring (hwnd, IDC_HOST_ID, &localized_string->sr, IDC_HOST_TEXT, &loading_sr); + _r_ctrl_settablestring (hwnd, &hdefer, IDC_HOST_ID, &localized_string->sr, IDC_HOST_TEXT, &loading_sr); // print port _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_PORT), L":")); _r_obj_movereference (&string, _app_formatport (ptr_log->remote_port, ptr_log->protocol)); - _r_ctrl_settablestring (hwnd, IDC_PORT_ID, &localized_string->sr, IDC_PORT_TEXT, string ? &string->sr : &empty_sr); + _r_ctrl_settablestring (hwnd, &hdefer, IDC_PORT_ID, &localized_string->sr, IDC_PORT_TEXT, string ? &string->sr : &empty_sr); // print direction _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_DIRECTION), L":")); _r_obj_movereference (&string, _app_db_getdirectionname (ptr_log->direction, ptr_log->is_loopback, TRUE)); - _r_ctrl_settablestring (hwnd, IDC_DIRECTION_ID, &localized_string->sr, IDC_DIRECTION_TEXT, string ? &string->sr : &empty_sr); + _r_ctrl_settablestring (hwnd, &hdefer, IDC_DIRECTION_ID, &localized_string->sr, IDC_DIRECTION_TEXT, string ? &string->sr : &empty_sr); // print filter name _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_FILTER), L":")); - _r_ctrl_settablestring (hwnd, IDC_FILTER_ID, &localized_string->sr, IDC_FILTER_TEXT, ptr_log->filter_name ? &ptr_log->filter_name->sr : &empty_sr); + _r_ctrl_settablestring (hwnd, &hdefer, IDC_FILTER_ID, &localized_string->sr, IDC_FILTER_TEXT, ptr_log->filter_name ? &ptr_log->filter_name->sr : &empty_sr); // print date _r_obj_movereference (&localized_string, _r_obj_concatstrings (2, _r_locale_getstring (IDS_DATE), L":")); _r_obj_movereference (&string, _r_format_unixtime_ex (ptr_log->timestamp, FDTF_SHORTDATE | FDTF_LONGTIME)); - _r_ctrl_settablestring (hwnd, IDC_DATE_ID, &localized_string->sr, IDC_DATE_TEXT, string ? &string->sr : &empty_sr); + _r_ctrl_settablestring (hwnd, &hdefer, IDC_DATE_ID, &localized_string->sr, IDC_DATE_TEXT, string ? &string->sr : &empty_sr); + + if (hdefer) + EndDeferWindowPos (hdefer); _r_ctrl_setstring (hwnd, IDC_RULES_BTN, _r_locale_getstring (IDS_TRAY_RULES)); _r_ctrl_setstring (hwnd, IDC_ALLOW_BTN, _r_locale_getstring (IDS_ACTION_ALLOW));