MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / WinMain

Function WinMain

wdriver.cpp:553–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551// then spins in a tight message processing loop until it terminates.
552
553int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
554 LPSTR lpszCmdLine, int nCmdShow)
555{
556 MSG msg;
557 WNDCLASS wndclass;
558 char ch;
559#ifdef BETA
560 char sz[cchSzMax];
561#endif
562
563 // Set up the window class shared by all instances of Astrolog.
564
565 wi.hinst = hInstance;
566 if (!hPrevInstance) {
567 ClearB((pbyte)&wndclass, sizeof(WNDCLASS));
568 wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNWINDOW;
569 wndclass.lpfnWndProc = WndProc;
570 wndclass.cbClsExtra = 0;
571 wndclass.cbWndExtra = 0;
572 wndclass.hInstance = wi.hinst;
573 wndclass.hIcon = LoadIcon(wi.hinst, MAKEINTRESOURCE(icon));
574 wndclass.hCursor = LoadCursor((HINSTANCE)NULL, IDC_ARROW);
575 wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
576 wndclass.lpszMenuName = MAKEINTRESOURCE(menu);
577 wndclass.lpszClassName = szAppName;
578 if (!RegisterClass(&wndclass)) {
579 PrintError("The window class could not be registered.");
580 return -1L;
581 }
582 }
583
584 // Create the actual window to be used and drawn on by this instance.
585
586 wi.hmenu = LoadMenu(wi.hinst, MAKEINTRESOURCE(menu));
587#ifndef PS
588 DeleteMenu(wi.hmenu, cmdSavePS, MF_BYCOMMAND);
589 DeleteMenu(wi.hmenu, cmdCopyPS, MF_BYCOMMAND);
590#endif
591#ifndef META
592 DeleteMenu(wi.hmenu, cmdSavePicture, MF_BYCOMMAND);
593 DeleteMenu(wi.hmenu, cmdCopyPicture, MF_BYCOMMAND);
594#endif
595#ifndef SVG
596 DeleteMenu(wi.hmenu, cmdSaveSVG, MF_BYCOMMAND);
597 DeleteMenu(wi.hmenu, cmdCopySVG, MF_BYCOMMAND);
598#endif
599#ifndef WIRE
600 DeleteMenu(wi.hmenu, cmdSaveWire, MF_BYCOMMAND);
601 DeleteMenu(wi.hmenu, cmdCopyWire, MF_BYCOMMAND);
602#endif
603#ifndef INTERPRET
604 DeleteMenu(wi.hmenu, cmdInterpret, MF_BYCOMMAND);
605 DeleteMenu(wi.hmenu, cmdHelpMeaning, MF_BYCOMMAND);
606#endif
607#ifndef ARABIC
608 DeleteMenu(wi.hmenu, cmdChartArabic, MF_BYCOMMAND);
609#endif
610#ifndef CONSTEL

Callers

nothing calls this directly

Calls 11

ClearBFunction · 0.85
PrintErrorFunction · 0.85
InitProgramFunction · 0.85
FProcessSwitchFileFunction · 0.85
FProcessCommandLineFunction · 0.85
InitRestrictionsFunction · 0.85
ResizeWindowToChartFunction · 0.85
RedoMenuFunction · 0.85
NWmCommandFunction · 0.85
PrintWarningFunction · 0.85
FinalizeProgramFunction · 0.85

Tested by

no test coverage detected