Windows programming is event/message driven. Yes, you can have a program that will move a mouse around the screen wherever you want and at a given x,y coordinate, initiate a mouse click.
Are you wanting to do this in the window program itself or on another window (which involves programming to multiple windows vs. the active window).