winapi

Get Disk Utilized by each process in c++ windows

一世执手 提交于 2021-02-07 17:07:27
问题 I am trying to build a tool which is something similar to Task Manager. I was able to get the CPU and Memory of each processes, but I couldn't figure out the Disk statistics. I was able to get the I/O Read, Write bytes, but it includes all file, disk and network. How could I get only the Disk Utilized by each processes?? Otherwise is it possible to segregate the disk statistics from those I/O bytes? If yes, how could I do it? 来源: https://stackoverflow.com/questions/32948539/get-disk-utilized

Attach disabled display device with WinAPI

微笑、不失礼 提交于 2021-02-07 14:37:47
问题 My problem is enabling a disabled monitor with ChangeDisplaySettingsEx . I guess it is not rocket science but after some digging it still looks impossible. I found a way to disable all secondary displays basing on Microsoft code sample found here. While it needed only basic tweaking to work, re-attaching never worked. What I was trying to do was: 1. Initialize DisplayDevice BOOL FoundSecondaryDisp = FALSE; DWORD DispNum = 0; DISPLAY_DEVICE DisplayDevice; LONG Result; TCHAR szTemp[200]; int i

NASM tutorial uses int 80h, but this isn't working on Windows

孤街醉人 提交于 2021-02-07 14:16:18
问题 I'm starting NASM Assembler after finishing FASM. I'm coding this in a Windows Operating System. My code reads: section.data ;Constant msg: db "Hello World!" msg_L: equ $-msg ; Current - msg1 section.bss ;Varialble section.text ; Code global _WinMain@16 _WinMain@16: mov eax,4 mov ebx,1; Where to wrte it out. Terminal mov ecx, msg mov edx, msg_L int 80h mov eax, 1 ; EXIT COMMAND mov ebx,0 ; No Eror int 80h To compile it and execute I use: nasm -f win32 test.asm -o test.o ld test.o -o test.exe

Get list of fonts (Win32)

耗尽温柔 提交于 2021-02-07 13:45:40
问题 I want to make a combo box with all of the computer's installed fonts enumerated in it. I'm not sure how this is done. Do I need to access the registry to get this? Thanks 回答1: You should use the Win32 API function EnumFontFamiliesEx. You call that function, passing a callback function matching the type of EnumFontFamExProc. The callback function is called once for every font found by EnumFontFamiliesEx. I'd recommend using the unicode version (EnumFontFamiliesExW), as I've seen the ascii

Get list of fonts (Win32)

旧时模样 提交于 2021-02-07 13:43:31
问题 I want to make a combo box with all of the computer's installed fonts enumerated in it. I'm not sure how this is done. Do I need to access the registry to get this? Thanks 回答1: You should use the Win32 API function EnumFontFamiliesEx. You call that function, passing a callback function matching the type of EnumFontFamExProc. The callback function is called once for every font found by EnumFontFamiliesEx. I'd recommend using the unicode version (EnumFontFamiliesExW), as I've seen the ascii

Restore suppressed cursor after touch injection

两盒软妹~` 提交于 2021-02-07 12:56:24
问题 I'm writing a helper for injecting touch in UI-tests using InjectTouchInput. The injected touch works fine but injecting mouse input after touch does not work. Mouse.Click(point); // works Touch.Tap(point); // works Mouse.Click(point); // does not work, mouse cursor no longer visible on screen. Calling GetCursorInfo() reveals that cursor is CURSOR_SUPPRESSED and I have not found a way to restore it. Moving the physical mouse brings back the cursor and clicking things work fine. How can I

Restore suppressed cursor after touch injection

别来无恙 提交于 2021-02-07 12:56:11
问题 I'm writing a helper for injecting touch in UI-tests using InjectTouchInput. The injected touch works fine but injecting mouse input after touch does not work. Mouse.Click(point); // works Touch.Tap(point); // works Mouse.Click(point); // does not work, mouse cursor no longer visible on screen. Calling GetCursorInfo() reveals that cursor is CURSOR_SUPPRESSED and I have not found a way to restore it. Moving the physical mouse brings back the cursor and clicking things work fine. How can I

How does IMAGE_FILE_NET_RUN_FROM_SWAP in an EXE file affect runtime libraries

大城市里の小女人 提交于 2021-02-07 12:21:13
问题 My application is sometimes started from an network share and some customers reported an External exception C0000006 when running the application. According to my Google research this "may" be related to the image getting paged out and the failing to reload from the network. A workaround for this is telling Windows to load the complete image file into the swap and run it from there by setting the IMAGE_FILE_NET_RUN_FROM_SWAP flag My application also depends on various .bpl and .dll libraries

How does IMAGE_FILE_NET_RUN_FROM_SWAP in an EXE file affect runtime libraries

心不动则不痛 提交于 2021-02-07 12:18:24
问题 My application is sometimes started from an network share and some customers reported an External exception C0000006 when running the application. According to my Google research this "may" be related to the image getting paged out and the failing to reload from the network. A workaround for this is telling Windows to load the complete image file into the swap and run it from there by setting the IMAGE_FILE_NET_RUN_FROM_SWAP flag My application also depends on various .bpl and .dll libraries

How does IMAGE_FILE_NET_RUN_FROM_SWAP in an EXE file affect runtime libraries

风格不统一 提交于 2021-02-07 12:18:07
问题 My application is sometimes started from an network share and some customers reported an External exception C0000006 when running the application. According to my Google research this "may" be related to the image getting paged out and the failing to reload from the network. A workaround for this is telling Windows to load the complete image file into the swap and run it from there by setting the IMAGE_FILE_NET_RUN_FROM_SWAP flag My application also depends on various .bpl and .dll libraries