But what I'm trying to do is simulate this same function of using the LeftClick() function, but without the need of controlling the users mouse. This is needed for a program that runs minimized and not in the users foreground to simulate tedious task that take up time during the a users day.
I prefer sticking to WindowsAPI as I'm most comfortable with it, but if anyone has any insight I would much appreciate it.
I don't think SendInput actually uses the mouse (or the keyboard). It just generates events which end up in the same queue as those generated by the (actual) mouse and keyboard.
Well, I suppose you could get the required HWND or thread ID (for the thread the message pump is running on) and then you could try posting the appropriated messages to the app (using either PostMessage or PostThreadMessage): WM_LBUTTONDOWN, WM_MOUSEMOVE, ...
BUT I think the fact that the app is minimized is going to be a problem. If you need to click on a button by moving "the mouse" and the "clicking on" a button, then the app cannot be mimimized.
If you are trying to click on a button or menu item, it might be possible (and better) to just post the corresponding WM_COMMAND message to the app.
Either way, if I'm going to send a WM_COMMAND to an app be for a control on it. There seems to be two different ways, either that way or send an event in the CLIENT CONTEXT space of the application. I googled and can't find anything on it and I know thats what I need to do.