Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Программы для выполнения лаб 1 и 2 / KALMAN / SOURCE / WAITDLG
.CPP/* Project first
Copyright © 1997 by US. All Rights Reserved.
SUBSYSTEM: first.exe Application
FILE: waitdlg.cpp
AUTHOR: US
OVERVIEW
========
Source file for implementation of TWaitDialog (TDialog).
*/
#include <owl\owlpch.h>
#pragma hdrstop
#include "waitdlg.h"
#include "firstapp.rh"
//{{TWaitDialog Implementation}}
TWaitDialog::TWaitDialog (TWindow* parent, TResId resId, TModule* module):
TDialog(parent, resId, module)
{
what = new TStatic(this, CM_WAITWHAT, 20);
percent = new TStatic(this, CM_WAITPERCENT, 20);
}
TWaitDialog::~TWaitDialog ()
{
Destroy();
// INSERT>> Your destructor code here.
}
BOOL TWaitDialog::EvInitDialog (HWND hWndFocus)
{
BOOL result;
result = TDialog::EvInitDialog(hWndFocus);
// Position window to the center of desktop
TRect dialog_pos;
RECT desktop_pos;
unsigned dcx, dcy, sx, sy;
GetWindowRect(dialog_pos);
::GetWindowRect(GetDesktopWindow(), &desktop_pos);
dcx = desktop_pos.left + desktop_pos.right;
dcy = desktop_pos.top + desktop_pos.bottom;
sx = dialog_pos.right - dialog_pos.left;
sy = dialog_pos.bottom - dialog_pos.top;
dialog_pos.left = (dcx - sx) >> 1;
dialog_pos.right = (dcx + sx) >> 1;
dialog_pos.top = (dcy - sy) >> 1;
dialog_pos.bottom = (dcy + sy) >> 1;
MoveWindow(dialog_pos, FALSE);
return result;
}
Соседние файлы в папке SOURCE