Results 1 to 5 of 5

Thread: Hdc *resolved*

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Hdc *resolved*

    Why is it that the Form1 has an .HDC property, and the controls on my form don't? I'm trying to pass a control to the DrawText API, but it requires a control's .hdc property passed as an argument, which my control doesn't have.

    What can I do instead?
    Last edited by mendhak; Nov 11th, 2003 at 11:15 PM.

  2. #2

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Here's the API, btw

    VB Code:
    1. Private Declare Function DrawText Lib "user32" Alias "DrawTextA" _
    2.         (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, _
    3.         lpRect As RECT, ByVal wFormat As Long) As Long

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    If the control has an hWnd, you can use the GetDC API.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    I love you crptcbum.

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Boy, if I had a bagel for everytime I heard that...

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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