Il 11/01/2014 23.15, Nero23 ha scritto:
Aggiunto/tolto qualcosina, ma ci credo poco, penso piu' ad un problema
di CodeBlocks (che non ho). Con VS2008 funziona.
> // FILE main.c
> #include <windows.h>
> #include "resource.h"
>
> BOOL CALLBACK DialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
> switch (msg) {
case WM_INITDIALOG: return TRUE;
> case WM_DESTROY: PostQuitMessage(0); return TRUE;
> case WM_CLOSE: DestroyWindow (hwnd); return TRUE;
> }
> return FALSE;
> }
>
> int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char* cmdParam, int cmdShow) {
> HWND hDlg = CreateDialog(hInst, MAKEINTRESOURCE (IDD_DIALOG1), 0, (DLGPROC)DialogProc);
>
> if (! hDlg) {
> MessageBox(NULL, "Dialog Box", "Errore!", MB_ICONEXCLAMATION | MB_OK);
> return 0;
> }
>
> ShowWindow(hDlg, cmdShow);
UpdateWindow(hDlg); // <- serve? uhm... no, toglilo.
> MSG message;
> while (GetMessage(&message, NULL, 0, 0) > 0) {
if (! IsDialogMessage(hDlg,&msg)) {
> TranslateMessage(&message);
> DispatchMessage(&message);
}
> }
>
> return message.wParam;
> }
>
>
>
>
>
>
> // FILE resource.h
> #define IDD_DIALOG1 101
> #define IDC_BUTTON1 1007
> #define IDC_BUTTON2 1008
> #define IDC_BUTTON3 1009
>
>
>
>
>
>
>
> // FILE fileRC.rc
> #include "resource.h"
#include "afxres.h" // <- sicuro che sia ok?
// prova a sostituirlo con #include <windows.h>
// dovrebbe bastare
>
>
> IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 100, 100
> STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
// uh WS_CAPTION ?
CAPTION "E metticelo allora!"