mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 08:29: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;
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user