Questions tagged [user32]

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.

547 questions
0
votes
1 answer

Detecting KeyDown and KeyUp events with no form in focus (nor in foreground)

I wish the user to be able to press the Ctrl, and my form does something and upon releasing this key, the form does something else. Unfortunately, my form may not be in focus (nor the foreground window). How can I achieve this? I'm guessing it's a…
friartuck
  • 2,954
  • 4
  • 33
  • 67
0
votes
2 answers

Is there a C# ready-to-use class that imports everything from USER32.DLL?

I am tired of looking up for method signatures. I'd rather just type something like User32.SendMessage.... Is there something like that? Basically have a static class with bunch of definitions like : [DllImport("user32.dll")] public static extern…
Schultz9999
  • 8,717
  • 8
  • 48
  • 87
0
votes
1 answer

When is a Paint msg being invoked on a CCmdUI::Enable() call?

I'm trying to debug this problem in a library where a set of controls are not being updated to be disabled. I've drilled down to a point where I've hit a black box. A mfc120ud.dll!CCmdUI::DoUpdate() call will then call CCmdUI::Enable(). It'll then…
Adrian
  • 10,246
  • 4
  • 44
  • 110
0
votes
1 answer

Getting mouse events

I'm working in C# and would like to get all the mouse events. What is the best why to do so. I tried: SetWindowsHookEx(WH_MOUSE_LL, proc, GetModuleHandle(curModule.ModuleName), 0); I couldn't make it to work and it's limited to a…
Guy
  • 325
  • 2
  • 6
  • 14
0
votes
2 answers

switch application and assigning them to instance

I'm having problems with switching application and assigning them to a variable. This is what I have so far. [DllImport("user32.dll")] public static extern void SwitchToThisWindow(IntPtr hWnd, bool b); Process[] procs =…
civic.sir
  • 400
  • 1
  • 9
  • 26
0
votes
1 answer

How to put background window/process on top

I want to create a software like a virtualkeyboard, you have a AlwaysTop Window and use this to put some data on another process/windows. In this case I will record all data on clipboard and compare if this data is compatible with a pattern (A### is…
Paixão
  • 1
  • 1
0
votes
2 answers

Enumerate all controls inside window

I'm trying to enumerate all controls inside a window using user32.dll, but I don't know exactly what I need to do. I'm using EnumWindows and EnumChildWindows, but it doesn't retrieve all controls inside a window. I want to get the text of some…
user1938667
0
votes
0 answers

How to determine unique application from a HWND or PID?

I want to monitor OS-level program foreground changes, but I'm having trouble uniquifying the returned application. I'm using a combination of SetWinEventHook, EVENT_SYSTEM_FOREGROUND and WinEventProc callback to get the foreground change events.…
Mark Jeronimus
  • 9,278
  • 3
  • 37
  • 50
0
votes
0 answers

Alt+key not working with PostMessage(use32.dll)

I read this answer Link It is exactly what i tring to do,i need to send postmessage Alt+'E' to winApp but it's not working i used Spy++ and duplicate Wparametr and Lparametr and build it with postmessage. I did the same but i can't get the Alt+E…
Vladimir Potapov
  • 2,347
  • 7
  • 44
  • 71
0
votes
2 answers

what is proper syntax for using user32.dll in static method?

In the following code, why does user32 cause an error? I thought that by adding [DllImport("user32.dll", CharSet = CharSet.Unicode)] above a method body that I could then make statements like user32.IsWindowVisible(hWnd) but the user32 portion of…
sapbucket
  • 6,795
  • 15
  • 57
  • 94
0
votes
0 answers

How to use Post/SendMessage (User32.dll) to make Alt+Space combitation/event

I need to make Post/SendMessage that will make Alt+Space that will open some tab that i need in windows aplication.I can't use SendKeys SendKeys.Send("% ") i have to use Post/SendMessage only. This what i have tried so far private const uint…
Vladimir Potapov
  • 2,347
  • 7
  • 44
  • 71
0
votes
2 answers

How to click on Menu items with PostMessage/SendMessage User32

Hello i have Windows aplication,i need to click on One on Menu/Tabs items.I can find the Menu with all options,files,help.... tabs ,but i can't find the way how to get to my item. I can't send picture of my aplication,but i will send the same…
Vladimir Potapov
  • 2,347
  • 7
  • 44
  • 71
0
votes
0 answers

Closing a child window forcefully using window title

I want to close a child window of a running application programmatically. I am using the following code: const UInt32 WM_CLOSE = 0x0010; [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] public static extern IntPtr FindWindow(String…
BhushanK
  • 1,205
  • 6
  • 23
  • 39
0
votes
1 answer

FindWindow don't see ,but winSpy can see IE8 (user32.dll)

I need to find download dialog in IE8, i all ready did this in IE8+ ,and all work 100%,i finded the name and class of window/perent window with Spy++/WinSpy,and get my findow.But in IE8 i get stuck,the download dialog don't have any perents,and it…
Vladimir Potapov
  • 2,347
  • 7
  • 44
  • 71
0
votes
0 answers

Capturing keys from IntPtr

This question is related to Visual Basic .NET 2010 Hey. I need to capture keys from a window handle on my form. This is what my code does: Use a webbrowser control to navigate to a website Get window handle of an object on the…
Jeff Reed
  • 231
  • 1
  • 6
  • 23