Results 1 to 5 of 5

Thread: Working with complicated controls

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    6

    Working with complicated controls

    Hi there!
    There a simple form with a complicated control on it. Let's say, Outlook Bar control, for instance.
    The task is to change font for a particular element of the control.
    What is the general approach to resolve similar problems using API functions?
    Thanks a lot in advance.
    Vladimir

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Does the control have its own Font property?

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    6
    Yes, it does but it does not work in runtime.
    Besides Font property was implemented to change font for all elements of the control. I need to change font for selected element/s.

  4. #4
    jim mcnamara
    Guest
    You can get the hWnd of the element of the control - each one is a window.

    Then you can use SendMessage hWnd, WM_SETFONT
    Code:
    ' note the change in red 
    Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As  _
    Long, ByRef wParam As Long, lParam As Any) As Long
    Private Const WM_SETFONT = &H30
    Call SendMessage hWnd,WM_SETFONT,hFont,True
    hWnd - window handle
    WM_SETFONT - tell the window to change fonts
    hFont - Font handle - a LOGFONT structure passed ByRef
    True - force a repaint with the new font.

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    6
    I guess I need to clarify my example.
    I can easily get Window handle via hWnd property of Outlook Bar. Then I can also get a set of Window handles of child windows via EnumChildWindows. The question is what then? No one of child windows is accepted SendMessage function. I cannot receive any information about these windows via GetClassInfo or GetClassInfoEx functions. They do not work in this case.
    So the task could be stated this way: how to get the Window handle of the right window?
    Best regards,
    V.

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