2012-12-24 10:20:23 -05:00
|
|
|
// StatusDialog.cpp : implementation file
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "dxwndhost.h"
|
|
|
|
#include "StatusDialog.h"
|
|
|
|
|
|
|
|
// CStatusDialog dialog
|
|
|
|
|
|
|
|
IMPLEMENT_DYNAMIC(CStatusDialog, CDialog)
|
|
|
|
|
|
|
|
CStatusDialog::CStatusDialog(CWnd* pParent /*=NULL*/)
|
|
|
|
: CDialog(CStatusDialog::IDD, pParent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
CStatusDialog::~CStatusDialog()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStatusDialog::DoDataExchange(CDataExchange* pDX)
|
|
|
|
{
|
|
|
|
CDialog::DoDataExchange(pDX);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CStatusDialog, CDialog)
|
|
|
|
ON_WM_TIMER()
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
2013-01-25 11:17:02 -05:00
|
|
|
#define IDStatusTIMER 1
|
2012-12-24 10:20:23 -05:00
|
|
|
|
|
|
|
// CStatusDialog message handlers
|
|
|
|
|
|
|
|
void CStatusDialog::OnTimer(UINT_PTR nIDEvent)
|
|
|
|
{
|
|
|
|
int DxStatus;
|
|
|
|
int IconId;
|
|
|
|
LPCSTR Status;
|
|
|
|
char sMsg[1024];
|
2013-11-10 11:38:24 -05:00
|
|
|
char sMsg2[1024];
|
2012-12-24 10:20:23 -05:00
|
|
|
char DllVersion[21];
|
|
|
|
DXWNDSTATUS DxWndStatus;
|
|
|
|
extern PRIVATEMAP *pTitles;
|
2013-01-19 11:16:54 -05:00
|
|
|
extern TARGETMAP *pTargets;
|
|
|
|
TARGETMAP *Target;
|
2013-01-22 11:17:01 -05:00
|
|
|
extern char *GetTSCaption(int);
|
2012-12-24 10:20:23 -05:00
|
|
|
|
|
|
|
CDialog::OnTimer(nIDEvent);
|
2013-11-10 11:38:24 -05:00
|
|
|
GetDllVersion(DllVersion);
|
2013-01-25 11:17:02 -05:00
|
|
|
DxStatus=GetHookStatus(&DxWndStatus);
|
2012-12-24 10:20:23 -05:00
|
|
|
switch (DxStatus){
|
|
|
|
case DXW_IDLE: IconId=IDI_DXIDLE; Status="DISABLED"; break;
|
|
|
|
case DXW_ACTIVE: IconId=IDI_DXWAIT; Status="READY"; break;
|
|
|
|
case DXW_RUNNING: IconId=IDI_DXRUN; Status="RUNNING"; break;
|
2013-01-25 11:17:02 -05:00
|
|
|
default: IconId=IDI_DXIDLE; Status="???"; break;
|
2012-12-24 10:20:23 -05:00
|
|
|
}
|
|
|
|
|
2013-11-10 11:38:24 -05:00
|
|
|
sprintf_s(sMsg, 1024,
|
|
|
|
"DxWnd %s\n"
|
|
|
|
"Hook status: %s",
|
2013-11-16 11:38:27 -05:00
|
|
|
DllVersion, Status);
|
2013-11-10 11:38:24 -05:00
|
|
|
|
2012-12-24 10:20:23 -05:00
|
|
|
if(DxStatus==DXW_RUNNING){
|
2013-01-25 11:17:02 -05:00
|
|
|
|
2013-01-19 11:16:54 -05:00
|
|
|
Target=&pTargets[DxWndStatus.TaskIdx];
|
|
|
|
|
2013-11-10 11:38:24 -05:00
|
|
|
sprintf_s(sMsg2, 1024,
|
2016-04-20 12:45:44 -04:00
|
|
|
"\nTask=(%d): %s\n"
|
|
|
|
"pid=%x\n"
|
2013-11-16 11:38:27 -05:00
|
|
|
"Screen = (%dx%d) Color BPP=%d\n"
|
2012-12-24 10:20:23 -05:00
|
|
|
"FullScreen = %s\nDX version = %d\n"
|
2013-04-27 12:19:14 -04:00
|
|
|
"Logging = %s\n"
|
|
|
|
"Cursor = (%d,%d)",
|
2016-04-20 12:45:44 -04:00
|
|
|
(DxWndStatus.OrigIdx+1), pTitles[DxWndStatus.OrigIdx].title,
|
|
|
|
DxWndStatus.dwPid,
|
2013-01-19 11:16:54 -05:00
|
|
|
DxWndStatus.Width, DxWndStatus.Height, DxWndStatus.ColorDepth,
|
|
|
|
DxWndStatus.IsFullScreen ? "Yes":"No", DxWndStatus.DXVersion,
|
2013-04-27 12:19:14 -04:00
|
|
|
DxWndStatus.isLogging?"ON":"OFF",
|
|
|
|
DxWndStatus.CursorX, DxWndStatus.CursorY);
|
2013-11-10 11:38:24 -05:00
|
|
|
strcat(sMsg, sMsg2);
|
2014-10-08 12:39:38 -04:00
|
|
|
if(DxWndStatus.pfd.dwFlags & DDPF_FOURCC){
|
|
|
|
char *fcc;
|
|
|
|
fcc = (char *)&(DxWndStatus.pfd.dwFourCC);
|
|
|
|
sprintf_s(sMsg2, 1024,
|
|
|
|
"\nFourCC = %x (%c%c%c%c)",
|
|
|
|
DxWndStatus.pfd.dwFourCC,
|
|
|
|
isprint(fcc[0])?fcc[0]:'.', isprint(fcc[1])?fcc[1]:'.', isprint(fcc[2])?fcc[2]:'.', isprint(fcc[3])?fcc[3]:'.'
|
|
|
|
);
|
|
|
|
strcat(sMsg, sMsg2);
|
|
|
|
}
|
|
|
|
if(DxWndStatus.pfd.dwSize){
|
|
|
|
sprintf_s(sMsg2, 1024,
|
|
|
|
"\nPixel format=%s%s%s%s%s%s",
|
|
|
|
(DxWndStatus.pfd.dwFlags & DDPF_ALPHAPIXELS) ? "ALPHAPIXELS ":"",
|
|
|
|
(DxWndStatus.pfd.dwFlags & DDPF_ALPHA) ? "ALPHA ":"",
|
|
|
|
(DxWndStatus.pfd.dwFlags & DDPF_FOURCC) ? "FOURCC ":"",
|
|
|
|
(DxWndStatus.pfd.dwFlags & (DDPF_PALETTEINDEXED4|DDPF_PALETTEINDEXEDTO8|DDPF_PALETTEINDEXED8)) ? "PALETTEINDEXED ":"",
|
|
|
|
(DxWndStatus.pfd.dwFlags & DDPF_RGB) ? "RGB ":"",
|
|
|
|
(DxWndStatus.pfd.dwFlags & DDPF_YUV) ? "YUV ":""
|
|
|
|
);
|
|
|
|
strcat(sMsg, sMsg2);
|
|
|
|
}
|
|
|
|
if(DxWndStatus.pfd.dwFlags & DDPF_RGB){
|
|
|
|
sprintf_s(sMsg2, 1024,
|
|
|
|
"\nColor mask (RGBA)=(%x,%x,%x,%x)",
|
|
|
|
DxWndStatus.pfd.dwRBitMask, DxWndStatus.pfd.dwGBitMask, DxWndStatus.pfd.dwBBitMask, DxWndStatus.pfd.dwRGBAlphaBitMask
|
|
|
|
);
|
|
|
|
strcat(sMsg, sMsg2);
|
|
|
|
}
|
2013-01-25 11:17:02 -05:00
|
|
|
if(Target->flags2 & (SHOWFPS|SHOWFPSOVERLAY)){
|
2014-10-08 12:39:38 -04:00
|
|
|
sprintf(sMsg2, "\nFPS = %d", DxWndStatus.FPSCount);
|
|
|
|
strcat(sMsg, sMsg2);
|
2013-01-19 11:16:54 -05:00
|
|
|
}
|
|
|
|
if(Target->flags2 & TIMESTRETCH){
|
2013-01-25 11:17:02 -05:00
|
|
|
if(DxWndStatus.TimeShift>=-8 && DxWndStatus.TimeShift<=8){
|
2014-10-08 12:39:38 -04:00
|
|
|
sprintf(sMsg2, "\nTime speed %s", GetTSCaption(DxWndStatus.TimeShift));
|
|
|
|
strcat(sMsg, sMsg2);
|
2013-01-19 11:16:54 -05:00
|
|
|
}
|
|
|
|
}
|
2012-12-24 10:20:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
this->SetDlgItemTextA(IDC_STATUSINFO, sMsg);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL CStatusDialog::OnInitDialog()
|
|
|
|
{
|
|
|
|
CDialog::OnInitDialog();
|
|
|
|
|
2013-01-25 11:17:02 -05:00
|
|
|
SetTimer(IDStatusTIMER, 1000, NULL);
|
2012-12-24 10:20:23 -05:00
|
|
|
|
|
|
|
// TODO: Add extra initialization here
|
|
|
|
|
|
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|
|
|
}
|
|
|
|
|
|
|
|
void CStatusDialog::OnOK()
|
|
|
|
{
|
|
|
|
// TODO: Add your specialized code here and/or call the base class
|
|
|
|
|
2013-01-25 11:17:02 -05:00
|
|
|
KillTimer(IDStatusTIMER);
|
2012-12-24 10:20:23 -05:00
|
|
|
// stop timer
|
|
|
|
|
|
|
|
CDialog::OnOK();
|
|
|
|
}
|