Post Reply

Forums -> UltraMon™ SDK -> Monitors re-attach by themselves?
Matt   2006-01-09 01:42
Hi guys,
I've set my 2nd monitor to be detached like this:

Public inddisp As UltraMonIndDisp
Public Sub DetachMonitors()
Set inddisp = CreateObjec("UltraMon.IndDisp")
inddisp.DetachMonitors (Array(2))
End Sub

It seems to work fine, but as soon as I minimise a window on the 1st monitor, the 2nd one suddenly attaches again?
Sorry if I've missed something obvious. I'm a little tired.. :)

Best Regards,
Christian Studer   2006-01-09 11:40
The problem is that the IndDisp object gets deleted as soon as the sub returns, which causes the monitor to get attached again.

You'll need to keep a reference to the IndDisp object around as long as you want to keep the monitor detached.

Christian Studer -
Matt   2006-01-09 15:20
any chance you could show me an example Chris? I thought I was keeping it alive...
Christian Studer   2006-01-10 07:46
I hadn't noticed that inddisp is declared outside of the sub, your code should indeed work fine.

Unfortunately I don't know what might cause the problem you're experiencing, a simple VB6 app with similar code worked fine for me.

What happens when you minimize the window on monitor 1?

For example can you move the mouse to monitor 2 again? If you go to UltraMon menu > Display Settings, is monitor 2 still shown as being detached?

I used the following code for my test application, testing was done with UltraMon 2.6 on Windows XP SP2:

Dim ind As UltraMonIndDisp Private Sub BtnAttachMons_Click() ind.AttachMonitors End Sub Private Sub BtnDetachMons_Click() Set ind = CreateObject("UltraMon.IndDisp") ind.DetachMonitors Array(2) End Sub

Christian Studer -
Matt   2006-01-11 00:24
Hi Christian,

Hmm. This is a little weird. I get back onto it tonight and it works... sometimes...
I can get it to fail, just not consistently at the moment.
For example I had the Ultramon.CHM file open on the 2nd monitor. When I launched my app, the Ultramon.CHM file was trnasferred to the 1st Monitor since my app detached the 2nd.. When I minimised the Ultramon.CHM to the taskbar, I was able to move my mouse onto the second monitor!
But now it is not doing it with consistency, but perhaps that might give you a clue?
I also have an NVidia GE5200 card if that has any bearing on things.

I will try to find a way to reproduce the issue with some sort of consistency and let you know.
Thanks for your help thus far, much appreciated.

Best Regards,
Christian Studer   2006-01-11 07:47
If you go to UltraMon menu > Display Settings, is the monitor status still detached?

Christian Studer -
Matt   2006-01-21 17:30
Hi Christian,
Sorry for the delayed response. I haven't worked on the project again up until today. I will see if I can ge it to do it with some consistency and then check the Monitot status. To be honest it seems to be behaving now... I know that sounds wrong - unless I have changed something while playing around with the NVidia drivers or something like that.
But I will be spending more time on this now, so hopefully will get you an answer!

Best Regards,
Forums -> UltraMon™ SDK -> Monitors re-attach by themselves?

Post Reply