/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * dmex 2016-2026 * */ #include "onlnchk.h" HRESULT CALLBACK TaskDialogProcessingCallbackProc( _In_ HWND WindowHandle, _In_ UINT WindowMessage, _In_ WPARAM wParam, _In_ LPARAM lParam, _In_ LONG_PTR dwRefData ) { PUPLOAD_CONTEXT context = (PUPLOAD_CONTEXT)dwRefData; switch (WindowMessage) { case TDN_NAVIGATED: { SendMessage(WindowHandle, TDM_SET_MARQUEE_PROGRESS_BAR, TRUE, 0); SendMessage(WindowHandle, TDM_SET_PROGRESS_BAR_MARQUEE, TRUE, 1); context->ProgressMarquee = TRUE; //if (context->TaskbarListClass) // PhTaskbarListSetProgressState(context->TaskbarListClass, context->DialogHandle, PH_TBLF_INDETERMINATE); #ifndef FORCE_NO_STATUS_TIMER if (!context->ProgressTimer) { PhSetTimer(WindowHandle, 9000, SETTING_NAME_STATUS_TIMER_INTERVAL, NULL); context->ProgressTimer = TRUE; } #endif PhReferenceObject(context); PhQueueItemWorkQueue(PhGetGlobalWorkQueue(), UploadCheckThreadStart, context); } break; } return S_OK; } VOID ShowFileUploadDialog( _In_ PUPLOAD_CONTEXT Context ) { TASKDIALOGCONFIG config; memset(&config, 0, sizeof(TASKDIALOGCONFIG)); config.cbSize = sizeof(TASKDIALOGCONFIG); config.dwFlags = TDF_USE_HICON_MAIN | TDF_ALLOW_DIALOG_CANCELLATION | TDF_CAN_BE_MINIMIZED | TDF_SHOW_MARQUEE_PROGRESS_BAR; config.dwCommonButtons = TDCBF_CLOSE_BUTTON; config.hMainIcon = PhGetApplicationIcon(FALSE, PhGetWindowDpi(Context->DialogHandle)); config.pszWindowTitle = PhaFormatString(L"Uploading %s...", PhGetStringOrEmpty(Context->BaseFileName))->Buffer; config.pszMainInstruction = PhaFormatString(L"Uploading %s...", PhGetStringOrEmpty(Context->BaseFileName))->Buffer; config.cxWidth = 200; config.pfCallback = TaskDialogProcessingCallbackProc; config.lpCallbackData = (LONG_PTR)Context; PhTaskDialogNavigatePage(Context->DialogHandle, &config); }