Receiving System Video (Hardware) Events?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Rytz
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 17, 2006 10:27 pm

Receiving System Video (Hardware) Events?

Post by Rytz »

Hi:

Does WxW have any built-in event hooks for receiving video device/hardware events?

More specifically, I'd like to have a callback method for when the number of displays has changed.

I can do it manually with a thread that checks the number of displays but I was trying to avoid that extra overhead.

Thanks!
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Receiving System Video (Hardware) Events?

Post by doublemax »

I think wxDisplayChangedEvent is also triggered when the number of displays changes. Try it out.
https://docs.wxwidgets.org/trunk/classw ... event.html

But it's only available under Windows.
Use the source, Luke!
Rytz
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 17, 2006 10:27 pm

Re: Receiving System Video (Hardware) Events?

Post by Rytz »

Thanks Mr. Max!
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Receiving System Video (Hardware) Events?

Post by PB »

FWIW, in my experience it is not sent when a display is turned on/off (it is based on WM_DISPLAYCHANGE), at least when it does not affect a resolution.

EDIT
It seems that Windows itself ignores a display (connected to a desktop with two displays) being turned on/off and still behaves as if the display was still on, so perhaps it is different e.g. when a display is physically (dis)connected to/from a laptop.
Post Reply