Category "winapi"

Display image using Windows API

I am using a looping primitive code to output a test image: procedure TForm1.Button1Click(Sender: TObject); var LP1, LP2: TLogPen; hp1, hp2: THandle; hdcv

How do I get rid of black bar in python window?

I'm working on a Object Detection project for the game Cuphead using OpenCV and Python. Now I'm trying to capture objects in real time but when the detection wi

Is there a race between starting and seeing yourself in WinApi's EnumProcesses()?

I just found this code in the wild: def _scan_for_self(self): win32api.Sleep(2000) # sleep to give time for process to be seen in system table.

How to change the color of '+-' in TreeView in win32 project

How can I change the color of the button '+ -' as shown: Thanks.

BitBlt | StretchBlt - Access is denied when the user is not logged in to Windows

I have a python program that uses simple Windows GDI functions like BitBlt and StretchBlt which runs at computer startup but it starts before the user has logge

How do I know when my Ctrl + C command has been processed?

I need to copy the currently selected text from the currently active window in the currently active app. If the app support guiInfo.hwndCaret, then I use this.

NMHDR definition conflict?

in richedit.h NMHDR is defined as follows: typedef struct _nmhdr { HWND hwndFrom; UINT idFrom; UINT code; } NMHDR; in winuser.h, it is def

Send User Message to child window in CCtrlTab control

I have a dialog window (MainDlg : CDialogEx), in this window is tabcontrol (MyTab : CTabCtrl) and in this CTabCtrl I have child windows (Tab1Dlg : CDialogEx). T

how to get a list of available monitors in windows 10

I want to get a list of available monitors in Windows 10, same as the monitor list shown in the System display settings (no matter whether they are attached or

Prevent window from being clicked in while another window is open

On Windows, when a window opens on top of another window, the parent window will not be clickable, and will make a "ding" sound and its titlebar will flash. It

Win32 application not finding icon for window

I created a icon as a resource I checked explorer and it works just fine, my exe now has that icon Next, I used hIcon to set the icon of my window but it says

Append to registry without expanding variables

I'll just start off by saying that I'm by no means an expert in C++, so any pointers/tips are greatly appreciated. I'm having some difficulties reading and writ

Problem with CancelIoEx function on some platforms

I work with usb device and use async functions of usbdk driver for I/O operations. I have a problem with canceling of operations on some win platforms. Im using

How does one create text that can overlay all windows like the Windows Activation Watermark?

I would like to create a count down timer that displays in the lower right hand of the screen with slightly transparent text that can be seen no matter what you

Programs which accept uppercase and lowercase commands as input

I'm trying to add a help/information box in my program that pops whenever someone type in a /h, /?, /help commands. I want to make sure that my program accepts

Creating process with elevated privileges using CreateProcessAsUserW from system service

I'm trying to launch a process from a system service using the token handle of the currently active user with elevated privileges (if user is in admin. group).

Go: Why do processes/Threads started using Win32API funcs seem to hijack and kill the parent proccess?

Now, the following code does what it's supposed to do, load calc.exe to memory and execute it, it does that fine. I've stitched together this code to show Creat

Safe ways to retain an encryption key in a local service memory after a reboot?

I'm writing a Windows service that receives an encryption key from our web server. Such key never leaves memory and is used to encrypt and decrypt sensitive dat

Is there a way to set jumbo frame with C++ in Windows?

My C++ application uses Gige camera on many various Windows 10 PC. So I wanna set jumbo frame of LAN card of PC programmatically. (when the process starts it is

How do I fill in the pData parameter of the GetRawInputData module

I'm semi-new to ctypes and I'm having trouble with how to use the GetRawInputData function. I'm not sure how to fill in the 3rd argument. Here's how the code lo