Thanks in advance,
I'm having trouble sending a mouseclick to a web browser with the WM_LMOUSEDOWN and WM_LMOUSEUP messages. Below are the html and javascript pages. Save them in the same folder then open the html file in internet explorer. All it does is put a paragraph that says "You just clicked!" whenever you click anywhere in the browser. It works just fine with the real mouse but not with my code.


<!DOCTYPE html>
<html lang="en">
<script src="./react.js"></script>
<body style="margin:0px;" onload="init()">
<div id="body" style="background-color:white; height:100%; width:100%; position:absolute;"></div>


var numclicks = 0;

function init(){
var b = document.getElementById('body');

function addP(){
var t = document.createElement("p");
t.innerHTML = "You Just Clicked!"; = "p" + numclicks;
var b = document.getElementById('body');


Anyway, I've seen things like mouse_event but I'm really wanting to capture messages and send them over a network. I can do this just fine but it didn't work when using PostMessage to the window. So I bypassed the network and tried to send it directly to the window and it still didn't work.


p.x = 500;
p.y = 500;

LPARAM lp = MAKELPARAM(p.x,p.y);

chrome=FindWindow(NULL,TEXT("react - Windows Internet Explorer"));
//lr = DefWindowProc(chrome,WM_NCHITTEST,NULL,lp);
//wp = MAKEWPARAM(chrome,NULL);

//lr = DefWindowProc(chrome,WM_MOUSEACTIVATE,wp,lp);


So in short sending the down and up messages with PostMessage to the handle found with FindWindow did not invoke the "click" eventlistener in the javascript file and I've not been able to figure out why. I was wondering if it was because the window wasn't activated but I tried sending WM_MOUSEACTIVATE, WM_NCHITTEST, calling SetActiveWindow, SetFocus, etc but none of that seems to work. I really hope we can get this working so I can move on to the fun stuff. I'm assuming it's something ridiculous like - Oh you weren't jumping up and down on one foot while holding your nose while posting the messages?

But I thought windows messages and the message queue are essentially the bottom line for windows. Any code in any other language for mouseclicks like OnClick etc compiles into a window procedure that responds to the mouse messages. Is this correct?

Thanks again!