I'm amazed at how much information is available. Here is a nice graph that shows the top 10 screen resolutions in use from 2008 through 2012.
Source: http://gs.statcounter.com/#resolution-ww-monthly-201201-201301-bar
Add MultiMon to the uses clause The button click event lets you move the program between two monitors to get the screen resolution.
procedure TScreenResolution.Button1Click(Sender: TObject); var MonInfo: TMonitorInfo; ScreenW, ScreenH : integer; begin MonInfo.cbSize := SizeOf(MonInfo); GetMonitorInfo(MonitorFromWindow(Handle, MONITOR_DEFAULTTONEAREST), @MonInfo); ScreenW := MonInfo.rcMonitor.Right - MonInfo.rcMonitor.Left; ScreenH := MonInfo.rcMonitor.Bottom - MonInfo.rcMonitor.Top; Label2.Caption := IntToStr(ScreenW); Label4.Caption := IntToStr(ScreenH); end;Semper Fi - Gunny Mike
Checked out code in Xe2 - works fine.
ReplyDeleteTried it in FireMonkey out of curiosity and while I didn't get any errors (other than having to change Labelx.Caption to Labelx.Text) the information was garbage and didn't change between monitors.
Curious that the MultiMon is supported but functions differently. Being a FireMonkey nube I'm probably just missing something.
Your test is not good... It compile because you only tested it with Windows platform... If you add the OSX platform, the unit doesn't exist yet...
DeleteAs explain in the thread mentionned Gunny Mike above, Multi-monitor is not yet supported by FMX.
Maybe with XE3... wait and see...
@El Steve-o - Thanks for the heads up on FireMonkey. If you do find some FireMonkey code that works please post a comment.
ReplyDelete