Is there an API event for when person changes clock on Windows? - windows

I was wondering if there's some sort of system event that gets fired every time a user changes the time in Windows. I know there's a way to enable this in Windows' EventLog, but I was looking for a way to respond to this event programatically (like using the Windows API).

A WM_TIMECHANGE message is sent whenever there is a change in the system time

I'm not sure from your question if you're working in managed or native code. But if you're working in managed code you can use the TimeChanged event on the SystemEvents class.
Microsoft.Win32.SystemEvents.TimeChanged

Related

Capturing and reacting to custom windows events in wxPython

I'm in the process of writing an app to interface with a service running on another machine. When I ask this service for some information, this service adds the requested information to a separate queue, and sends a windows message to the calling application (my application) indicating there is a message waiting in this separate queue which needs to be decoded.
The windows message this service sends is a custom message, defined in the service code as having some constant int value. I've found examples of creating custom events in wxpython, and using TryBefore() and TryAfter() to react to these events in specific ways, but I haven't found any way to associate this NewEvent() with an int value so I can identify it when it comes in, much less any way to determine what an int value of an incoming event is.
Has anyone done this before or know of any functions I'm not aware of? I'm using python 3.6 and wxpython 4.0.
Thanks for your help, everyone.
I think this is what you are looking for: https://wiki.wxpython.org/HookingTheWndProc
When you get the custom message from the hooked WndProc you can either react to it there, or you can turn it into a wx event and send it so it can be caught by binding an event handler like normal. The wx.lib.newevent module has some helpers for creating a custom event class and an event binder. Its use is demonstrated in some of the demo samples and library modules.

UWP TimedMetadataTrack Events are not firing

I can not seem to get the a TimedMetadataTrack object to fire the events CueEntered or CueExited for SpeechCue events.
Any thoughts?
So, apparently this line is needed when registering for IMediaCue.CueEntered and IMedia.CueExited events (at least the SpeechCue implementation of the interface):
((Windows.Media.Playback.MediaPlaybackItem)item).TimedMetadataTracks.SetPresentationMode((uint)index, Windows.Media.Playback.TimedMetadataTrackPresentationMode.ApplicationPresented);
This line is required to exactly allow the system to send the CueEntered and CueExited events that are being listened for.
Yet again, another case of Microsoft not fully documenting things in their API Documentation or Code Examples.

Getting notified of any action taken by user on windows

I am laying out a concept for an app and in it,i need the administrator to get notified of any action a user takes like starting a program,opening a folder,renaming a file,deleting files,opening files etc.
The concept i am thinking of is like jquery events
$('.class_here').click(function(){
alert('some one clicked the start button');
});
but this is on windows.I have looked at the documentation for windows event viewer and event logs but i would like more direction if this sort of thing is available on windows.
Thanks.

How to show a Carbon dialog as part of a plugin for an application with an existing event loop?

I'm writing a plugin for an application and need to use Carbon to show a dialog. I have everything set up including the event handler, but I cannot possibly call RunApplicationEventLoop() because this would stall the host application.
How can I fix this? Will I need to create a separate thread and call RunApplicationEventLoop() from there?
-Joe
What makes you think you need to call RunApplicationEventLoop? The host app is presumably running an event loop, probably either using RunApplicationEventLoop or NSApplicationMain. By the way, would your dialog be modal? Modal is easier.

Altering Qt Application keyboard events

I'm trying to do the following - given an keypress event in an QT Application, I want to intercept it, modify it (for instance, replacing Qt::Key_Up with 0x81001310), and send it into the app again.
Ideas?
Does overriding the event method work? If you do get all of the keypresses there, just consume the events you wish to replace and send new events that you want.
Might not work, just an idea that should be easy to test.
Be careful to not cause infinite recursions or loops :)
Edit:
If this doesn't work, you can always create an eventFilter and modify the events that way. However, if you do this, you might have to install the event filter for many things.

Resources