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
3
votes
0 answers

SetWindowPos returns Access Denied

I'am building app that helps taking screenshots of selected windows. I'am displaying semi-transparent form over selected window. I'am using winapi in this case. [DllImport("user32.dll", SetLastError = true)] public static extern bool…
mrcc
  • 31
  • 3
3
votes
1 answer

Using RegisterHotKey to register hot key using Numpad

I have used RegisterHotKey for registering a global hotkey for my application. I need to register Control + Shift + 0 (in numpad) for the application. I have registered it using the below code snippet: RegisterHotKey(_mainWindowHandle, 1,…
Pratik Bhattacharya
  • 3,596
  • 2
  • 32
  • 60
3
votes
2 answers

Find control of specific class in another application

I am scrapping content from another Windows application. The application has a Listbox and two TRichEdit controls (and other controls without interest). When using SendKeys.SendWait("{DOWN}") to the Listbox, the content in the two TRichEdit boxes…
Anders Finn Jørgensen
  • 1,275
  • 1
  • 17
  • 33
3
votes
1 answer

c# focus window of a runing program

i want to focus a program from my c# application.i searched lot and found some examples.but i got error .i'm using visual studio.ShowWindow(hWnd, SW_HIDE); line gives me an error "showwindow(system.IntPtr,int) has some invalid argument" plz where is…
Piumi Wandana
  • 220
  • 1
  • 5
  • 14
3
votes
2 answers

WinForms: How to determine if window is no longer active (no child window has focus)?

My application uses multiple windows I want to hide one specific window in case the application loses focus (when the Active Window is not the application window) source I am handling the Deactivate event of my main form. private void…
Marek
  • 10,307
  • 8
  • 70
  • 106
3
votes
1 answer

Tab control high CPU usage with WS_EX_COMPOSITED

I have a standard windows Tab control created with the WS_EX_COMPOSITED Extended Window Style to deal with the flickering when resizing of the tab but one of the Tab child windows is a ListView (LVS_OWNERDRAWFIXED) that's set to LVS_REPORT and this…
Col_Blimp
  • 779
  • 2
  • 8
  • 26
3
votes
2 answers

Windows Explorer IShellFolderViewDual::SelectItem usage

I'm writing some code will automate selection of Window Explorer(explorer.exe) items. And I found two methods that might help: HRESULT SelectItem( [in] VARIANT *pvfi, [in] int dwFlags ); // from…
tom91136
  • 8,662
  • 12
  • 58
  • 74
3
votes
1 answer

SetMenuItemBitmaps BMP transparent colour

How do I set the transparent colour of a BMP image for SetMenuItemBitmaps, I'm currently using LoadImage with uType as IMAGE_BITMAP and fuLoad as LR_LOADFROMFILE + LR_LOADTRANSPARENT?
Col_Blimp
  • 779
  • 2
  • 8
  • 26
3
votes
1 answer

How can I retrieve the values from window of class "ThunderRT6ListBox" using user32.dll in c#

I am trying to retrieve information from extern desktop aplication in Windows. I know how extract the text from Textboxes (class "Edit") but I don't know how extract the values from controls with class name "ThunderRT6ListBox" and…
dlopezgonzalez
  • 4,217
  • 5
  • 31
  • 42
3
votes
1 answer

SetWindowsHookEx for WM_MOUSEWHEEL

I need a code example written in VB.NET to capture the mousewheel scrolling events outside the form using a low-level hook with user32.dll and WM_MOUSEWHEEL like said by Hans Passant answer in my other question: Record mouse Middle button and wheel…
ElektroStudios
  • 19,105
  • 33
  • 200
  • 417
3
votes
1 answer

Wrong window shows up on taskbar when calling `Show()`

This one has me puzzled, and I am starting to believe it's a bug in either the core winapi, or possibly in WPF. In case nobody here knows a possible cause for the problem I will file a bug report at Microsoft Connect. The problem presents itself…
Steven Jeuris
  • 18,274
  • 9
  • 70
  • 161
3
votes
2 answers

Java JNA sendMessage() not found

I'm trying to use JNA (Overview) to send messages to an application when minimized or not on top (mouse click for example), and the I found that people are using com.sun.jna.platform.win32.User32.SendMessageA( hW, 0x0201, 0, 0); But i can't found…
user1928596
  • 1,503
  • 16
  • 21
3
votes
1 answer

ShowCursor not working

i'm trying to write a simple C# win32 console app that uses ShowCursor (user32.dll) in order to hide the system mouse. calling ShowCursor(false) returns -1 (as it should), but the mouse cursor remains. calling again with ShowCursor(true) returns 1…
user1410541
  • 51
  • 1
  • 4
3
votes
1 answer

Keep a window on top of another window

Before asking my question let me say that i've read about 30 threads here and in other forums and none of the solutions has worked for me :( So, here's the thing. I'm doing a Hud for online poker rooms. So, my program needs to show a form on top of…
Dídac Punyet
  • 315
  • 3
  • 15
2
votes
2 answers

Why isn't my simulated mouse click doing anything?

I've got this code: [DllImport("user32.dll")] static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, UIntPtr dwExtraInfo); [Flags] public enum MouseEventFlags { Move = 0x0001, LeftDown = 0x0002, LeftUp = 0x0004, …
mpen
  • 272,448
  • 266
  • 850
  • 1,236