Questions tagged [winapi]

The Windows API (formerly called the Win32 API) is the core set of application programming interfaces available for the Microsoft Windows operating systems. This tag is for questions about developing native Windows applications using the Windows API.

The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. It was formerly called the Win32 API; however, the name Windows API more accurately reflects its roots in 16-bit Windows and its support on 64-bit Windows. Almost all Windows programs interact with the Windows API. You can find more help on the Windows API Documentation.

The Windows API (Win32) is primarily focused on the C programming language in that its exposed functions and data structures are described in that language in recent versions of its documentation. However, the API may be used by any programming language compiler or assembler capable of handling the (well defined) low level data structures along with the prescribed calling conventions for calls and callbacks.

42239 questions
10
votes
1 answer

OF macro in iowin32.h

I can't understand the following line from minizip's iowin32.h: void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); (Source, outdated but still relevant) What does the OF macro do?
Natan Yellin
  • 6,063
  • 5
  • 38
  • 57
10
votes
0 answers

Does Windows remove hooks automatically?

Win32 API allows creating hook into system processes such as mouse hook (WH_MOUSE_LL), a hook is created with SetWindowsHookExA/W functions. The scenario is, a programme has installed a hook into Windows system with a local function; the programme…
Dee
  • 7,455
  • 6
  • 36
  • 70
10
votes
1 answer

SHGetKnownFolderPath / Environment.GetFolderPath() returning wrong value for public documents

I got a somewhat strange error when trying to resolve the CommonDocuments directory. It keeps resolving to the wrong directory, after the CommonDocuments directory has been redirected / moved to a new location using Windows Explorer…
yas4891
  • 4,774
  • 3
  • 34
  • 55
10
votes
3 answers

Win32 named pipes and remote clients

Can I access a named pipe on computer A from computer B given computer A's IP address? If so, what do I need to do to make this happen?
Voyager Systems
10
votes
1 answer

Windows: Overwrite File In Use

I am trying to write a utility that will allow moving files in Windows, and when it finds a file in use, will set that file to be moved on reboot. It seems that MoveFileEx (http://msdn.microsoft.com/en-us/library/aa365240(VS.85).aspx) is the right…
singpolyma
  • 10,999
  • 5
  • 47
  • 71
10
votes
1 answer

Why is EnumChildWindows skipping children?

I'm getting strange behavior when it comes to using the Windows API method EnumChildWindows. It seems to not be picking up a section of children windows. When I drill down using Spy++ I can see the children, but when I execute my code, it doesn't…
Dekryptid
  • 1,062
  • 1
  • 9
  • 21
10
votes
5 answers

Is there an un-buffered I/O in Windows system?

I want to find low-level C/C++ APIs, equivalent with "write" in linux systems, that don't have a buffer. Is there one? The buffered I/O such as fread, fwrite are not what I wanted.
user53670
10
votes
1 answer

Why are some items greyed out in Spy++'s Windows view?

To modify a window of another program, I need to find a specific SysTreeView32 in it using EnumChildWindows API call. When I inspect the window using Spy++, there are a number of SysTreeView32's in it but all are greyed out except one, which is the…
Hossein
  • 4,097
  • 2
  • 24
  • 46
10
votes
2 answers

Too many raw input device from GetRawInputDeviceList()

After a UINT lSize; GetRawInputDeviceInfo(hDevice, RIDI_DEVICEINFO, NULL, &lSize); RID_DEVICE_INFO* lInfo = (RID_DEVICE_INFO*) malloc(lSize); GetRawInputDeviceInfo(hDevice, RIDI_DEVICEINFO, lInfo, &lSize); I get 9 devices: 3 mouse, 3 keyboards,…
user408141
10
votes
1 answer

How to display an image in full screen borderless window in openCV

I want to display an image in OpenCV in a full screen borderless window. In other words, only the image pixels will appear, without menu, toolbar, or window background. Using imshow() or cvShowImage() don't enable it: The window grows to be full…
DanielHsH
  • 4,287
  • 3
  • 30
  • 36
10
votes
4 answers

Disable antialiasing for a specific GDI device context

I'm using a third party library to render an image to a GDI DC and I need to ensure that any text is rendered without any smoothing/antialiasing so that I can convert the image to a predefined palette with indexed colors. The third party library i'm…
Jacob Stanley
  • 4,704
  • 3
  • 33
  • 36
10
votes
3 answers

WPF Minimize on Taskbar Click

I have a WPF application that by stakeholder requirement must have a WindowStyle="None", ResizeMode="NoResize" and AllowTransparency="True". I know that by not using the Windows chrome, you have to re-implement many of the OS window-handling…
sidney.andrews
  • 5,146
  • 3
  • 23
  • 29
10
votes
5 answers

Detecting a scheduled shutdown

I have a cmd script that will execute a set of patches, and it's designed to abort if a reboot is required to avoid patching issues. I'd also like to extend the script to abort if a reboot is scheduled (E.g. via the "shutdown" command) in order to…
Ificator
  • 101
  • 1
  • 1
  • 3
10
votes
2 answers

Asynchronous ReadDirectoryChangesW - GetQueuedCompletionStatus always times out

Exactly as it sounds, I'm attempting asynchronous ReadDirectoryChangesW with IO Completion and it isn't working, specifically, GetLastError repeatedly returns 258 (GetQueuedCompletionStatus timeout). I have structs: typedef struct dirinfo_struct { …
user257111
10
votes
2 answers

How to get a win32 handle of an open file in python?

I'm sure this is documented somewhere but i can't find it... My code is getting a python object from another library (that i can't modify), and i need to call some win32 api functions on it. Python returns something that isn't the os-level handle…
bdew
  • 1,330
  • 9
  • 22