Thread: SetEditFont

  1. #1


    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:

    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 |
                            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);
                return 0;

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    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