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
2 answers

win32: simulate a click without simulating mouse movement?

I'm trying to simulate a mouse click on a window. I currently have success doing this as follows (I'm using Python, but it should apply to general…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
10
votes
10 answers

What's the idiomatic way to do async socket programming in Delphi?

What is the normal way people writing network code in Delphi use Windows-style overlapped asynchronous socket I/O? Here's my prior research into this question: The Indy components seem entirely synchronous. On the other hand, while ScktComp unit…
Barry Kelly
  • 41,404
  • 5
  • 117
  • 189
10
votes
4 answers

How can I check if my application has focus?

What I want to do is check if my application has focus because if it is not then I will popup an Alert Window just over the Notification Area to display some message to the end user.
fossilz
  • 337
  • 4
  • 17
10
votes
1 answer

Programmatically duplicating the desktop on Windows 10

I've been looking into ways to programmatically manage my monitors using C++. It looks like functions like EnumDisplayDevices, EnumDisplaySettings and ChangeDisplaySettings can be used to, e.g., change the resolution of individual display devices…
phaz
  • 872
  • 9
  • 23
10
votes
7 answers

How do I detect the DLLs required by an application?

In a nutshell: I want to do the same thing "Dependency Walker" does. Is there any Win32 API function which can enumerate the dependencies of a EXE and/or DLL file? And is there any safe way to detect dependencies on ActiveX classes? (I doubt it is…
Daniel Rikowski
  • 71,375
  • 57
  • 251
  • 329
10
votes
7 answers

Looking for an alternative to windows messages used in inter-process communication

I a have a multithread application (MIDAS) that makes uses of windows messages to communicate with itself. MAIN FORM The main form receives windows messages sent by the RDM LogData(‘DataToLog’) Because windows messages are used they have the…
Charles Faiga
  • 11,665
  • 25
  • 102
  • 139
10
votes
1 answer

setlocale stuck on Windows

setlocale(LC_ALL, "uk-UA") sometimes hangs/deadlocks for me with unknown reason. Call stack is: ntdll.dll!_ZwWaitForSingleObject@12() Unknown ntdll.dll!_RtlpWaitOnCriticalSection@8() Unknown ntdll.dll!_RtlEnterCriticalSection@4() …
V_V
  • 612
  • 9
  • 23
10
votes
1 answer

How to change the console font size

How can I change the font size in a console app on Windows? Simplest way? What is the difference between changing console color using system("") and windows.h?
Mekacher Anis
  • 183
  • 1
  • 1
  • 11
10
votes
1 answer

Received Print Job Python

I have successfully managed to trigger a callback when a print job is initially requested on the local machine during spooling. However is there anyway with win32print or something similar that may allow me to handle the event in which a print job…
Malik Brahimi
  • 16,341
  • 7
  • 39
  • 70
10
votes
5 answers

Delphi notification when a file gets updated

My app contains documents in its database. The users can open the documents in which case, the document gets saved to a temporary folder and gets opened on the user's computer. I'd like to get a notification when one of these temporary files are…
Steve
  • 2,510
  • 4
  • 34
  • 53
10
votes
0 answers

CreateRestrictedToken( ) from WinAPI

My question is about WinAPI CreateRestrictedToken( ) function. How can I create token that allows process to initialize and start itself, but restrict access to all files on computer, except some specified files? Obviously we should enable logon SID…
Soup71
  • 131
  • 8
10
votes
3 answers

Change wallpaper programmatically using c++ and windows api

I've been trying to write an application, using Qt and mingw32, to download images and set them as the background Wallpaper. I have read several articles online about how to do this, in VB and C#, and to some extent how to do it in c++. I am…
Blue Peppers
  • 3,718
  • 3
  • 22
  • 24
10
votes
4 answers

Calling MoveWindow() with bRepaint set to TRUE

The following is taken from the Remarks section of the MoveWindow() documentation: If the bRepaint parameter is TRUE, the system sends the WM_PAINT message to the window procedure immediately after moving the window (that is, the MoveWindow…
user4420637
10
votes
2 answers

WM_QUIT only posts for thread and not the window?

In Windows API, I'm looking into how the GetMessage function actually works. I've seen 3 implementations of the Windows message loop and would like to explore them. 1) As of the time of writing this post, this MSDN article describes what I believe…
Nicholas Miller
  • 4,205
  • 2
  • 39
  • 62
10
votes
2 answers

Window positioning results in space around windows on Windows 10

I have some code that positions windows to screen quadrants. It works fine on Windows XP, 7, and 8/8.1. However, on Windows 10, there is a weird gap between windows. The extra space surrounds the window on all 4 sides. I presume it has something to…
Paul
  • 265
  • 1
  • 2
  • 10