MCPcopy Create free account
hub / github.com/bumptop/BumpTop / WinMain

Function WinMain

trunk/win/Source/BT_WindowsOS.cpp:570–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
571{
572 // Initialize COM and OLE
573 OleInitialize(NULL);
574 CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
575
576 // initialize common controls
577 INITCOMMONCONTROLSEX cc = {0};
578 cc.dwSize = sizeof(INITCOMMONCONTROLSEX);
579 cc.dwICC = ICC_STANDARD_CLASSES | ICC_WIN95_CLASSES;
580 InitCommonControlsEx(&cc);
581
582 // _set_purecall_handler(myPurecallHandler);
583 ::signal(SIGABRT, signalHandler);
584 _set_abort_behavior(0, _WRITE_ABORT_MSG|_CALL_REPORTFAULT);
585
586 set_terminate( &forceUnhandledException );
587 set_unexpected( &forceUnhandledException );
588 _set_purecall_handler( &forceUnhandledException );
589 _set_invalid_parameter_handler( &invalidParameterHandler );
590
591 SetUnhandledExceptionFilter(TopLevelFilter);
592
593 __try
594 {
595 GLOBAL(loadingTimer).restart();
596
597 // Initialize the Windows System
598 if (winOS->Init(hInstance, hPrevInstance, GetCommandLine(), nCmdShow))
599 {
600 statsManager->getStats().bt.window.instantiations++;
601 statsManager->startTimer(statsManager->getStats().bt.window.activeTime);
602
603 // Start the program up
604 evtManager->mainLoop();
605 }
606 }
607 __except(TopLevelFilter(GetExceptionInformation()))
608 {
609 exit(0);
610 }
611 return 0;
612}
613
614LRESULT CALLBACK GlobalWndProc(HWND Hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
615{

Callers

nothing calls this directly

Calls 6

TopLevelFilterFunction · 0.85
startTimerMethod · 0.80
mainLoopMethod · 0.80
signalClass · 0.50
restartMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected