NO

Author Topic: RichText Controls  (Read 4456 times)

k1024k

  • Guest
RichText Controls
« on: August 01, 2008, 04:48:57 PM »
how can i use the Xp style (manifest) in my RichText edit control ?
   
someone could help me?

thank you.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: RichText Controls
« Reply #1 on: August 02, 2008, 07:58:52 PM »
From the integrated resource editor create a manifest resorce and add it to the project.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

k1024k

  • Guest
Re: RichText Controls
« Reply #2 on: August 03, 2008, 02:56:03 PM »
for the RichText Controls the normal manifest not work !

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: RichText Controls
« Reply #3 on: August 04, 2008, 02:18:20 PM »
Did you used InitCommonControls at beginning of your program?
For more info http://msdn.microsoft.com/en-us/library/bb787877.aspx (Leggi questo  ;) )
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

k1024k

  • Guest
Re: RichText Controls
« Reply #4 on: August 09, 2008, 02:25:00 AM »
Code: [Select]
#include "main.h"

int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) {
   
InitCommonControls();
LoadLibrary(TEXT("Riched20.dll"));


    WNDCLASSEX wcx;
    wcx.cbSize = sizeof(wcx);

    if (!GetClassInfoEx(NULL, MAKEINTRESOURCE(32770), &wcx))
        return MessageBox(0,"Inizializzazione Fallita !",0,MB_ICONERROR);

    wcx.hInstance = hInstance;
    wcx.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDR_ICO_MAIN));
    wcx.lpszClassName = _T("CLASS_WIN32_DIALOG");
   
if (!RegisterClassEx(&wcx))
        return MessageBox(0,"Inizializzazione Fallita !",0,MB_ICONERROR);

    // -- Crea il dialogo --
    return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)main_DlgProcedure);
}

LRESULT CALLBACK main_DlgProcedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
HANDLE_MSG(hwnd, WM_INITDIALOG, _OnInitDialog);
HANDLE_MSG(hwnd, WM_CLOSE, _OnClose);
HANDLE_MSG(hwnd, WM_DESTROY, _OnDestroy);
HANDLE_MSG(hwnd, WM_COMMAND, _OnCommand);

default:
return FALSE;
}

}

BOOL _OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{

  HWND hwndEdit= CreateWindowEx(0, "RichEdit20W", TEXT("Type here"),
        ES_MULTILINE | WS_VISIBLE | WS_CHILD | WS_BORDER | WS_TABSTOP,
        0, 0, 400, 300,
        hwnd, (HMENU)1001, GetWindowInstance(hwnd), NULL);
return 1;
}

i have add manifest in resources project ... the program run ok but the visual style not work for the only control RichTextEdit.

Thank You All !