Category: Windows

Ctrl still pressed with keyb_event()

Query asked by user i’m trying to help a friend with a macro for his mouse, but i’ve been strugling with an error. But when i use : if(GetAsyncKeyState(VK_XBUTTON2)){ keybd_event(VK_LCONTROL, 0xA2, 0x0001, 0); Sleep(50); keybd_event(VK_LCONTROL, 0xA2, 0x0002, 0); Sleep(50); } My ctrl still holded unless i click in my console and press ctrl again. Solution […]

Packaging an .exe file to MSIX and signing it

Query asked by user I have developed an application and want to publish to the microsoft store. I have tried using advanced installer but unless I pay $500 I cannot publish it i think using the trial version? I have also tried using MSIX Package (Windows) but then I need to digitally sign it, and […]

BackgroundService not restarted by SCM

Query asked by user Goal: Running a .net 6.0 BackgroundService on Windows that is restarted automatically when an unhandled exception occurs. Minimal example: Program.cs IHost host = Host.CreateDefaultBuilder(args) .ConfigureServices(services => { services.AddHostedService<Worker>(); }) .UseWindowsService(options => { options.ServiceName = “ASampleService”; }) .Build(); await host.RunAsync(); Worker.cs namespace SampleWindowsService { public class Worker : BackgroundService { […] protected […]

How to write event log

Query asked by user As we know, we can use the class EventLog to write event logs, but I am confused about how to write name in my event log. Thoug it provides the parameter, for example, one of the type of WriteEntry is: public void WriteEntry( string message, EventLogEntryType type, int eventID, short ) […]

Find absolute java.exe path programmatically from java code

Query asked by user If I have a java jar or class file which is launched by the user (assuming java path is set in environment variables), so how can i from within the code, figure out absolute path of java.exe/javaw.exe from which this file is being launched. Like on ubuntu we can run: % […]

Windows Symlinks in Grunt Server

Query asked by user it seams I have a rather strange problem. I have a JS one Page application with a huge media pool. The media assets have a very short update cycle. Much shorter than the code base. So it has its own repository. I have to develop the application on Windows OS and […]

Installing PyBluez via pip and troubles with import

Query asked by user I’m have to do something using a Pybluez, I had errors on my code, so I told myself to start with “code example” what is in Pybluez, but I have errors in example too. This is the example: #!/usr/bin/env python3 import bluetooth server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM) server_sock.bind((“”, bluetooth.PORT_ANY)) server_sock.listen(1) port = server_sock.getsockname()[1] […]