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

WM_KEYDOWN repeat count?

The MSDN documentation says that the LParam first 15 bits is used for repeat count , but it says that it is not accumulative Now unless i am missing something here, why does it call it a repeat count but says it is not accumulative? This is an…
sporingGT
  • 151
  • 1
  • 9
10
votes
2 answers

How do I balance script-oriented OpenType features with other OpenType features using DirectWrite?

Full disclosure: I'm working on my libui GUI framework's text API. This wraps DirectWrite on Windows, Core Text on OS X, and Pango (which uses HarfBuzz for OpenType shaping) on other Unixes. One of the text formatting attributes I want to specify is…
andlabs
  • 11,290
  • 1
  • 31
  • 52
10
votes
3 answers

Java - Window Image

Does anyone know how to capture a screen shot in Java (not it's own screen, but any other window on the desktop and they don't necessarily have to be the active window) in Windows? There are a number of threads here on this similar subject, but I…
rog8gm
  • 169
  • 2
  • 2
  • 10
10
votes
10 answers

difference between API and DLL

I would like to know the exact differences between API and DLL. Thank you.
imahan
  • 117
  • 1
  • 1
  • 4
10
votes
5 answers

Changing a Window's message loop thread

Recently I tried putting a window's message loop in its own thread, and I wondered why it never received any messages, but I have learned that Windows posts messages to the thread that created the window. How do you create a window in one thread and…
Epro
  • 673
  • 2
  • 7
  • 9
10
votes
5 answers

Display a message box with a timeout value

The question comes from code like this. Set scriptshell = CreateObject("wscript.shell") Const TIMEOUT_IN_SECS = 60 Select Case scriptshell.popup("Yes or No? leaving this window for 1 min is the same as clicking Yes.", TIMEOUT_IN_SECS, "popup…
Anonymous Type
  • 3,051
  • 2
  • 27
  • 45
10
votes
3 answers

how can I convert wstring to u16string?

I want to convert wstring to u16string in C++. I can convert wstring to string, or reverse. But I don't know how convert to u16string. u16string CTextConverter::convertWstring2U16(wstring str) { int iSize; u16string szDest[256] =…
D.A.KANG
  • 265
  • 2
  • 4
  • 12
10
votes
3 answers

CBT Hooks in Windows... What does "CBT" stand for?

Here's a quick one. I'm starting out with using hooks in in Windows, and I notice that there's a hook type called a "CBT" hook. Though I know how it's used from the documentation, what does CBT stand for, exactly? I'm having a bit of trouble…
Dave Markle
  • 95,573
  • 20
  • 147
  • 170
10
votes
4 answers

Obtain a list of partitions on Windows

Goal I'm porting a filesystem to Windows, and am writing a more Windows-like interface for the mounter executable. Part of this process is letting the user locate a partition and pick a drive letter. Ultimately the choice of partition has to result…
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
10
votes
3 answers

TBBUTTON struct not working with SendMessage

I'm trying to send the TB_GETBUTTON message to get info about the buttons inside this Toolbar control marked in red color: ( The System tray notification area ) The problem is that when I send the message, the Explorer refreshes itself, is very…
ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
10
votes
4 answers

How to generate a monochrome bit mask for a 32bit bitmap

Under Win32, it is a common technique to generate a monochrome bitmask from a bitmap for transparency use by doing the following: SetBkColor(hdcSource, clrTransparency); VERIFY(BitBlt(hdcMask, 0, 0, bm.bmWidth, bm.bmHeight, hdcSource, 0, 0,…
Mordachai
  • 9,412
  • 6
  • 60
  • 112
10
votes
1 answer

win32gui.FindWindow Not finding window

I'm trying to send a keystroke to an inactive TeraTerm Window using Pywin32. This answer led me to write this code: import win32gui import win32con import win32api hwndMain = win32gui.FindWindow("Tera Term VT", None) print hwndMain hwndChild =…
SiHa
  • 7,830
  • 13
  • 34
  • 43
10
votes
12 answers

"Repair" network connections programmatically/from command line

Does anyone know exactly what Windows XP does when you click "Repair" on a network connection? I'd like to do the same programmatically or from a command line. I did a Google search and found this article, which has a good explanation, but I don't…
EMP
  • 59,148
  • 53
  • 164
  • 220
10
votes
3 answers

Running a process with lowest possible privileges in winapi

I am writing something similar to the http://ideone.com/. Currently I am running user processes with CreateProcess call. I kill the process if it runs longer then specified amount of time but I don't know how to deny read/write filesystem rights /…
Klark
  • 8,162
  • 3
  • 37
  • 61
10
votes
5 answers

What API call would I use to change brightness of laptop (.NET)?

I have Windows Server 2008 installed on a Sony laptop and the brightness control doesn't work. I'd like to write a program to allow me to change it. Currently what I have to do is open the Power control panel, click advanced settings, and fight…
Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689