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
141
votes
7 answers

Find out what process registered a global hotkey? (Windows API)

As far as I've been able to find out, Windows doesn't offer an API function to tell what application has registered a global hotkey (via RegisterHotkey). I can only find out that a hotkey is registered if RegisterHotkey returns false, but not who…
Marek Jedliński
  • 7,088
  • 11
  • 47
  • 57
141
votes
17 answers

Windows threading: _beginthread vs _beginthreadex vs CreateThread C++

What's a better way to start a thread, _beginthread, _beginthreadx or CreateThread? I'm trying to determine what are the advantages/disadvantages of _beginthread, _beginthreadex and CreateThread. All of these functions return a thread handle to a…
Kiril
  • 39,672
  • 31
  • 167
  • 226
139
votes
4 answers

Python Setup Disabling Path Length Limit Pros and Cons?

I recently installed Python 3.7 and at the end of the setup, there is the option to "Disable path length limit". I don't know whether or not I should do this. What are the pros and cons of doing this? Just from the sound of it you should always…
Qwerty Qwerts
  • 1,521
  • 2
  • 9
  • 13
132
votes
3 answers

Where to find the win32api module for Python?

I need to download it for Python 2.7, but can't seem to find it...
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
131
votes
12 answers

Check whether a path is valid

I am just wondering: I am looking for a way to validate if a given path is valid. (Note: I do not want to check if a file is existing! I only want to proof the validity of the path - So if a file could possibly exists at the location). Problem is, I…
Tobias Boschek
  • 2,158
  • 3
  • 18
  • 22
127
votes
16 answers

Where can I find my .emacs file for Emacs running on Windows?

I tried looking for the .emacs file for my Windows installation for Emacs, but I could not find it. Does it have the same filename under Windows as in Unix? Do I have to create it myself? If so, under what specific directory does it go?
Ray
  • 187,153
  • 97
  • 222
  • 204
124
votes
8 answers

Adding external library into Qt Creator project

How can I add external library into a project built by Qt Creator RC1 (version 0.9.2)? For example, the win32 function EnumProcesses() requires Psapi.lib to be added in the project to build.
Donotalo
  • 12,748
  • 25
  • 83
  • 121
121
votes
8 answers

How can a Metro app in Windows 8 communicate with a backend desktop app on the same machine?

In a situation where you have the UI frontend built using the new Metro style of apps for windows 8, and would like it to communicate with a .NET application running on the desktop on the same local machine (e.g. a windows service app). What forms…
dodgy_coder
  • 12,407
  • 10
  • 54
  • 67
121
votes
9 answers

How to write hello world in assembly under Windows?

I wanted to write something basic in assembly under Windows. I'm using NASM, but I can't get anything working. How do I write and compile a hello world program without the help of C functions on Windows?
feiroox
  • 3,069
  • 8
  • 31
  • 31
117
votes
8 answers

How can I get a list of all open named pipes in Windows?

Is there an easy way to test whether your named pipe is working correctly? I want to make sure that the data I'm sending from my app is actually being sent. Is there a quick and easy way to get a list of all the named pipes?
Doug T.
  • 64,223
  • 27
  • 138
  • 202
117
votes
3 answers

What does LPCWSTR stand for and how should it be handled?

First of all, what is it exactly? I guess it is a pointer (LPC means long pointer constant), but what does "W" mean? Is it a specific pointer to a string or a pointer to a specific string? For example I want to close a Window named "TestWindow".…
lhj7362
  • 2,173
  • 4
  • 19
  • 17
115
votes
6 answers

What is a message pump?

In this thread (posted about a year ago) there is a discussion of problems that can come with running Word in a non-interactive session. The (quite strong) advice given there is not to do so. In one post it is stated "The Office APIs all assume…
Matt Gutting
  • 1,151
  • 2
  • 8
  • 3
113
votes
4 answers

Exporting functions from a DLL with dllexport

I'd like a simple example of exporting a function from a C++ Windows DLL. I'd like to see the header, the .cpp file, and the .def file (if absolutely required). I'd like the exported name to be undecorated. I'd like to use the most standard calling…
Aardvark
  • 8,474
  • 7
  • 46
  • 64
113
votes
11 answers

Can I download the Visual C++ Command Line Compiler without Visual Studio?

As per the title. I don't want to download the entire Visual C++ installer, only "cl.exe" and the other programs required for compiling and linking C++ programs on Windows.
magnus
  • 4,031
  • 7
  • 26
  • 48
112
votes
14 answers

Generating a unique machine id

I need to write a function that generates an id that is unique for a given machine running a Windows OS. Currently, I'm using WMI to query various hardware parameters and concatenate them together and hash them to derive the unique id. My question…
HS.
  • 15,442
  • 8
  • 42
  • 48