1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#ifndef UNICODE
#define UNICODE
#endif
#include <windows.h>
int main(int argc, char *argv[]) {
return 0;
}
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow)
{
const wchar_t ClassName1[] = L"ClassName1";
const wchar_t ClassName2[] = L"ClassName2";
WNDCLASS wc1 = { };
WNDCLASS wc2 = {1};
wc1.lpfnWndProc = WindowProc;
wc2.lpfnWndProc = WindowProc;
wc1.hInstance = hInstance;
wc2.hInstance = hInstance;
wc1.lpszClassName = ClassName1;
wc2.lpszClassName = ClassName2;
RegisterClass(&wc1); RegisterClass(&wc2);
HWND lala = CreateWindowEx(
0, // Optional window styles.
ClassName1, // Window class
L"ClassName1", // Window text
WS_OVERLAPPEDWINDOW, // Window style
// Size and position
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, // Parent window
NULL, // Menu
hInstance, // Instance handle
NULL // Additional application data
);
HWND hwnd = CreateWindowEx(
0, // Optional window styles.
ClassName2, // Window class
L"ClassName2", // Window text
WS_OVERLAPPEDWINDOW, // Window style
// Size and position
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, // Parent window
NULL, // Menu
hInstance, // Instance handle
NULL // Additional application data
);
if (hwnd == NULL)
{
return 0;
}
if (lala == NULL)
{
return 0;
}
ShowWindow(hwnd,nCmdShow);
ShowWindow(lala,nCmdShow);
}
|