#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 !