mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 22:09:28 +02:00
+ added diagnostic check when GetDC() fails in the win16 video unit
git-svn-id: trunk@37645 -
This commit is contained in:
parent
d25c39396c
commit
6a1a31f5da
@ -191,6 +191,11 @@ var
|
|||||||
CharWidth,CharHeight: SmallInt;
|
CharWidth,CharHeight: SmallInt;
|
||||||
begin
|
begin
|
||||||
dc:=GetDC(VideoWindow);
|
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));
|
oldfont:=SelectObject(dc,GetStockObject(OEM_FIXED_FONT));
|
||||||
GetTextMetrics(dc,FarAddr(Metrics));
|
GetTextMetrics(dc,FarAddr(Metrics));
|
||||||
CharWidth:=Metrics.tmMaxCharWidth;
|
CharWidth:=Metrics.tmMaxCharWidth;
|
||||||
|
Loading…
Reference in New Issue
Block a user