I'm having some trouble with a delegate in my program.
it's defined as :
delegate void MeProc(int HWND, uint MSG, uint WParam, int LParam);
I've also tried:
delegate void MeProc(ref Message m);
I think the problem is either that or in the following code:
Code:
int h = FindWindow(null,textbox.Text);
int Menu1 = GetSystemMenu(h, 0);
AppendMenu(Menu1, 0, 666, "Hello from Michael");
oldProc = GetWindowLong(h, -4);
if(SetWindowLong(h, -4,new MeProc(proc1))==0) MessageBox.Show("Nope");
something interesting though, if h is the HWND of the my program's
window, I get a "Fatal execution engine error". But if h is the HWND of a Internet Explorer window,
the call fails and I see that MessageBox. This is supposed to insert a new window procedure for the window.
I (strongly) think that I've done something wrong with the delegate.
Does anyone have any ideas?
thanks,
- Mike
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).