2
Copyright (c) 2009 NetAllied Systems GmbH
4
This file is part of G3DWarehouseBrowser.
6
Licensed under the MIT Open Source License,
7
for details please see LICENSE file or the website
8
http://www.opensource.org/licenses/mit-license.php
11
#include "G3DStableHeaders.h"
12
#include "G3DDownloadStatusCallback.h"
16
//---------------------------------------------------------------------
17
HRESULT STDMETHODCALLTYPE DownloadStatusCallback::OnProgress( ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR wszStatusText)
19
if(ulStatusCode == BINDSTATUS_BEGINDOWNLOADDATA)
21
ShowWindow(hwndProgress, 1);
22
stepFactor = 1000. / ulProgressMax;
23
SendMessage(hwndProgress, PBM_SETRANGE, 0, MAKELPARAM (0, 1000));
25
else if(ulStatusCode == BINDSTATUS_DOWNLOADINGDATA)
27
SendMessage(hwndProgress, PBM_SETPOS, (WPARAM)(ulProgress * stepFactor), 0);
29
else if(ulStatusCode == BINDSTATUS_ENDDOWNLOADDATA)
31
ShowWindow(hwndProgress, 0);
32
SendMessage(hwndProgress, PBM_SETRANGE, 0, MAKELPARAM (0, 0));
33
SendMessage(hwndProgress, PBM_SETPOS, 0, 0);