Simulate a mouse click on a minimized window

I am currently writing a C # application that recognizes certain patterns on the screen and moves to the mouse to click on it. Currently, the application must have focus, and the mouse cursor moves, so the computer does not work when the program is running. I would like to simulate a mouse click on a window, but without moving the mouse on the screen. My goal was to simulate a mouse click on an application that is minimized. Will it be easy to do in C #?

0
source share
2 answers

You should read about using the Windows API from .NET (PInvoke). Start with them:

http://msdn.microsoft.com/en-us/library/bb775985(v=vs.85).aspx

http://www.codeguru.com/forum/showthread.php?t=427934

+1
source

try the following:

public const int SW_MAXIMIZE = 3; private delegate bool EnumDesktopWindowsDelegate(IntPtr hWnd, int lParam); [DllImport("user32.dll")] static extern bool EnumDesktopWindows(IntPtr hDesktop, EnumDesktopWindowsDelegate lpfn, IntPtr lParam); [DllImport("user32.dll", EntryPoint="FindWindow", SetLastError = true)] public static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName); [DllImport("USER32.DLL")] public static extern bool ShowWindow(IntPtr hWnd,int nCmdShow); 
+1
source

All Articles