view OSAPI.cpp @ 2369:bddcaf5d5db2

removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
author Grumpy7
date Mon, 12 May 2014 01:50:32 +0200
parents aff7a7b072b7
children e7a551f458e1
line wrap: on
line source

#define _CRT_SECURE_NO_WARNINGS
#include "OSAPI.h"
#include "OSInfo.h"
#include "Log.h"


bool           OSInfo::initialized = false;
OSVERSIONINFOA OSInfo::info;




//----- (00462C94) --------------------------------------------------------
int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE, wchar_t *lpCmdLine, int nShowCmd)
{
  Log::Initialize();
  
  //if (HWND hMM7Window = FindWindowW(L"MM7", 0))
  if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))
  {
    if (IsIconic(hMM7Window))
      ShowWindow(hMM7Window, SW_RESTORE);
    SetForegroundWindow(GetLastActivePopup(hMM7Window));
    return 0;
  }

  HWND hPrevWindow = GetActiveWindow();
  {
    Log::Warning(L"OS init: ok");
    extern bool MM_Main(const wchar_t *pCmdLine);
    MM_Main(lpCmdLine);
  }
  if (hPrevWindow)
    SetActiveWindow(hPrevWindow);

  return GetLastError();
}




void MsgBox(const wchar_t *msg, const wchar_t *title)
{
  MessageBoxW(nullptr, msg, title, 0);
}