winapi

Check if audio playing with Python on Windows 10

蹲街弑〆低调 提交于 2021-02-08 08:42:34
问题 I'm working with Python 3.7 on Windows 10. I would like to detect if there is any audio playing on my computer or not. I was looking into win32api.GetVolumeinformation but I'm unable to get what I want. When you control your audio you can see if there is a program playing and I want to achieve that. 来源: https://stackoverflow.com/questions/59636713/check-if-audio-playing-with-python-on-windows-10

How to check mouse is not moved from last 5 seconds?

岁酱吖の 提交于 2021-02-08 08:26:29
问题 I'm working on a task for my game program, in which I want to hide my mouse after 10 seconds from my screen. However I'm able to check the mouse move condition... Here is my code.. using namespace std; HHOOK g_hMouseHook; LRESULT CALLBACK LowLevelMouseProc(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode >= 0) { PMSLLHOOKSTRUCT pmll = (PMSLLHOOKSTRUCT) lParam; switch (wParam) { case WM_MOUSEMOVE: printf("Mouse has been moved\n"); break; } } return CallNextHookEx(g_hMouseHook, nCode,

VBA String Normalization (via WinAPI)

北城以北 提交于 2021-02-08 08:20:17
问题 I'm new to attempting to write code in VBA to use WinAPI functions. What encoding does the WinAPI Normalize() function work with? UTF-16 is what I would expect, but the following does not work. The number of characters seems like it's not calculated right, and then the attempt to actually create a normalized string will just crash Access. 'normFormEnum 'not random numbers, but from ... 'https://msdn.microsoft.com/en-us/library/windows/desktop/dd319094(v=vs.85).aspx 'for use in calling the Win

VBA String Normalization (via WinAPI)

不问归期 提交于 2021-02-08 08:19:19
问题 I'm new to attempting to write code in VBA to use WinAPI functions. What encoding does the WinAPI Normalize() function work with? UTF-16 is what I would expect, but the following does not work. The number of characters seems like it's not calculated right, and then the attempt to actually create a normalized string will just crash Access. 'normFormEnum 'not random numbers, but from ... 'https://msdn.microsoft.com/en-us/library/windows/desktop/dd319094(v=vs.85).aspx 'for use in calling the Win

Is it possible to use JNA/JNI to access native COM/DirectX API methods?

女生的网名这么多〃 提交于 2021-02-08 07:38:33
问题 I'm trying to call this native Windows method using JNA: HRESULT WINAPI DirectSoundCreate(LPGUID lpGuid, LPDIRECTSOUND* ppDS, LPUNKNOWN pUnkOuter ); But I'm really struggling with understanding what I should use as parameters on the Java side of things. With JNA you're supposed to create Java classes matching the native C structs, and I have done so succesfully with other parts of the WinAPI. From what I've (I think) understood so far the LPDIRECTSOUND is a typedef to a "Long pointer to a

Reading and writing Windows “tags” with Python 3

时间秒杀一切 提交于 2021-02-08 07:37:26
问题 In Windows image files can be tagged. These tags can be viewed and edited by right clicking on a file, clicking over to the Details tab, then clicking on the Tags property value cell. I want to be able to read and write these tags using Python 3. This is not EXIF data so EXIF solutions won't work. I believe it's part of the Windows Property System, but I can't find a reference in Dev Center. I looked into win32com.propsys and couldn't see anything in there either. I wrote a program that does

RtlGenRandom/CryptGenRandom or other WinAPI to generate cryptographically secure random numbers (first quarter of 2018) [closed]

痞子三分冷 提交于 2021-02-08 07:26:05
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Improve this question I swear, this seems to be changing every time I check the MSDN documentation. When I coded my executable Microsoft was suggesting to use RtlGenRandom API to generate cryptographically strong random numbers. Now when I'm checking documentation for RtlGenRandom

RtlGenRandom/CryptGenRandom or other WinAPI to generate cryptographically secure random numbers (first quarter of 2018) [closed]

自古美人都是妖i 提交于 2021-02-08 07:25:01
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Improve this question I swear, this seems to be changing every time I check the MSDN documentation. When I coded my executable Microsoft was suggesting to use RtlGenRandom API to generate cryptographically strong random numbers. Now when I'm checking documentation for RtlGenRandom

How to find out API functions of DLL files?

坚强是说给别人听的谎言 提交于 2021-02-08 06:45:28
问题 Is there a way to get all the API (Export) functions from a DLL file ? I know that programs such as Depend s and PE Explorer can do that but none of them retrieve the argument list. 回答1: Unless the exported functions are something like a COM DLL or C++ with munging, the information simply isn't there to provide the arguments. It's normally possible to find the total size of the arguments, and there's a pretty decent chance that dividing by 4 will give something close to the right number, but

Why does the SetScrollInfo() function sends a WM_SIZE message to WndProc()?

谁都会走 提交于 2021-02-08 06:37:33
问题 Why does the SetScrollInfo() function sends a WM_SIZE message to WndProc() ? EDIT Apparently, this is a bug in the WinAPI. The WM_SIZE message was being sent because I forgot to include the WS_HSCROLL | WS_VSCROLL styles in the window creation. Once that was corrected, the WM_SIZE isn't being sent anymore. Thanks. 回答1: Since this is a documented feature, it's likely not a bug. From http://msdn.microsoft.com/en-us/library/windows/desktop/ms632646.aspx: Remarks If the SetScrollPos or MoveWindow