+ added diagnostic check when GetDC() fails in the win16 video unit

git-svn-id: trunk@37645 -
This commit is contained in:
nickysn 2017-12-01 17:09:05 +00:00
parent d25c39396c
commit 6a1a31f5da

View File

@ -191,6 +191,11 @@ var
CharWidth,CharHeight: SmallInt;
begin
dc:=GetDC(VideoWindow);
if dc=0 then
begin
MessageBox(0,'GetDC() failed',nil,MB_OK or MB_ICONHAND or MB_TASKMODAL);
exit;
end;
oldfont:=SelectObject(dc,GetStockObject(OEM_FIXED_FONT));
GetTextMetrics(dc,FarAddr(Metrics));
CharWidth:=Metrics.tmMaxCharWidth;