Results 1 to 5 of 5

Thread: extCreatePen

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    3

    extCreatePen

    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.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    3

    Smile

    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.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    VB Code:
    1. Dim brTransparent As Long
    2. brTransparent = GetStockObject NULL_BRUSH
    3. 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:
    1. SetClassLongPtr hwnd, GCLP_HBRBACKGROUND, brTransparent
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    3

    Thumbs up

    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width