I can not seem to get the extCreatePen to work. It looks like I have everything correct, but it always returns 0 with an error code of 87 (Incorrect Parameter)
All help will be appreciated.:(
Printable View
I can not seem to get the extCreatePen to work. It looks like I have everything correct, but it always returns 0 with an error code of 87 (Incorrect Parameter)
All help will be appreciated.:(
Given that it says you have an incorrect parameter, don't you think it would be a good idea to post your code so that we can CHECK your parameters?
You are right, I thought of it at the time, but I guess I was too rushed. It turned out to be an incorrect parameter as I was trying to pass a 0 (zero) (really wanted to pass a NULL) to a long param and found some code that had ByRef 0& as the value which worked. I am having trouble getting a transparent window however. I know all about layered windows and setting the extended style to transparent with an ALPHA value, but the program runs so extremely slow that it is unusuable. I'm still looking for another way. I have tried SetBKMode to TRANSPARENT...does not work. I have tried SetClassLong so that the hbrBackground is NULL, but that does not work either. Any help would be appreciated.
VB Code:
Dim brTransparent As Long brTransparent = GetStockObject NULL_BRUSH SetClassLong hwnd, GCL_HBRBACKGROUND, brTransparent
I don't know if VB supports the *Ptr functions. In this case the last line should be
VB Code:
SetClassLongPtr hwnd, GCLP_HBRBACKGROUND, brTransparent
I have actually seen that one in MSDN, I would have to look to see if it is supported by VB; thanks for the tip though. I did get the form working with SetBKMode...I had to use SetWindowPos to have it paint, now the trouble is that my lines created with ExtCreatePen, do not show up and supposedly, they are not effected by the BackMode. I have set the SetROP2 to CopyPen, but it might be something simple like repainting the form. The real solution is to use layered windows, but for some reason, the mouse runs so slow on them in a kind of jerky fashion, I mean its super slow, besides I'm not sure if line work created with a pen will show up, because when I use either a regular pen or extended pen, it takes on the alpha value of the window (form)...I've got to look into this more, this week is crazy with work so I probably will not get to it till the weekend...;)