He all,

Last week I wrote some code at work to make our webgames fullscreen. I added some cool code that detects the current monitor the browser is on so we can set it fullscreen on that one. Now I want todo the same my template application but then of course in delphi. The problem the same code in I use to give me back the monitor information on which the application resides fails in delphi. Here is the c and delphi code:

c++:

HMONITOR hMonitor = MonitorFromWindow(m_Handle,MONITOR_DEFAULTTOPRIMAR Y);
MONITORINFOEX monInfo;
memset(&monInfo, 0, sizeof(MONITORINFOEX));
monInfo.cbSize = sizeof(MONITORINFOEX);
GetMonitorInfo(hMonitor, &monInfo);

delphi:
[pascal]
iMonInfo : MONITORINFOEX;
iHM : HMONITOR;

iHM := MonitorFromWindow(Wnd, MONITOR_DEFAULTTOPRIMARY);
FillChar(iMonInfo, SizeOf(iMonInfo), 0);
iMonInfo.cbSize := SizeOf(iMonInfo);
If Not(GetMonitorInfo(iHM, @iMonInfo)) then
begin
MessageBox(0, 'Unable to switch to fullscreen!', 'Error', MB_OK or MB_ICONERROR);
Fullscreen := False;
end;
[/pascal]

GetMonitorInfo fails in delphi. I searched the internet and I only could find this:

http://qc.codegear.com/wc/qcmain.aspx?d=3239

I checked the records and there fixed in delphi 2007. Anyone got any clew whats going on here?