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
1 answer

GetClipboardData(CF_TEXT)

How to use GetClipboardData(CF_TEXT); without calling and use process id of this in C++? and which libary does GetClipboardData(CF_TEXT) belong to?
behnam27
  • 241
  • 2
  • 4
  • 11
11
votes
2 answers

GetDC(NULL) gets primary monitor or virtual screen?

Looking around the net I see that most people think that GetDC(NULL) will get a device context for the entire primary monitor (the one with 0,0 at its top left). However, I get the feeling most people are just saying that because that's what the…
user2044467
  • 113
  • 1
  • 1
  • 5
11
votes
2 answers

Why do I get "Constant expression violates subrange bounds" for HKEY_-constants in Delphi XE2 64bit?

When I compile the following code in Delphi XE2 for the target platform 64-bit Windows ... function HKeyToString(_HKey: HKey): string; begin case _HKey of HKEY_CLASSES_ROOT: result := 'HKEY_CLASSES_ROOT'; // do not translate …
dummzeuch
  • 10,975
  • 4
  • 51
  • 158
11
votes
1 answer

Is there any API function for shutting down Windows while installing any pending updates?

I know the ExitWindowsEx() API function which simply shuts down Windows. But as far as I know, you cannot make Windows install any pending updates with it. Is there any API support for installing any pending updates (in that standard blue screen…
hkBattousai
  • 10,583
  • 18
  • 76
  • 124
11
votes
2 answers

To use DefWindowProc or not to use DefWindowProc

I'm currently writing my own mini visual framework to wrap pure WinAPI in classes. Currently the process of analyzing messages looks as follows: static Application::Run has a message loop; it gets new message and dispatches it to apropriate…
Spook
  • 25,318
  • 18
  • 90
  • 167
11
votes
2 answers

Is there a way to detect if a monitor is plugged in?

I have a custom application written in C++ that controls the resolution and other settings on a monitor connected to an embedded system. Sometimes the system is booted headless and run via VNC, but can have a monitor plugged in later (post boot). …
martinarcher
  • 137
  • 2
  • 9
11
votes
5 answers

Why is difficult to disassemble native Win32, but easy to disassemble .NET app?

Why is the process of disassembling a native Win32 image (built in C/C++ for e.g.) miles more difficult than disassembling a .NET app? What is the main reason? Because of what?
Secret
  • 2,627
  • 7
  • 32
  • 46
11
votes
2 answers

What is a "Job" (child process thing) in Windows, and when to use it?

Using Process Explorer (procexp.exe), especially with Google Chrome, child processes are called a Job. Same with Internet Explorer 8, but I noticed it first with Chrome. What is a Job What should I know about these things? Why would (you|one) use…
CS.
  • 1,845
  • 1
  • 19
  • 38
11
votes
2 answers

Set Window.Owner using hWnd

In my WPF/C# app I'm creating a dialog window using code like the below: Window dialog = new MyDialog() as Window; dialog.Owner = Window.GetWindow(this); dialog.ShowDialog(); How can I set the dialog owner to the hWnd of another applications…
Drahcir
  • 11,772
  • 24
  • 86
  • 128
11
votes
4 answers

Demangling in MSVC

How can i demangle name in MSVC? There's abi::__cxa_demangle function in gcc. In MSDN i've found UnDecorateSymbolName: http://msdn.microsoft.com/ru-ru/library/windows/desktop/ms681400%28v=vs.85%29.aspx Unfortunately, this function can't undecorate…
FrozenHeart
  • 19,844
  • 33
  • 126
  • 242
11
votes
1 answer

How to launch the associated application for a file / directory / URL?

Linux seems to be easy: xdg-open . Apparently, Mac is similar: open should be used instead of xdg-open. I don't have access to a Mac so I couldn't test it. For Windows, I found 4 different suggestions and those that I have tried…
Ali
  • 56,466
  • 29
  • 168
  • 265
11
votes
1 answer

Authenticating users using Active Directory in Client-Server Application

I've been asked to provide support for authenticating users against an Active Directory in our existing client server application. At the moment a user supplies a user name and password from a client machine, passed over the wire (encrypted) to…
Alan
  • 13,510
  • 9
  • 44
  • 50
11
votes
3 answers

How to change a Window Owner using its handle

I want to make a .NET Form as a TopMost Form for another external App (not .NET related, pure Win32) so it stays above that Win32App, but not the rest of the apps running. I Have the handle of the Win32App (provided by the Win32App itself), and I've…
Ricardo Amores
  • 4,597
  • 1
  • 31
  • 45
11
votes
1 answer

How can I create a menu in the start menu for my program?

This may be an easy question but I am not even sure of the terminology to search, so I have to ask. I want my program to have a menu when it is hovered over if it is pinned to the start menu. I am attaching a screenshot where windows powershell…
Joe
  • 999
  • 1
  • 8
  • 20
11
votes
3 answers

Are resource files compiled as UNICODE or ANSI code-page?

First - my apologies if this has been answered a hundred times over! D'oh! But my search-fu apparently sucks, as I'm having no luck answering this basic question: How are resources stored in the EXE/DLL? As UNICODE (UCS-2, Windows native internal…
Mordachai
  • 9,412
  • 6
  • 60
  • 112