SetEditFont

This is a discussion on SetEditFont within the Windows Programming forums, part of the Platform Specific Boards category; Where can I find info on SetEditFont? The web search engines don't list any API info. The help files for ...

  1. #1
    Unregistered
    Guest

    SetEditFont

    Where can I find info on SetEditFont? The web search engines don't list any API info. The help files for VC++ don't list it either.

    This code was listed by GARFIELD in an earlier thread:

    Code:
    LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
        static HWND    hwndMEdit;
        
        /* file varialbes */
        OPENFILENAME    fname;
        char            filename[64];   /* THE filename */
        static char     fn[256];    /* path and filename */
        char            filefilter[] = "Text\0*.TXT\0Assembly\0*.ASM\0\0\0";
        static FILE     *fp;
        char            filestring[256];
        unsigned int    dwTabs = 4;
        
        switch(message)                  /* handle the messages */
        {
            case WM_CREATE:
                hwndMEdit = CreateWindowEx(0, "edit", NULL,
                            WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
                            ES_LEFT | ES_MULTILINE | ES_AUTOHSCROLL |
                            ES_AUTOVSCROLL,
                            0, 0, 0, 0, hwnd, (HMENU) ID_MEDIT, hInst, NULL);
                            
                SetEditFont(hwndMEdit, "Courier", 12, ANSI_CHARSET, FALSE, FALSE,
                            FALSE, FALSE);
                            
                SendMessage(hwndMEdit, EM_SETTABSTOPS, (WPARAM) 1, 
                                                    (LPARAM) &dwTabs);
                            
                SetFocus(hwndMEdit);
                return 0;
       }
    }

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    I think Garf defined that function himself.......

    You can set fonts on a rich edit by using the SendMessage() API with a EM_SETCHARFORMAT message.......look it up on MSDN.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21