user32.dll implements the Windows USER component that creates and manipulates the standard elements of the Windows user interface, such as the desktop, windows, and menus.
Questions tagged [user32]
547 questions
5
votes
2 answers
WinForms equivalent of WPF WindowInteropHelper, HwndSource, HwndSourceHook
I have a block of code like:
IntPtr hWnd = new WindowInteropHelper(this).Handle;
HwndSource source = HwndSource.FromHwnd(hWnd);
source.AddHook(new HwndSourceHook(WndProc));
NativeMethods.PostMessage((IntPtr)NativeMethods.HWND_BROADCAST,…

kmarks2
- 4,755
- 10
- 48
- 77
5
votes
1 answer
Detect game hack through screenshot analysis C#
I'm trying to write some code to detect a wallhack for a game.
Basically, some hacks exist which create a windows aero transparent window, and they draw the hack onto this external window, so it can't be detected by taking a screenshot of the game…

DaManJ
- 373
- 2
- 15
4
votes
3 answers
AutoIT, or User32 button clicking working sporadically
I'm trying to automate the testing of an application, and I'm stuck on an issue that I'm struggling to troubleshoot.
The application has standard windows buttons, and I've tried with both AutoIT and the User32 dll to click some of these buttons.…

AlishahNovin
- 1,904
- 3
- 20
- 37
4
votes
2 answers
How do I get the active ChildWindow of an application?
I want to send a pressKey event to a certain application which is not the active application IN Windows so I have to use the sendMessage/postMessage api calls.
However, I need to know the exact child window that is active IN the application and send…

Noyoudont
- 155
- 3
- 7
4
votes
1 answer
Use a window handle as an owner for a VB6 form
What is the Win32 equivalant of Form2.Show vbModeless, Form1 that allows me to set the owner (not the parent) to an arbitrary hWnd and set the default position, etc?
As far as I'm aware, this can only be set when creating a window.

Deanna
- 23,876
- 7
- 71
- 156
4
votes
1 answer
node ffi - GetWindowRect
I am building a Windows Electron app that will move and resize an active window.
I am using ffi-napi to access user32 specific functions such as GetForegroundWindow, ShowWindow, & SetWindowPos.
const ffi = require('ffi-napi');
// create foreign…

Neo Genesis
- 922
- 11
- 26
4
votes
1 answer
PInvoke GetWindowRect Equivalent for Linux
I'm trying to write a program that will output window positions/size using C# .Net Core. I've done this for Windows using the PInvoke nuget package that essentially uses User32 dll. I'm trying to do the same thing but for linux distribution.
Does…

Gooby200
- 41
- 3
4
votes
0 answers
SetWindowPos above other window
So, I have an application. I want it to always sit exactly one z-level above a target application. It is just going to display a status message in the title bar, it's ugly but it's the requirement I have to meet.
Like this:
I looked into WM_NCPAINT…

ScottishTapWater
- 3,656
- 4
- 38
- 81
4
votes
1 answer
Using PostMessage to send Unicode characters
I am using PostMessage to send input to a flash object in another application. It works fine until I try to send a unicode character. In this example:
Michael’s Book
The apostrophe is not really that, it is not an ASCII 39, but rather a unicode…

Vincent James
- 1,120
- 3
- 16
- 27
4
votes
3 answers
node ffi Rect type
I want to get a specific window's size in node, using the node-ffi and user32 libraries. Can't make the Rect pointer work at all, I'm either getting NULL as output, or fatal…

Exceptional NullPointer
- 778
- 1
- 9
- 21
4
votes
1 answer
Programming multiple custom Clipboard, using windows Clipboard - few complications
I am trying to build a C# background app that would hook keyboard keystrokes (e.g. CAPS + (A/B/C/....)) to act as a Copy to many different clipboard.
First of all, I looked for a Windows Method that would act like a CTRL+V does : Directly paste a…

kokolol
- 123
- 10
4
votes
2 answers
User32 API calls in .NET
I'm currently planning out a project involving creating a shell replacement for Windows (based on Blackbox, bblean specifically). However I wish to leverage the power of .NET to do so. Many of the API calls I'll need are housed within the User32…

Ryan Taylor
- 121
- 1
- 6
4
votes
1 answer
Where are GUI handles managed?
As I understand from windows internals, handles of executive objects are not managed by the same entity as handles you get from functions like CreateWindow() or LoadCursor() and such.
What dll/sys is responsible for these ones returned by functions…

Pyjong
- 3,095
- 4
- 32
- 50
4
votes
0 answers
Unable to receive all the pointer/touch messages injected at application level using Windows 8 Touch Inject API
I am able to inject pointer/touch messages successfully but unable to receive all the messages injected on an application (messages are captured in the application) even though all the messages are injected successfully without any errors. Please do…

user970478
- 41
- 3
4
votes
2 answers
GetWindowText() throwing error and not being caught by try/catch
When I run the code below for the GetWindowText I get the following error thrown as an inner Exception:
{"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}
[DllImport("user32.dll",…

Neil_M
- 462
- 5
- 17