#include
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
PSTR lpCmdLine,
int nCmdShow) {
MessageBox(NULL, TEXT(“勇者の攻撃!”),
TEXT(“スライムが現れた!”), MB_OK);
return 0;
}
#include
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
PSTR lpCmdLine,
int nCmdShow) {
MessageBox(NULL, TEXT(“勇者の攻撃!”),
TEXT(“スライムが現れた!”), MB_OK);
return 0;
}
#include
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
switch (msg) {
case WM_DESTROY:
MessageBox(hwnd, TEXT(“魔王を倒した”),
TEXT(“勇者の攻撃”), MB_ICONINFORMATION);
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, msg, wp, lp);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR lpCndLine, int nCmdShow) {
HWND hwnd;
MSG msg;
WNDCLASS winc;
winc.style = CS_HREDRAW | CS_VREDRAW;
winc.lpfnWndProc = WndProc;
winc.cbClsExtra = winc.cbWndExtra = 0;
winc.hInstance = hInstance;
winc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
winc.hCursor = LoadCursor(NULL, IDC_ARROW);
winc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
winc.lpszMenuName = NULL;
winc.lpszClassName = TEXT(“勇者”);
if (!RegisterClass(&winc))return 0;
hwnd = CreateWindow(
TEXT(“勇者”), TEXT(“勇者の攻撃!”),
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
100, 100, 200, 200, NULL, NULL,
hInstance, NULL
);
if (hwnd == NULL)return 0;
while (GetMessage(&msg, NULL, 0, 0))DispatchMessage(&msg);
return msg.wParam;
}
#include
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR pCmdLine, int nCmdShow) {
MessageBox(NULL, GetCommandLine(),
TEXT(“勇者の攻撃!”), MB_ICONINFORMATION);
return 0;
}
#include
int WINAPI WinMain(
HINSTANCE hInstance ,
HINSTANCE hPrevInstance ,
PSTR lpCmdLine ,
int nCmdShow ) {
MessageBox(NULL , TEXT(“Kitty on your lap”) ,
TEXT(“メッセージボックス”) , MB_OK);
return 0;
}
http://wisdom.sakura.ne.jp/system/winapi/win32/win5.html