Ok... allora uso CodeBlocks e ResEdit per sviluppare le finestre di dialogo, poi aggiungo nei file rc e h che mi crea CodeBlock quando faccio uno nuovo progetto Win32 , quelli che mi crea ResEdit una volta che finisco la finestra... il codice del main è:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "resource.h"
HINSTANCE hInst;
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (GetAsyncKeyState(VK_DOWN)) {
EndDialog(hwndDlg, 0);
return FALSE;
}
if (GetAsyncKeyState(VK_UP)) {
BOOL WINAPI SetWindowText(
HWND CAPTION,
LPCTSTR lpString
);
}
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
hInst = hInstance;
// The user interface is a modal dialog box
return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)DialogProc);
}
quello di resource.rc :
// Generated by ResEdit 1.5.11
// Copyright (C) 2006-2012
// http://www.resedit.net
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h"
//
// Dialog resources
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG1 DIALOG 0, 0, 186, 95
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "Ms Shell Dlg"
{
LTEXT "", IDC_STATIC, 15, 10, 146, 69, SS_LEFT
}
e quello di resource.h :
#ifndef IDC_STATIC
#define IDC_STATIC (-1)
#endif
#define IDD_DIALOG1 100
#define DLG_MAIN 100
#define WM_CLOSE 0x0010
#define WM_SETTEXT 0x000C