Questions tagged [systemevent]

48 questions
33
votes
5 answers

AppleScript Application is not allowed to send keystrokes

I made an app with AppleScript called FRIDAY. When I tell it to 'open chrome', it opens google chrome, this is working on Script Editor and out side of script editor. I can also tell it to 'open a new tab' and it opens a new tab using keystrokes: --…
8
votes
1 answer

SystemEvents.PowerModeChanged not raising Resume events

I have an WinForms application that keeps track when system enters suspended state (sleep) and when it resumes. App uses the SystemEvents class for this purpose. It works fine on my machine. However it seems that for some users the event with…
mancze
  • 669
  • 6
  • 22
4
votes
5 answers

Getting notified when the datetime changes in c#

Recently I was trying to make a calendar application that will display the current year-month-date to the user. The problem is, if the user is gonna keep my application running even for the next day, how do I get notified ?? How shall I change the…
Sudarsan Srinivasan
4
votes
2 answers

Thread hook procedure is no longer called after pressing Tab several times. Why?

I installed a thread-specific windows hook to monitor messages sent to WndProc. It worked at first. However, after I pressed Tab about 19 times to move focus around a form, my hook callback is nolonger called. This happened regaless of whether I…
Tu Le Hong
  • 95
  • 1
  • 8
3
votes
2 answers

The description for Event ID 'x' in Source 'y' cannot be found. Reading 'System' event logs from eventvwr C#

I have this small piece of code to read "System" events from eventvwr EventLog eventLog = new EventLog("System"); foreach (EventLogEntry log in eventLog.Entries) { Console.WriteLine("{0}\n", log.Message); …
Tarun Kumar
  • 729
  • 1
  • 8
  • 16
3
votes
0 answers

SystemEvents.DisplaySettingsChanged not getting HDMI Arrival/Removal event?

I am trying to track a HDMI monitor connection/removal using the below code. That DisplaySettingChanged event is however not triggered for most of the monitors. A HDMI monitor removal event is not raised most of the times. Event registration: …
Arjun babu
  • 607
  • 2
  • 13
  • 42
3
votes
2 answers

How to cancel the shutdown event of PC?

I am making an application in which i want to execute some database queries just before system get shut down. I am using this code - static void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { e.Cancel = true; …
3
votes
1 answer

catch system events with python

My Problem is, that I want to catch system events in a python script. If a cable is plugged into the network device and the computer connects to this network, i want to handle this event, starting a function (Because in this moment the default…
HappyHacking
  • 878
  • 1
  • 12
  • 28
3
votes
1 answer

In .NET, can I detect system focus events (C#)?

Is it possible to determine when window focus changes at the system level? I'm writing a time-tracking application, and I'd like to be able to listen for application switching (so that I can begin logging time in a given application). I've poked…
Brian Warshaw
  • 22,657
  • 9
  • 53
  • 72
3
votes
1 answer

Doesn't work JSF annotation @ListenerFor/@ListenersFor

JSF annotation @ListenerFor doesn't work with GlassFish or Tomcat. No errors or warnings. It's just doesn't call method processEvent(). @ListenersFor({@ListenerFor(systemEventClass=PostConstructApplicationEvent.class), public class…
hakdogan
  • 168
  • 1
  • 13
2
votes
3 answers

C# Creating SystemEvents that can be seen by OTHER Applications

I am trying to come up with a way to raise a public event that can be seen by more than one application. The first thing that comes to mind is SystemEvents. Is there a way to "define" a new SystemEvent or even a public event that more than one…
Kyle Uithoven
  • 2,414
  • 5
  • 30
  • 43
2
votes
1 answer

SystemEvents and resuming from sleep

Imagine I was creating an application that measured how long a certain user is logged in to a computer (the actual application I'm writing is different, but that doesn't matter). I need to track when the user logs in, logs out, when he suspends the…
svick
  • 236,525
  • 50
  • 385
  • 514
2
votes
2 answers

Create an event with start date as an input parameter and 24h forward

I am using C# and I want to create an event that display a field to the user after 24 hours after it is been filled up. Meaning when the field is filled up I have to wait 24 hours before I display it to the user. Is there any simple way to do so? I…
Mindan
  • 979
  • 6
  • 17
  • 37
2
votes
1 answer

How to get a system date change notification in .NET core on linux?

I'm trying to get a notification event in .NET core/Standard (as I need to do plan future actions). I'm porting a piece of existing .NET4.5x code to .NET core 2.2 or .NETStandard2. Originally I was using: SystemEvents.TimeChanged +=…
chrisdot
  • 659
  • 6
  • 19
2
votes
0 answers

macOS system events for network status in Swift

is there any system event which I can use in my program to detect a network change on macOS? I would like to call a function if the network state change, without having a lookup every x seconds in my program. Currently I'm using 'scheduledTimer' to…
MOE
  • 769
  • 6
  • 19
1
2 3 4