MCPcopy Create free account
hub / github.com/ammaarreshi/Generals-Mac-iOS-iPad / CreatePrimaryWin

Function CreatePrimaryWin

Core/Tools/PATCHGET/CHATAPI.cpp:609–659  ·  view source on GitHub ↗

Create a primary window

Source from the content-addressed store, hash-verified

607// Create a primary window
608//
609HWND CreatePrimaryWin(void)
610{
611 HWND hwnd;
612 WNDCLASS wc;
613 char name[256];
614
615 sprintf(name,Fetch_String(TXT_TITLE));
616
617 //DBGMSG("CreatePrimary: "<<name);
618
619 /*
620 ** set up and register window class
621 */
622 wc.style = CS_HREDRAW | CS_VREDRAW;
623 wc.lpfnWndProc = DefWindowProc;
624 wc.cbClsExtra = 0; // Don't need any extra class data
625 wc.cbWndExtra = 0; // No extra win data
626 wc.hInstance = Global_instance;
627 wc.hIcon=LoadIcon(Global_instance, MAKEINTRESOURCE(IDI_ICON1));
628 wc.hCursor = nullptr; /////////LoadCursor( nullptr, IDC_ARROW );
629 wc.hbrBackground = nullptr;
630 wc.lpszMenuName = name;
631 wc.lpszClassName = name;
632 RegisterClass( &wc );
633
634 /*
635 ** create a window
636 */
637 hwnd = CreateWindowEx(
638 WS_EX_APPWINDOW,
639 name,
640 name,
641 WS_POPUP,
642 0, 0,
643
644 //GetSystemMetrics( SM_CXSCREEN ),
645 //GetSystemMetrics( SM_CYSCREEN ),
646 0,0,
647
648 nullptr,
649 nullptr,
650 Global_instance,
651 nullptr );
652
653 SendMessage(hwnd,WM_SETICON,(WPARAM)ICON_SMALL,
654 (LPARAM)LoadIcon(Global_instance, MAKEINTRESOURCE(IDI_ICON1)));
655
656 ShowWindow(hwnd,SW_SHOWNORMAL);
657
658 return(hwnd);
659}
660
661
662

Callers 1

mainFunction · 0.70

Calls 2

Fetch_StringFunction · 0.85
ShowWindowFunction · 0.85

Tested by

no test coverage detected