Quote Originally Posted by moeur
Just remove that from the reference, it isn't needed.
Hey, moeur!! I am not a n00b.. lol.. have n't u still understood? I was just pointing out how Visual Basic is reacting differently... When u have a missing reference ( i know that u forgot to remove it while attaching your project ), why should VB complain on the line: strData = Space(dataStruct.cbData, 0)

Oops, i dint put the above line in my previous post.. i was incomplete.. sorry!

Space function accepts only one parameter which is the length of spaces you need. And so VB is supposed to error: Wrong number of arguments. But i was just playing around how VB reacts when u have a missing reference.. hmm, think i should not play around, just misleads to many stuff..

Also, moeur, when u run your EXE press Ctrl+F5 with codes implementing Subclassing.. which makes sure u dont have any compiler error!

And i dont understand your old quote:
Quote Originally Posted by moeur
The hInst value is a handle passed by value, there is no question about this.
In fact, if you change it to byref then the hook procedure returns an error because you have an invalid handle
Nopez, cant you see that any LPVOID is nothing but a pointer which is obviously pointer... You have just given your DLL code having the DllMain as:
VB Code:
  1. Public Function DLLMain([hl]hInst As Long[/hl], ByVal fdwReason As Long, _
  2.   lpvReserved As Long) As Long
which is ByRef.. What are you trying to tell?? You seem to contradict your own code

Anyway, i will be back with the working code of your Notepad Hook.