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

Screen goes black when i use SendInput to send mouse cursor positions

I am using SendInput() to send relative positions of the mouse. First ill tel you what am doing. i use my finger to move the mouse. So first i track my finger in a 640x480 image and get the absolute position in pixels with in the image. then i send…
user2389323
  • 769
  • 2
  • 10
  • 22
11
votes
3 answers

What is the relationship of CloseWindow and WM_CLOSE

I'm a bit confused currently: Are WM_CLOSE and ::CloseWindow in any way "related" or are for completely different things? The docs for Closing Windows don't mention the API function CloseWindow at all. Should CloseWindow be really called…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
11
votes
7 answers

Getting the currently logged-in windows user

I found this via google: http://www.mvps.org/access/api/api0008.htm '******************** Code Start ************************** ' This code was originally written by Dev Ashish. ' It is not to be altered or distributed, ' except as part of an…
adambox
  • 24,261
  • 9
  • 32
  • 34
11
votes
4 answers

FindWindow does not find the a window

I have a plan for make a simple trainer console with C++ but first step I've got problem with FindWindow() #include #include #include #include #include LPCTSTR WindowName = "Mozilla…
ginc0de
  • 151
  • 1
  • 2
  • 12
11
votes
4 answers

Does KEY_WOW64_64KEY have any effect on 32 bit Windows?

It appears that specifying the KEY_WOW64_64KEY flag (reference) when accessing a registry key under 32-bit Windows XP has no effect - that is, no error is thrown, and the key is opened as if you hadn't had the flag set. I know Windows 2000 throws an…
Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
11
votes
4 answers

How to launch a Windows process as 64-bit from 32-bit code?

To pop up the UAC dialog in Vista when writing to the HKLM registry hive, we opt to not use the Win32 Registry API, as when Vista permissions are lacking, we'd need to relaunch our entire application with administrator rights. Instead, we do this…
Jonas
  • 1,172
  • 1
  • 16
  • 26
11
votes
2 answers

Is DbgHelp.dll built-in to Windows? Can I rely on it being there?

I use Jochen Kalmbach's StackWalker class from CodeProject, to produce a stacktrace when an exception occurs in my DLL. It relies on DbgHelp.dll Is DbgHelp.dll built-in to Windows Vista, WS2008, Windows 7? I know about The Debugging Tools for…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
11
votes
6 answers

How to open file in exclusive mode in C++

I am implementing some file system in C++. Up to now I was using fstream but I realized that it is impossible to open it in exclusive mode. Since there are many threads I want to allow multiple reads, and when opening file in writing mode I want to…
rank1
  • 1,018
  • 4
  • 16
  • 37
11
votes
2 answers

Read other process current directory in C#

I am trying to get current working directory of selected process. I am sure that it is possible, because tools like Process Explorer can show this information. I found out that this information is stored in PEB. Moreover I found Oleksiy blog post:…
Piotr Stapp
  • 19,392
  • 11
  • 68
  • 116
11
votes
1 answer

How to receive keyboard input from application with admin privileges to a non-admin application?

I have programmed an application that has an overlay-kind of window that can be shown and hidden via hotkey while another application has the focus. Said other application is a DirectX game that runs with admin privileges. I have already tried 3…
DNR
  • 1,619
  • 2
  • 14
  • 22
11
votes
3 answers

Call Windows API from node.js msg

I am new at Node, I have this simple Node.js server works on windows Server Code var ws = require("websocket-server"); var server = ws.createServer(); server.addListener("connection", function(client){ console.log("new connection"); …
Mohammed Khabbaz
  • 113
  • 1
  • 1
  • 4
11
votes
9 answers

How to PlaySound in C++ using Windows API?

I try to play a music file in my coding, but failed. I have my music file in the same folder which save .cpp file. Can someone help me? My code is: #include #include int main() { PlaySound("kenny g.WAV", NULL,…
user189748
11
votes
2 answers

Is WSAGetLastError() just an alias for GetLastError()?

In my code, I have asynchronous I/O with I/O Completion Ports, and for the read/write completion callbacks, I get a HANDLE (that of course can be a socket, file handle, named pipe and so on). So if something is wrong in such routine, I want to check…
Marco Pagliaricci
  • 1,366
  • 17
  • 31
11
votes
2 answers

Why is FindWindow() not 100% reliable?

I'm using this Delphi 7 code to detect if Internet Explorer is running: function IERunning: Boolean; begin Result := FindWindow('IEFrame', NIL) > 0; end; This works on 99% of the systems with IE 8,9 and 10. But there are some systems…
Casady
  • 1,426
  • 3
  • 19
  • 39
11
votes
1 answer

How to detect screen resolution change in Delphi?

The question is simple. How to detect screen resolution change in Delphi ?
Dmitry
  • 14,306
  • 23
  • 105
  • 189