Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
test for secondary monitor...
How do I run a test to determine if there is a secondary monitor?
Thanks! -- JNW |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
test for secondary monitor...
This is quite simple with the Windows API. Paste all this in a normal module
and try the Sub Test() You can leave the other (other than SM_CMONITORS) out. Option Explicit Private Const SM_CXSCREEN = 0 Private Const SM_CYSCREEN = 1 Private Const SM_CYCAPTION = 4 Private Const SM_CXBORDER = 5 Private Const SM_CYBORDER = 6 Private Const SM_CXFULLSCREEN = 16 Private Const SM_CYFULLSCREEN = 17 Private Const SM_CXVIRTUALSCREEN As Long = 78 Private Const SM_CMONITORS As Long = 80 Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Function IsMultiMonitorSystem() As Boolean 'Returns True if a multi-monitor system IsMultiMonitorSystem = GetSystemMetrics(SM_CMONITORS) 1 End Function Function GetMonitorCount() As Long 'returns the number of display monitors 'on the desktop in a multi-monitor system GetMonitorCount = GetSystemMetrics(SM_CMONITORS) End Function Sub test() MsgBox IsMultiMonitorSystem() End Sub RBS "JNW" wrote in message ... How do I run a test to determine if there is a secondary monitor? Thanks! -- JNW |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
test for secondary monitor...
Thank you. I've searched far and wide for this.
When you said "You can leave the others out" did you mean the Lines containing SM_CXSCREEN through SM_CXVIRTUALSCREEN? Thanks again! -- JNW "RB Smissaert" wrote: This is quite simple with the Windows API. Paste all this in a normal module and try the Sub Test() You can leave the other (other than SM_CMONITORS) out. Option Explicit Private Const SM_CXSCREEN = 0 Private Const SM_CYSCREEN = 1 Private Const SM_CYCAPTION = 4 Private Const SM_CXBORDER = 5 Private Const SM_CYBORDER = 6 Private Const SM_CXFULLSCREEN = 16 Private Const SM_CYFULLSCREEN = 17 Private Const SM_CXVIRTUALSCREEN As Long = 78 Private Const SM_CMONITORS As Long = 80 Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Function IsMultiMonitorSystem() As Boolean 'Returns True if a multi-monitor system IsMultiMonitorSystem = GetSystemMetrics(SM_CMONITORS) 1 End Function Function GetMonitorCount() As Long 'returns the number of display monitors 'on the desktop in a multi-monitor system GetMonitorCount = GetSystemMetrics(SM_CMONITORS) End Function Sub test() MsgBox IsMultiMonitorSystem() End Sub RBS "JNW" wrote in message ... How do I run a test to determine if there is a secondary monitor? Thanks! -- JNW |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
test for secondary monitor...
Yes, those constants are not used in this bit of code, but you may want them
for other purposes. RBS "JNW" wrote in message ... Thank you. I've searched far and wide for this. When you said "You can leave the others out" did you mean the Lines containing SM_CXSCREEN through SM_CXVIRTUALSCREEN? Thanks again! -- JNW "RB Smissaert" wrote: This is quite simple with the Windows API. Paste all this in a normal module and try the Sub Test() You can leave the other (other than SM_CMONITORS) out. Option Explicit Private Const SM_CXSCREEN = 0 Private Const SM_CYSCREEN = 1 Private Const SM_CYCAPTION = 4 Private Const SM_CXBORDER = 5 Private Const SM_CYBORDER = 6 Private Const SM_CXFULLSCREEN = 16 Private Const SM_CYFULLSCREEN = 17 Private Const SM_CXVIRTUALSCREEN As Long = 78 Private Const SM_CMONITORS As Long = 80 Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Function IsMultiMonitorSystem() As Boolean 'Returns True if a multi-monitor system IsMultiMonitorSystem = GetSystemMetrics(SM_CMONITORS) 1 End Function Function GetMonitorCount() As Long 'returns the number of display monitors 'on the desktop in a multi-monitor system GetMonitorCount = GetSystemMetrics(SM_CMONITORS) End Function Sub test() MsgBox IsMultiMonitorSystem() End Sub RBS "JNW" wrote in message ... How do I run a test to determine if there is a secondary monitor? Thanks! -- JNW |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
test for secondary monitor...
Thanks again!
-- JNW "RB Smissaert" wrote: Yes, those constants are not used in this bit of code, but you may want them for other purposes. RBS "JNW" wrote in message ... Thank you. I've searched far and wide for this. When you said "You can leave the others out" did you mean the Lines containing SM_CXSCREEN through SM_CXVIRTUALSCREEN? Thanks again! -- JNW "RB Smissaert" wrote: This is quite simple with the Windows API. Paste all this in a normal module and try the Sub Test() You can leave the other (other than SM_CMONITORS) out. Option Explicit Private Const SM_CXSCREEN = 0 Private Const SM_CYSCREEN = 1 Private Const SM_CYCAPTION = 4 Private Const SM_CXBORDER = 5 Private Const SM_CYBORDER = 6 Private Const SM_CXFULLSCREEN = 16 Private Const SM_CYFULLSCREEN = 17 Private Const SM_CXVIRTUALSCREEN As Long = 78 Private Const SM_CMONITORS As Long = 80 Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Function IsMultiMonitorSystem() As Boolean 'Returns True if a multi-monitor system IsMultiMonitorSystem = GetSystemMetrics(SM_CMONITORS) 1 End Function Function GetMonitorCount() As Long 'returns the number of display monitors 'on the desktop in a multi-monitor system GetMonitorCount = GetSystemMetrics(SM_CMONITORS) End Function Sub test() MsgBox IsMultiMonitorSystem() End Sub RBS "JNW" wrote in message ... How do I run a test to determine if there is a secondary monitor? Thanks! -- JNW |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple Monitor ? | Excel Discussion (Misc queries) | |||
Calculate mean of test scores from rows of test answers | Excel Discussion (Misc queries) | |||
clipboard monitor | Excel Programming | |||
Monitor Changes | Excel Programming |