C++ вопрос о рутине в winforms
Привет, я не знаю, с чего начать свой код на C++ с помощью winforms. Там нет процедуры main (), вместо нее есть процедура WinMain (), так что куда именно ставить мой код, а куда нет. Где петля?
Я хочу добавить;
while (1) {...вызовите другой метод;}
int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow) HWND hwnd; /* This is the handle for our window */ MSG messages; /* Here messages to the application are saved */ WNDCLASSEX wincl; /* Data structure for the windowclass */ //...... //...... /* Register the window class, and if it fails quit the program */ if (!RegisterClassEx (&wincl)) return 0; //..... hwnd = CreateWindowEx (.....) //..... ShowWindow (hwnd, nCmdShow); while (GetMessage (&messages, NULL, 0, 0)) { /* Translate virtual-key messages into character messages */ TranslateMessage(&messages); /* Send message to WindowProcedure */ DispatchMessage(&messages); } /* The program return-value is 0 - The value that PostQuitMessage() gave */ return messages.wParam; }
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) /* handle the messages */ { case WM_DESTROY: PostQuitMessage (0); /* send a WM_QUIT to the message queue */ break; default: /* for messages that we don't deal with */ return DefWindowProc (hwnd, message, wParam, lParam); } return 0; }
Что я уже пробовал:
--------------------------------------------------------