• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LoadString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LoadString函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadString函数的具体用法?C++ LoadString怎么用?C++ LoadString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LoadString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _tWinMain

int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCmdShow)
{
    HWND        hwnd;
    MSG            msg;
    WNDCLASS    wndclass;
    INITCOMMONCONTROLSEX ice;
    HACCEL        hAccelTable;

    hInstance = hInst;

    /* Load application title */
    LoadString(hInst, IDS_SPI_NAME, szAppName, sizeof(szAppName) / sizeof(szAppName[0]));
    /* Load MsgBox() texts here to avoid loading them many times later */
    LoadString(hInst, IDS_SPI_ABOUT, MsgAbout, sizeof(MsgAbout) / sizeof(MsgAbout[0]));
    LoadString(hInst, IDS_SPI_QUIT, MsgQuit, sizeof(MsgQuit) / sizeof(MsgQuit[0]));
    LoadString(hInst, IDS_SPI_WIN, MsgWin, sizeof(MsgWin) / sizeof(MsgWin[0]));
    LoadString(hInst, IDS_SPI_DEAL, MsgDeal, sizeof(MsgDeal) / sizeof(MsgDeal[0]));

    /* Window class for the main application parent window */
    wndclass.style             = 0;
    wndclass.lpfnWndProc       = WndProc;
    wndclass.cbClsExtra        = 0;
    wndclass.cbWndExtra        = 0;
    wndclass.hInstance         = hInst;
    wndclass.hIcon             = LoadIcon (hInst, MAKEINTRESOURCE(IDI_SPIDER));
    wndclass.hCursor           = LoadCursor (NULL, IDC_ARROW);
    wndclass.hbrBackground     = (HBRUSH)NULL;
    wndclass.lpszMenuName      = MAKEINTRESOURCE(IDR_MENU1);
    wndclass.lpszClassName     = szAppName;

    RegisterClass(&wndclass);

    ice.dwSize = sizeof(ice);
    ice.dwICC = ICC_BAR_CLASSES;
    InitCommonControlsEx(&ice);

    srand((unsigned)GetTickCount());

    /* InitCardLib(); */

    /* Construct the path to our help file */
    MakePath(szHelpPath, MAX_PATH, _T(".hlp"));

    hwnd = CreateWindow(szAppName,
                szAppName,
                WS_OVERLAPPEDWINDOW,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                0,  /*The real size will be computed in WndProc through WM_GETMINMAXINFO */
                0,  /* The real size will be computed in WndProc through WM_GETMINMAXINFO */
                NULL,
                NULL,
                hInst,
                NULL);

    hwndMain = hwnd;

    ShowWindow(hwnd, iCmdShow);
    UpdateWindow(hwnd);

    hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACCELERATOR1));
    
    DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIFFICULTY), hwnd, DifficultyDlgProc);
  
    while(GetMessage(&msg, NULL,0,0))
    {
        if(!TranslateAccelerator(hwnd, hAccelTable, &msg))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }
    return msg.wParam;
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:74,代码来源:spider.cpp


示例2: TMSRPT14

//
//  Unrostered runs report
//
BOOL FAR TMSRPT14(TMSRPTPassedDataDef *pPassedData)
{
  TMSRPT14RDataDef *pTMSRPT14RData[ROSTER_MAX_DAYS];
  HFILE hfOutputFile;
  BOOL  bKeepGoing = FALSE;
  BOOL  bFound;
  long  numRuns[ROSTER_MAX_DAYS];
  char szOutputString[128];
  char szDay[16];
  char dummy[256];
  long maxRuns;
  int   days[ROSTER_MAX_DAYS] = {TEXT_009, TEXT_010, TEXT_011,
                                 TEXT_012, TEXT_013, TEXT_014, TEXT_015};
  int   nI;
  int   nJ;
  int   nK;
  int   nL;
  int   rcode2;

  pPassedData->nReportNumber = 13;
  pPassedData->numDataFiles = 1;
  for(nI = 0; nI < m_LastReport; nI++)
  {
    if(TMSRPT[nI].originalReportNumber == pPassedData->nReportNumber)
    {
      StatusBarStart(hWndMain, TMSRPT[nI].szReportName);
      break;
    }
  }
//
//  Open the output file
//
  StatusBarText("Opening output file...");
  strcpy(tempString, szReportsTempFolder);
  strcat(tempString, "\\tmsrpt14.txt");
  hfOutputFile = _lcreat(tempString, 0);
  if(hfOutputFile == HFILE_ERROR)
  {
    LoadString(hInst, ERROR_202, szFormatString, sizeof(szFormatString));
    sprintf(szarString, szFormatString, tempString);
    MessageBeep(MB_ICONSTOP);
    MessageBox((HWND)NULL, szarString, TMS, MB_ICONSTOP);
    goto deallocate;
  }
  strcpy(pPassedData->szReportDataFile[0], tempString);
//
//  Initialize the TMSRPT14RData and TMSRPT14RDataData structures
//
  rcode2 = btrieve(B_STAT, TMS_RUNS, &BSTAT, dummy, 0);
  if(rcode2 != 0 || BSTAT.numRecords == 0)
  {
    TMSError((HWND)NULL, MB_ICONSTOP, ERROR_266, (HANDLE)NULL);
    goto deallocate;
  }
  maxRuns = BSTAT.numRecords;
  for(nI = 0; nI < ROSTER_MAX_DAYS; nI++)
  {
    numRuns[nI] = 0;
    pTMSRPT14RData[nI] = (TMSRPT14RDataDef *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TMSRPT14RDataDef) * maxRuns); 
    if(pTMSRPT14RData[nI] == NULL)
    {
      AllocationError(__FILE__, __LINE__, FALSE);
      goto deallocate;
    }
  }
//
//  Read the runs into TMSRPT14RData
//
  for(nI = 0; nI < ROSTER_MAX_DAYS; nI++)
  {
    LoadString(hInst, days[nI], szDay, sizeof(szDay));
    sprintf(tempString, "Reading %s runs...", szDay); 
    StatusBarText(tempString);
    if(StatusBarAbort())
    {
      goto deallocate;
    }
    if(ROSTERPARMS.serviceDays[nI] == NO_RECORD)
    {
      continue;
    }
    RUNSKey1.DIVISIONSrecordID = m_DivisionRecordID;
    RUNSKey1.SERVICESrecordID = ROSTERPARMS.serviceDays[nI];
    RUNSKey1.runNumber = NO_RECORD;
    RUNSKey1.pieceNumber = NO_RECORD;
    rcode2 = btrieve(B_GETGREATER, TMS_RUNS, &RUNS, &RUNSKey1, 1);
    while(rcode2 == 0 && 
          RUNS.DIVISIONSrecordID == m_DivisionRecordID &&
          RUNS.SERVICESrecordID == ROSTERPARMS.serviceDays[nI])
    {
      if(RUNS.pieceNumber == 1)
      {
        pTMSRPT14RData[nI][numRuns[nI]].recordID = RUNS.recordID;
        pTMSRPT14RData[nI][numRuns[nI]].runNumber = RUNS.runNumber;
        pTMSRPT14RData[nI][numRuns[nI]].cutAsRuntype = RUNS.cutAsRuntype;
        numRuns[nI]++;
      }
//.........这里部分代码省略.........
开发者ID:ems,项目名称:TMS,代码行数:101,代码来源:Tmsrpt14.c


示例3: _tWinMain

int APIENTRY _tWinMain(HINSTANCE hInstance,
                       HINSTANCE /*hPrevInstance*/,
                       LPTSTR    lpCmdLine,
                       int       /*nCmdShow*/)
{
    SetDllDirectory(L"");
    SetTaskIDPerUUID();
    CRegStdDWORD loc = CRegStdDWORD(_T("Software\\TortoiseGit\\LanguageID"), 1033);
    long langId = loc;
    CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);

    CLangDll langDLL;
    hResource = langDLL.Init(_T("TortoiseIDiff"), langId);
    if (hResource == NULL)
        hResource = hInstance;

    CCmdLineParser parser(lpCmdLine);

    if (parser.HasKey(_T("?")) || parser.HasKey(_T("help")))
    {
        TCHAR buf[1024] = { 0 };
        LoadString(hResource, IDS_COMMANDLINEHELP, buf, _countof(buf));
        MessageBox(NULL, buf, _T("TortoiseIDiff"), MB_ICONINFORMATION);
        langDLL.Close();
        return 0;
    }


    MSG msg;
    hInst = hInstance;

    INITCOMMONCONTROLSEX used = {
        sizeof(INITCOMMONCONTROLSEX),
        ICC_STANDARD_CLASSES | ICC_BAR_CLASSES | ICC_WIN95_CLASSES
    };
    InitCommonControlsEx(&used);

    // load the cursors we need
    curHand = (HCURSOR)LoadImage(hInst, MAKEINTRESOURCE(IDC_PANCUR), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);
    curHandDown = (HCURSOR)LoadImage(hInst, MAKEINTRESOURCE(IDC_PANDOWNCUR), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);

    std::unique_ptr<CMainWindow> mainWindow(new CMainWindow(hResource));
    mainWindow->SetRegistryPath(_T("Software\\TortoiseGit\\TortoiseIDiffWindowPos"));
    std::wstring leftfile = parser.HasVal(_T("left")) ? parser.GetVal(_T("left")) : _T("");
    std::wstring rightfile = parser.HasVal(_T("right")) ? parser.GetVal(_T("right")) : _T("");
    if ((leftfile.empty()) && (lpCmdLine[0] != 0))
    {
        int nArgs;
        LPWSTR * szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
        if (szArglist)
        {
            if (nArgs == 3)
            {
                // Four parameters:
                // [0]: Program name
                // [1]: left file
                // [2]: right file
                if (PathFileExists(szArglist[1]) && PathFileExists(szArglist[2]))
                {
                    leftfile = szArglist[1];
                    rightfile = szArglist[2];
                }
            }
        }

        // Free memory allocated for CommandLineToArgvW arguments.
        LocalFree(szArglist);
    }
    mainWindow->SetLeft(leftfile.c_str(), parser.HasVal(_T("lefttitle")) ? parser.GetVal(_T("lefttitle")) : _T(""));
    mainWindow->SetRight(rightfile.c_str(), parser.HasVal(_T("righttitle")) ? parser.GetVal(_T("righttitle")) : _T(""));
    if (parser.HasVal(L"base"))
        mainWindow->SetSelectionImage(FileTypeBase, parser.GetVal(L"base"), parser.HasVal(L"basetitle") ? parser.GetVal(L"basetitle") : L"");
    if (parser.HasVal(L"mine"))
        mainWindow->SetSelectionImage(FileTypeMine, parser.GetVal(L"mine"), parser.HasVal(L"minetitle") ? parser.GetVal(L"minetitle") : L"");
    if (parser.HasVal(L"theirs"))
        mainWindow->SetSelectionImage(FileTypeTheirs, parser.GetVal(L"theirs"), parser.HasVal(L"theirstitle") ? parser.GetVal(L"theirstitle") : L"");
    if (parser.HasVal(L"result"))
        mainWindow->SetSelectionResult(parser.GetVal(L"result"));
    if (mainWindow->RegisterAndCreateWindow())
    {
        HACCEL hAccelTable = LoadAccelerators(hResource, MAKEINTRESOURCE(IDR_TORTOISEIDIFF));
        if (!parser.HasVal(L"left") && parser.HasVal(L"base") && !parser.HasVal(L"mine") && !parser.HasVal(L"theirs"))
        {
            PostMessage(*mainWindow, WM_COMMAND, ID_FILE_OPEN, 0);
        }
        if (parser.HasKey(_T("overlay")))
        {
            PostMessage(*mainWindow, WM_COMMAND, ID_VIEW_OVERLAPIMAGES, 0);
        }
        if (parser.HasKey(_T("fit")))
        {
            PostMessage(*mainWindow, WM_COMMAND, ID_VIEW_FITIMAGEHEIGHTS, 0);
            PostMessage(*mainWindow, WM_COMMAND, ID_VIEW_FITIMAGEWIDTHS, 0);
        }
        if (parser.HasKey(_T("fitwidth")))
        {
            PostMessage(*mainWindow, WM_COMMAND, ID_VIEW_FITIMAGEWIDTHS, 0);
        }
        if (parser.HasKey(_T("fitheight")))
        {
//.........这里部分代码省略.........
开发者ID:15375514460,项目名称:TortoiseGit,代码行数:101,代码来源:TortoiseIDiff.cpp


示例4: ExtractFilesProc

BOOL APIENTRY
ExtractFilesProc(HANDLE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG lParam)
{
	char	szTmpFile[MAX_PATH];
	char	szArcLstFile[MAX_PATH];
	HRSRC	hResInfo;
	HGLOBAL	hGlobal;
	LPBYTE	lpBytes;
	LPBYTE	lptr;
	LPBYTE	lpBytesUnCmp;
	HANDLE	hFile;
	char	szStatus[128];
	char	szText[4096];
	
	// Update the UI
	LoadString(hInst, IDS_STATUS_EXTRACTING, szText, sizeof(szText));
	wsprintf(szStatus, szText, lpszName);
	SetStatusLine(szStatus);

  if(gbUncompressOnly == TRUE)
    lstrcpy(szTmpFile, lpszName);
  else
  {
	  // Create a file in the temp directory
	  GetFullTempPathName(lpszName, sizeof(szTmpFile), szTmpFile);
    CreateDirectoriesAll(szTmpFile);
  }

  if((*gszFileToUncompress != '\0') && (lstrcmpi(lpszName, gszFileToUncompress) != 0))
    // We have a file to uncompress, but the one found is not the one we want,
    // so return TRUE to continue looking for the right one.
    return TRUE;

	// Extract the file
	hResInfo = FindResource((HINSTANCE)hModule, lpszName, lpszType);
	hGlobal = LoadResource((HINSTANCE)hModule, hResInfo);
	lpBytes = (LPBYTE)LockResource(hGlobal);

	// Create the file
	hFile = CreateFile(szTmpFile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY, NULL);

	if (hFile != INVALID_HANDLE_VALUE) {
		DWORD	dwSize;
		DWORD	dwSizeUnCmp;
    DWORD dwTemp;

	  GetFullTempPathName("Archive.lst", sizeof(szArcLstFile), szArcLstFile);
    WritePrivateProfileString("Archives", lpszName, "TRUE", szArcLstFile);

    lptr = (LPBYTE)malloc((*(LPDWORD)(lpBytes + sizeof(DWORD))) + 1);
    if(!lptr)
    {
      char szBuf[512];

      LoadString(hInst, IDS_ERROR_OUT_OF_MEMORY, szBuf, sizeof(szBuf));
      MessageBox(NULL, szBuf, NULL, MB_OK | MB_ICONEXCLAMATION);
      return FALSE;
    }

    lpBytesUnCmp = lptr;
    dwSizeUnCmp  = *(LPDWORD)(lpBytes + sizeof(DWORD));

		// Copy the file. The first DWORD specifies the size of the file
		dwSize = *(LPDWORD)lpBytes;
		lpBytes += (sizeof(DWORD) * 2);

    dwTemp = uncompress(lpBytesUnCmp, &dwSizeUnCmp, lpBytes, dwSize);

    while (dwSizeUnCmp > 0)
    {
			DWORD	dwBytesToWrite, dwBytesWritten;

      ProcessWindowsMessages();

			dwBytesToWrite = dwSizeUnCmp > 4096 ? 4096 : dwSizeUnCmp;
			if (!WriteFile(hFile, lpBytesUnCmp, dwBytesToWrite, &dwBytesWritten, NULL))
      {
				char szBuf[512];

      	LoadString(hInst, IDS_STATUS_EXTRACTING, szText, sizeof(szText));
				wsprintf(szBuf, szText, szTmpFile);
				MessageBox(NULL, szBuf, szTitle, MB_OK | MB_ICONEXCLAMATION);
				FreeResource(hResInfo);
        if(lptr)
          free(lptr);

				return FALSE;
			}

			dwSizeUnCmp -= dwBytesWritten;
			lpBytesUnCmp += dwBytesWritten;

			// Update the UI to reflect the total number of bytes written
			static DWORD	nBytesWritten = 0;

			nBytesWritten += dwBytesWritten;
			UpdateProgressBar(nBytesWritten * 100 / nTotalBytes);
		}

		CloseHandle(hFile);
//.........这里部分代码省略.........
开发者ID:rn10950,项目名称:RetroZilla,代码行数:101,代码来源:nsinstall.cpp


示例5: WinMain

int APIENTRY
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
  WNDCLASS  wc;
  HWND      hwndFW;

	hInst = hInstance;
	LoadString(hInst, IDS_TITLE, szTitle, MAX_BUF);

  // Parse the command line
  ParseCommandLine(lpCmdLine);
  
  /*  Allow multiple installer instances with the 
      provision that each instance is guaranteed 
      to have its own unique setup directory 
   */
  if(FindWindow("NSExtracting", "Extracting...") != NULL ||
    (hwndFW = FindWindow(CLASS_NAME_SETUP_DLG, NULL)) != NULL ||
    (hwndFW = FindWindow(CLASS_NAME_SETUP, NULL)) != NULL)
  {
    if (gbAllowMultipleInstalls)
    {
      char szTempPath[MAX_BUF];
      GetFullTempPathName("", MAX_BUF, szTempPath);
      DWORD dwLen = lstrlen(gszWizTempDir);

      for(int i = 1; i <= 100 && (FileExists(szTempPath) != FALSE); i++)
      {
        itoa(i, (gszWizTempDir + dwLen), 10);
        GetFullTempPathName("", MAX_BUF, szTempPath);
      }

      if (FileExists(szTempPath) != FALSE)
      {
        MessageBox(NULL, "Cannot create temp directory", NULL, MB_OK | MB_ICONEXCLAMATION);
        exit(1);
      }
    }
    else
    {
      if (hwndFW!=NULL)
      {
        ShowWindow(hwndFW, SW_RESTORE);
        SetForegroundWindow(hwndFW);
      }
      return(1);
    }
  }

	// Figure out the total size of the resources
	EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)SizeOfResourcesProc, 0);

  // Register a class for the gauge
  memset(&wc, 0, sizeof(wc));
  wc.lpfnWndProc   = (WNDPROC)GaugeWndProc;
  wc.hInstance     = hInstance;
  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
  wc.lpszClassName = "NSGauge";
  RegisterClass(&wc);

  // Register a class for the main dialog
  memset(&wc, 0, sizeof(wc));
  wc.style         = CS_DBLCLKS | CS_SAVEBITS | CS_BYTEALIGNWINDOW;
  wc.lpfnWndProc   = DefDlgProc;
  wc.cbClsExtra    = 0;
  wc.cbWndExtra    = DLGWINDOWEXTRA;
  wc.hInstance     = hInstance;
  wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
  wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
  wc.lpszClassName = "NSExtracting";
  RegisterClass(&wc);

  if(dwMode != SILENT)
  {
	  // Display the dialog box
	  dlgInfo.hWndDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EXTRACTING), NULL, (DLGPROC)DialogProc);
	  UpdateWindow(dlgInfo.hWndDlg);
  }

	// Extract the files
	EnumResourceNames(NULL, "FILE", (ENUMRESNAMEPROC)ExtractFilesProc, 0);
	
	// Launch the install program and wait for it to finish
	RunInstaller();
	return 0;  
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:86,代码来源:nsinstall.cpp


示例6: _tWinMain

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);


	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

 	// TODO: ここにコードを挿入してください。
	MSG msg;
	HACCEL hAccelTable;

	// グローバル文字列を初期化しています。
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, IDC_WALL, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	// アプリケーションの初期化を実行します:
	if (!InitInstance (hInstance, nCmdShow))
	{
		return FALSE;
	}

	int ret;
	ret = OneTimeSceneInit();
	if( ret ){
		_ASSERT( 0 );
		return FALSE;
	}

	hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WALL));

	// Now we're ready to recieve and process Windows messages.
    BOOL bGotMsg;
    //MSG  msg;
    PeekMessage( &msg, NULL, 0U, 0U, PM_NOREMOVE );

    while( WM_QUIT != msg.message  )
    {
        // Use PeekMessage() if the app is active, so we can use idle time to
        // render the scene. Else, use GetMessage() to avoid eating CPU time.
       // if( m_bActive )
        bGotMsg = PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE );
        //else
          //  bGotMsg = GetMessage( &msg, NULL, 0U, 0U );

        if( bGotMsg )
        {
            // Translate and dispatch the message
            if( 0 == TranslateAccelerator(msg.hwnd, hAccelTable, &msg) )
            {
                TranslateMessage( &msg );
                DispatchMessage( &msg );
            }
        }else{
			if( Render3DEnvironment() != 0 ){
                SendMessage( msg.hwnd, WM_CLOSE, 0, 0 );
            }
        }
    }

	E3DBye();


    return (int)msg.wParam;
}
开发者ID:toughie88,项目名称:E3DSamples,代码行数:69,代码来源:Wall.cpp


示例7: FindShapes

//---------------------------------------------------------------------------
void __fastcall TGroundGroupForm::OpenGroundGroupMobile(int X,int Y)
{

 //	int*	ctrlarray;
	char buff[50];

	if (!dialheight[0][0])
    {
    	dialheight[0][0]=Height;
        dialheight[0][1]=Panel1->Top;
        dialheight[0][2]=ButtonPanel->Top;
        int delta=GGPanel->Height;
		dialheight[1][0]=dialheight[0][0]-delta;
		dialheight[1][1]=dialheight[0][1]-delta;
		dialheight[1][2]=dialheight[0][2]-delta;
    }

    Height=dialheight[0][0];
    Panel1->Top=dialheight[0][1];
    ButtonPanel->Top=dialheight[0][2];
	info_grndgrp*	G=*Persons2::ConvertPtrUID(MissionEditor->currobj);

//	MissionEditor->FillComboBox(IDS_CENTRALPOWERS, IDS_ALLIES, NationalityComboBox,
//										G->Nationality);

	UniqueID	uidwp;

		GGAltLabel->Visible = false;
		GGEditAlt->Visible = false;

	int groupindex = -1;
	if (G->shape==ENABLE_COMPLEX_VAL)
    	if (G->shape->type==Expr::EXPR_GLOB)
            FindShapes(G->shape->UsesGlobRef(),groupindex,3);
        else
        	if (G->shape[2]->type==Expr::EXPR_GLOB)
	            FindShapes(G->shape[2]->UsesGlobRef(),groupindex,3);
            else
            	FindShapes(G->shape.Evaluate(2),groupindex,-1);
    else
        FindShapes(G->shape.Evaluate(2),groupindex,-1);
	RefreshText();
	BfieldLabel->Caption = MissionEditor->loadedbfs[G->bfieldindex].name;


	UniqueIDBand	uidband;

	if ((int)G->Status.size > (int)ITEMSIZE)
	{
		grndvel = G->vel.Evaluate();
		uidwp=G->wpref;
	}else
	{
		uidwp = UID_Null;
	}

	uidband = Persons2::getbandfromUID(MissionEditor->currobj);

	 int text = MissionEditor->GetBandorShapeText(MissionEditor->currobj);
	 LoadString(HInstance,text,buff,sizeof(buff));
	 Caption = buff;

		GGPanel->Visible = true;
//		ButtonPanel->Top = 147;
//		Height = 284;		//325;

//		MissionEditor->FillComboBox(IDS_CENTRALPOWERS, IDS_ALLIES, NationalityComboBox,
//										G->nationality-1);

		GGSpeedLabel->Visible = true;
		GGSpeedData->Visible = true;
		AltSpinButton->Visible = true;
		SpdComboBox->Visible = true;
		GGFormationSizeLabel->Visible = true;
		GGFormationTypeLabel->Visible = true;
		GGFormationSpinEdit->Visible = true;
		GGFormTypeBox->Visible = true;
		GG_StatusLabel->Visible = true;
		GG_StatusComboBox->Visible = true;
 //		if 	(	((int)G->shape.Evaluate(2) == (int)TRAIN3)
   //						  || ((int)G->shape.Evaluate(2) == (int)TRAIN4)
	 //		 )
	   //		GG_StatusComboBox->Enabled = false;
		//else
			GG_StatusComboBox->Enabled = true;

		GGEventMore->Visible = false;

	if ((int)G->Status.size > (int)ITEMSIZE)
//	if (uidwp != UID_Null)
	{

		GGRoute->Visible = true;
		GGRoute->Enabled = true;

		SpdComboBox->OnChange = NULL;
		RefreshSpeedInfo();
		SpdComboBox->OnChange = SpdComboBoxChange;

//.........这里部分代码省略.........
开发者ID:gondur,项目名称:mig_src,代码行数:101,代码来源:GRNDGRP.CPP


示例8: findJreInfoFromRegistry

/*----------------------------------------------------------------------
 Get info about JRE from registry.
----------------------------------------------------------------------*/
static int findJreInfoFromRegistry(char *path, char *args) {
	INT	   i;
	HKEY   hKey;				/* Key handle of NetShell */
	CHAR   ValueName[MAX_PATH]; /* Name of value. */
	DWORD  cbValueName;			/* Size of value name. */
	DWORD  dwType;     			/* Type of data. */
	CHAR   bData[MAX_PATH];   	/* Data buffer. */
	DWORD  cbData;  		  	/* Size of data buffer. */
	DWORD  retCode;
	CHAR   *Param;
	BOOL   found = FALSE;		/* We have found info in the registry */

	/* Open the key for jre and get info about it. */
	retCode = RegOpenKeyEx(hKeyRoot, SubKey, 0, KEY_EXECUTE, &hKey);
	if (retCode != ERROR_SUCCESS) {
		DPRINT(("stub: RegOpenKeyEx error for hKey = %d\n",
				retCode));
		return FALSE;
	}
	for (i = 0; retCode == ERROR_SUCCESS; i++) {
		bData[0] = '\0';
		ValueName[0] = '\0';
		cbData = MAX_PATH;
		cbValueName = MAX_PATH;
		/* Enumerate the key values. */
		retCode = RegEnumValue(hKey, i, ValueName, &cbValueName,
								NULL, &dwType, bData, &cbData);
		if (retCode != ERROR_SUCCESS) {
			if (dwType < REG_FULL_RESOURCE_DESCRIPTOR &&
								retCode != ERROR_NO_MORE_ITEMS) {
				DPRINT(("stub: ERROR, RegEnumValue = %d cbData = %d line %d\n"
					   , retCode, cbData, __LINE__));
 				return FALSE;
			}
		}
		DPRINT(("stub.findJreInfo...: i=%d, ValueName=%s, cbValueName=%d, dwType=%d,\n\t bData=%s, cbData=%d; retCode=%d\n", i, ValueName, cbValueName, dwType, bData, cbData, retCode));
		/* Process the value accordingly. */
		Param = _strlwr(ValueName);
		if(!strcmp("javahome", Param)) {
			DPRINT(("stub.findJreInfo...: Setting path and args to %s\n",bData));
			strcat(path, bData);
			strcat(args, bData);
			found = TRUE;
		}
		if(!strcmp("microversion", Param)) {
			DPRINT(("stub.findJreInfo...: found JRE 1.1.%s\n",bData));
			if(atoi(bData) < 6) {
				CHAR title[TITLELEN];
				CHAR msg[MSGLEN];
				LoadString(NULL, IDS_OLD_JRE_TITLE, title, TITLELEN);
				LoadString(NULL, IDS_OLD_JRE_MSG, msg, MSGLEN);
				MessageBox(NULL, msg, title,
					MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND);
				DPRINT(("stub: version of jre is too old"));
				return FALSE;
			}
		}
	}
	DPRINT(("stub.findJreInfo...: done, found=%d",found));
	return found;
}
开发者ID:BygoneWorlds,项目名称:anet,代码行数:64,代码来源:anetstub.c


示例9: WinMain

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	// Hook spew output.
	SpewOutputFunc( MySpewOutputFunc );

	// Get access to the registry..
	RegCreateKey( HKEY_LOCAL_MACHINE, VMPI_SERVICE_KEY, &g_hVMPIServiceKey );

	// Setup our version string.
	LoadString( hInstance, VMPI_SERVICE_IDS_VERSION_STRING, g_VersionString, sizeof( g_VersionString ) );

	// Setup the base app path.
	if ( !GetModuleFileName( GetModuleHandle( NULL ), g_BaseAppPath, sizeof( g_BaseAppPath ) ) )
	{
		Warning( "GetModuleFileName failed.\n" );
		return false;
	}
	V_StripLastDir( g_BaseAppPath, sizeof( g_BaseAppPath ) );

	// Setup the cache path.
	V_ComposeFileName( g_BaseAppPath, "vmpi_service_cache", g_FileCachePath, sizeof( g_FileCachePath ) );


	const char *pArg = FindArg( __argc, __argv, "-mpi_pw", NULL );
	SetPassword( pArg );
	
	if ( FindArg( __argc, __argv, "-console" ) )
	{					
		g_RunMode = RUNMODE_CONSOLE;
	}
	else
	{
		g_RunMode = RUNMODE_SERVICE;
	}

	if ( FindArg( __argc, __argv, "-superdebug" ) )
		g_bSuperDebugMode = true;

	g_AppStartTime = GetTickCount();
	g_bMinimized = FindArg( __argc, __argv, "-minimized" ) != NULL;

	ServiceHelpers_Init(); 	
	g_hInstance = hInstance;

	LoadStateFromRegistry();

	// Install the service?
	if ( g_RunMode == RUNMODE_CONSOLE )
	{					
		RunAsNonServiceApp();
	}
	else
	{
		RunService();
	}

	return 0;
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:61,代码来源:vmpi_service.cpp


示例10: InitInstance

//
//   FUNCTION: InitInstance(HINSTANCE, int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function, we save the instance handle in a global variable and
//        create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
	HWND hWnd;
	TCHAR szTitle[MAX_LOADSTRING];		// title bar text
	TCHAR szWindowClass[MAX_LOADSTRING];	// main window class name

	g_hInst = hInstance; // Store instance handle in our global variable


	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); 
	LoadString(hInstance, IDC_WEMAP, szWindowClass, MAX_LOADSTRING);


	if (!MyRegisterClass(hInstance, szWindowClass))
	{
		return FALSE;
	}
	EnumWindows( enum_proc, (LPARAM)"Ѕлокнот" );
	if (!hWnd_navitel)
	{
		FILE * pFileTXT;

		SYSTEMTIME st;
		GetLocalTime(&st);
		pFileTXT = fopen (fname,"a");
		fprintf(pFileTXT, "---> Date: [%02d, %02d, %d]  Time: [%02d:%02d:%02d] " ,st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond);
		fprintf (pFileTXT, " navitel not running - ");


		STARTUPINFO cif;
		ZeroMemory(&cif,sizeof(STARTUPINFO));
		/*LPSHELLEXECUTEINFO lpExecInfo;
		ZeroMemory(&SHExecInfo, sizeof(SHExecInfo));
		
		SHExecInfo.cbSize = sizeof(SHExecInfo);
		SHExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
		SHExecInfo.nShow = SW_SHOWNORMAL;
		SHExecInfo.lpFile = "\\Storage Card\\navi\\navitel.exe";
		if(!ShellExecuteEx(&SHExecInfo)) {
			*/
		if (CreateProcess(L"\\Doc Disk\\igo8\\igo8.exe",NULL,NULL,NULL,FALSE,NULL,NULL,NULL,&cif,&pi_navitel)==TRUE)
		{
			fprintf (pFileTXT, " navitel runned.\n");
		} else
			fprintf (pFileTXT, " navitel run faied.\n");

		fclose (pFileTXT);
	}

	hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);

	if (!hWnd)
	{
		return FALSE;
	}
	hWnd_self = hWnd;
/*
	RegisterHotKey(hWnd, 10001, MOD_KEYUP, VK_APP1);
	RegisterHotKey(hWnd, 10002, MOD_KEYUP, VK_APP2);
	RegisterHotKey(hWnd, 10003, MOD_KEYUP, VK_APP3);
	RegisterHotKey(hWnd, 10004, MOD_KEYUP, VK_APP4);
	RegisterHotKey(hWnd, 10005, MOD_KEYUP, VK_APP5);
	RegisterHotKey(hWnd, 10006, MOD_KEYUP, VK_APP6);
*/
	ShowWindow(hWnd, nCmdShow);
	UpdateWindow(hWnd);

	if (g_hWndCommandBar)
	{
		CommandBar_Show(g_hWndCommandBar, TRUE);
	}

	return TRUE;
}
开发者ID:toxeh,项目名称:wemap,代码行数:85,代码来源:wemap.cpp


示例11: WinMain

/*--------------------------------------------------------------------------
 Launches NetShell, waits for Netshell and all of NetShell's launched
   processes to die and then relaunches NetShell if nothing exited with
   non-zero exit status.
--------------------------------------------------------------------------*/
int WINAPI WinMain(HINSTANCE hinstExe, HINSTANCE hinstExePrev, LPSTR lpszCmdLine, int nCmdShow)
{
	int firsttime = 1;
	char cmd[2*MAX_PATH];
	char args[MAX_PATH];
	char cwd[MAX_PATH];
	char strhandle[MAX_HSTR];
	DWORD nhandles = 0;
	DWORD exitCode = 0;
	DWORD dwThreadId, iSignal;
	HANDLE hpipeRead, hpipeWrite, hSelf;
	HANDLE *hArray, *hStartArr;
	SECURITY_ATTRIBUTES saAttr;
	STARTUPINFO si;
	PROCESS_INFORMATION pi;

#ifdef DEBUG
#ifndef PRINT_STDOUT
	{	char logfile[MAX_PATH];
		sprintf(logfile, "%x", time(NULL));
		strcat(logfile, ".log");
		flog = fopen(logfile, "w");
	}
#endif
#endif
	/* Pick random session id for benefit of serial and modem drivers */
	sprintf(strhandle, "%x", GetTickCount());
	if (!SetEnvironmentVariable(DPSTUBID, strhandle)) {
		DPRINT(("stub: set environment variable error %x.\n", GetLastError()));
		exit(1);
	}
	hArray = (HANDLE *)malloc(MAXIMUM_WAIT_OBJECTS * sizeof(HANDLE));
	hStartArr = hArray;
	saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
	saAttr.bInheritHandle = TRUE;
	saAttr.lpSecurityDescriptor = NULL;
	if (!DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), &hSelf,  0, TRUE, DUPLICATE_SAME_ACCESS)) {
		DPRINT(("stub: error duplicating own handle\n"));
		exit(1);
	}
	sprintf(strhandle, "%x", hSelf);
	if (!SetEnvironmentVariable(DPSTUB, strhandle)) {
		DPRINT(("stub: set environment variable error %x.\n", GetLastError()));
		exit(1);
	}
//	DPRINT(("stub: current process handle is %s\n", strhandle));

	/* create event so read thread can signal when it's read a new process */
	if (!(hreadEvent = CreateEvent(NULL, FALSE, FALSE, "ReadEvent"))) {
		DPRINT(("stub: create read event error %x.\n", GetLastError()));
		exit(1);
	}
	*hArray++ = hreadEvent;
	nhandles++;
//	DPRINT(("stub: read event handle is %x\n", *(hArray - 1)));

	/* create event so read thread knows main thread has finished processing
	   hSpawn and can continue to get new processes */
	if (!(hcontEvent = CreateEvent(NULL, FALSE, FALSE, "ContinueReadEvent"))) {
		DPRINT(("stub: create continue read event error %x.\n", GetLastError()));
		exit(1);
	}
//	DPRINT(("stub: continue read event handle is %x\n", hcontEvent));

	/* create a pipe with read end uninheritable and write end inheritable*/
	if(!CreatePipe(&hpipeRead, &hpipeWrite, &saAttr, sizeof(HANDLE))) {
		DPRINT(("stub: create pipe error %x.\n", GetLastError()));
		exit(1);
	}
	sprintf(strhandle, "%x", hpipeWrite);
	if (!SetEnvironmentVariable(DPSTUBWPIPE, strhandle)) {
		DPRINT(("stub: set environment variable error %x.\n", GetLastError()));
		exit(1);
	}
	if (!DuplicateHandle(GetCurrentProcess(), hpipeRead, GetCurrentProcess(), &hpipeReadDup,  0, FALSE, DUPLICATE_SAME_ACCESS)) {
		DPRINT(("stub: error duplicating uninheritable handle\n"));
		exit(1);
	}
	CloseHandle(hpipeRead);
//	DPRINT(("stub: uninheritable pipe handle is %x.\n", hpipeReadDup));

	/* create a thread to read from pipe about new processes*/
	if (CreateThread(NULL, 0, readThread, 0, 0, &dwThreadId) < 0) {
		DPRINT(("stub: create thread error %x.\n", GetLastError()));
		exit(1);
	}

	/* set command and current working directory for CreateProcess() */
	{	char *buf;
		char path[2*MAX_PATH];
		char cmdline[1024];
		if (getinfo(path, args, cwd) != 0) {
			CHAR title[TITLELEN];
			CHAR msg[MSGLEN];
			LoadString(NULL, IDS_NO_JRE_TITLE, title, TITLELEN);
//.........这里部分代码省略.........
开发者ID:BygoneWorlds,项目名称:anet,代码行数:101,代码来源:anetstub.c


示例12: main


//.........这里部分代码省略.........
	        number_output = 1;
	        break;
			
	      case 'r':
	      case 'R':		/* search strings as regular expressions */
	        reg_express = 1;
	        break;	

	      case 's':
	      case 'S':		/* search files in child directory too*/
	        sub_dirs = 1;
	        break;				

	      case 'v':
	      case 'V':		/* Not with */
	        invert_search = 1;
	        break;

	      case 'x':
	      case 'X':		/* exact match */
	        exact_match = 1;
	        break;			
			
	      default:
	        usage ();
	        exit (2);		/* syntax error .. return error 2 */
	        break;
	    }
        }
      else
        {
          /* Get the string */
	  if (needle == NULL)
	    {
              /* Assign the string to find */
              needle = *argv;
	    }
	}
    }

  /* Check for search string */
  if (needle == NULL)
    {
      /* No string? */
      usage ();
      exit (1);
    }

  /* Scan the files for the string */
  if (argc == 0)
    {
      ret = find_str (needle, stdin, invert_search, count_lines,
                      number_output, ignore_case, at_start, literal_search, at_end, reg_express, exact_match,
					  sub_dirs, only_fname);
    }

  while (--argc >= 0)
    {
      hfind = _findfirst (*++argv, &finddata);
      if (hfind < 0)
	{
	  /* We were not able to find a file. Display a message and
	     set the exit status. */
	  LoadString( GetModuleHandle(NULL), IDS_NO_SUCH_FILE, (LPTSTR)lpMessage, 4096);
	  CharToOem(lpMessage, lpMessage);
	  fprintf (stderr, lpMessage, *argv);//
	}
      else
        {
          /* repeat find next file to match the filemask */
	  do
            {
              /* We have found a file, so try to open it */
	      if ((pfile = fopen (finddata.name, "r")) != NULL)
	        {
	          printf ("---------------- %s\n", finddata.name);
	          ret = find_str (needle, pfile, invert_search, count_lines,
                      number_output, ignore_case, at_start, literal_search, at_end, reg_express, exact_match,
					  sub_dirs, only_fname);
	          fclose (pfile);
	        }
 	      else
	        {
	          LoadString(GetModuleHandle(NULL), IDS_CANNOT_OPEN, (LPTSTR)lpMessage, 4096);
	          CharToOem(lpMessage, lpMessage);
	          fprintf (stderr, lpMessage,
		           finddata.name);
                }
	    }
          while (_findnext(hfind, &finddata) > 0);
        }
      _findclose(hfind);
    } /* for each argv */

 /* RETURN: If the string was found at least once, returns 0.
  * If the string was not found at all, returns 1.
  * (Note that find_str.c returns the exact opposite values.)
  */
  exit ( (ret ? 0 : 1) );
}
开发者ID:hoangduit,项目名称:reactos,代码行数:101,代码来源:findstr.c


示例13: DlgProc

LRESULT CALLBACK DlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) {
	switch (message) {
		case WM_INITDIALOG:
			{
				RECT rectOwner, rectDlg, rectDiff;

				GetWindowRect(GetDesktopWindow(), &rectOwner);
				GetWindowRect(hwndDlg, &rectDlg);
				CopyRect(&rectDiff, &rectOwner);

				OffsetRect(&rectDlg, -rectDlg.left, -rectDlg.top);
				OffsetRect(&rectDiff, -rectDiff.left, -rectDiff.top);
				OffsetRect(&rectDiff, -rectDlg.right, -rectDlg.bottom);

				SetWindowPos(hwndDlg, HWND_TOP, rectOwner.left + (rectDiff.right / 2), rectOwner.top + (rectDiff.bottom / 2), 0, 0, SWP_NOSIZE);


				HWND hwndProg = GetDlgItem(hwndDlg, IDC_PROGRESS);
				DWORD dwStyle = GetWindowLong(hwndProg, GWL_STYLE);
				SetWindowLong(hwndProg, GWL_STYLE, dwStyle | PBS_MARQUEE);
				SendMessage(hwndProg, PBM_SETMARQUEE, TRUE, 70 /* = scroll speed */);

				HWND hwndOK = GetDlgItem(hwndDlg, IDC_OK);
				if (silentFlag) {
					RECT rectProg, rectOK;
					GetWindowRect(hwndProg, &rectProg);
					GetWindowRect(hwndOK, &rectOK);

					POINT posProg;
					posProg.x = rectProg.left;
					posProg.y = rectProg.top;
					ScreenToClient(hwndDlg, &posProg);

					MoveWindow(hwndProg, posProg.x, posProg.y, rectOK.right - rectProg.left, rectProg.bottom - rectProg.top, TRUE);

					ShowWindow(hwndOK, SW_HIDE);
				} else {
					EnableWindow(hwndOK, FALSE);
				}
				HWND hwndDetails = GetDlgItem(hwndDlg, IDC_DETAILS);
				ShowWindow(hwndDetails, SW_HIDE);

				LPTSTR dialogText = (LPTSTR)malloc(MAX_STRING_LENGTH * sizeof(TCHAR));
				UINT titleID = (uninstallFlag ? IDS_UNINSTALL : IDS_INSTALL);
				LoadString(GetModuleHandle(NULL), titleID, dialogText, MAX_STRING_LENGTH);
				SetWindowText(hwndDlg, dialogText);

				LoadString(GetModuleHandle(NULL), IDS_CLOSE, dialogText, MAX_STRING_LENGTH);
				SetDlgItemText(hwndDlg, IDC_OK, dialogText);

				LoadString(GetModuleHandle(NULL), IDS_DETAILS, dialogText, MAX_STRING_LENGTH);
				SetDlgItemText(hwndDlg, IDC_DETAILS, dialogText);

				LPTSTR message = (LPTSTR)malloc((2 * MAX_STRING_LENGTH + 10) * sizeof(TCHAR));
				UINT loadingID = (uninstallFlag ? IDS_LOADING_U : IDS_LOADING);
				LoadString(GetModuleHandle(NULL), loadingID, message, MAX_STRING_LENGTH);

				loadingID = (estTime) ? IDS_TIMESPEC : IDS_TIMEUNDEF;
				LoadString(GetModuleHandle(NULL), loadingID, dialogText, MAX_STRING_LENGTH);

				LPTSTR time = (LPTSTR)malloc(9 * sizeof(TCHAR));
				_itot(estTime, time, 10);
				DWORD_PTR messageArguments[] = { (DWORD_PTR)time };
				HLOCAL formattedString = NULL;
				DWORD formatFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING |  FORMAT_MESSAGE_ARGUMENT_ARRAY;
				FormatMessage(formatFlags, dialogText, loadingID, 0, (LPTSTR)&formattedString, 0, (va_list*)messageArguments);
				free(time);

				_tcsncat(message, _T("\n"), 2 * MAX_STRING_LENGTH + 10);
				_tcsncat(message, formattedString, 2 * MAX_STRING_LENGTH + 10);

				SetDlgItemText(hwndDlg, IDC_MESSAGE, message);

				LocalFree(formattedString);
				free(dialogText);
				free(message);
			}

			SetTimer(hwndDlg, IDT_TIMER1, 500, (TIMERPROC)NULL);
			break;
		case WM_COMMAND:
			switch (LOWORD(wParam)) {
				case IDOK:
				case IDCANCEL:
					if (hChildProc == 0) {
						EndDialog(hwndDlg, wParam);
						return TRUE;
					}
					break;
				case IDC_DETAILS: {
					LPTSTR errorMsg = _tcserror(exitCode);

					LPTSTR messsageFormat = (LPTSTR)malloc(MAX_STRING_LENGTH);
					LoadString(NULL, IDS_ERRORCODE, messsageFormat, MAX_STRING_LENGTH);

					HLOCAL messageString = NULL;
					DWORD_PTR messageArguments[] = { (DWORD_PTR)exitCode, (DWORD_PTR)errorMsg };
					DWORD formatFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING |  FORMAT_MESSAGE_ARGUMENT_ARRAY;
					FormatMessage(formatFlags, messsageFormat, IDS_ERRORCODE, 0, (LPTSTR)&messageString, 0, (va_list*)messageArguments);

//.........这里部分代码省略.........
开发者ID:Shondoit,项目名称:loader,代码行数:101,代码来源:loader.c


示例14: ShowMessageBox

UINT ShowMessageBox (UINT Id, UINT Button, UINT Help, ...) {

    CString temp;
    TCHAR *pszstring,
    *pszpaste,
    *pszcut,
    *pszdone,
    *pszconvert;
    TCHAR chread;
    va_list params;
    int x;

    pszconvert = new TCHAR[255];
    va_start(params, Help);
    LoadString (temp, Id);
    pszstring = temp.GetBuffer(512);
    _tcscpy(pszstring,pszstring);
    temp.ReleaseBuffer();
    // Look and see - is there a need to insert chars (95% of the time, there won't)
    if (!_tcsstr(pszstring, _T("%"))) {
	delete pszconvert;
	return AfxMessageBox(pszstring, Button, Help);
    }

    x = _tcscspn(pszstring, _T("%"));
    pszdone = new TCHAR[512];
    pszcut = new TCHAR[512];
    pszpaste = new TCHAR[512];
    _tcscpy(pszcut, &pszstring[x+2]);
    _tcsncpy(pszpaste, pszstring, x);
    pszpaste[x] = _T('\0');
    chread = pszstring[x+1];

    for ( ; ; ) {

	switch (chread) {
	case	_T('i') :
	case	_T('d') :
	{
	    int anint = va_arg(params, int);
	    _itot( anint, pszconvert, 10);
	    break;
	}
	case	_T('u') :
	{
	    UINT anuint = va_arg(params, UINT);
	    _itot( anuint, pszconvert, 10);
	    break;
	}

	case	_T('x') :
	case	_T('X') :
	{
	    int ahex = va_arg(params, int);
	    _itot( ahex, pszconvert, 16);
	    break;
	}
	case	_T('g') :
	case	_T('f') :
	case	_T('e') :
	{
	    double adbl = va_arg(params, double);
            _stprintf(pszconvert, _T("%g"), adbl);
	    break;
	}
	case	_T('s') :
	{
	    TCHAR *pStr = va_arg(params, TCHAR*);
	    ASSERT(_tcslen(pStr) <= 255);
	    _tcscpy(pszconvert, pStr);
	    break;
	}
	case	_T('l') :
	{
	    chread = pszdone[x+2];
	    switch(chread) {
	    case	_T('x')	:
	    {
		long int alhex = va_arg(params, long int);
		_ltot(alhex, pszconvert, 16);
		_tcscpy(pszcut, &pszcut[1]);
		break;
	    }
	    case 	_T('d')	:
		default 	:
		{
		    long int along = va_arg(params, long int);
		    _ltot( along, pszconvert, 10);
		    // For the L, there will be one character after it,
		    //   so move ahead another letter
		    _tcscpy(pszcut, &pszcut[1]);
		    break;
		}
	    }
	    break;
	}

	case	_T('c') :
	{
	    int letter = va_arg(params, int);
//.........这里部分代码省略.........
开发者ID:bagdxk,项目名称:openafs,代码行数:101,代码来源:msgs.cpp


示例15: WndProc

LONG FAR PASCAL WndProc(
    HWND hwnd,
    WORD message,
    WORD wParam,
    LONG lParam)
{
    char chbuf[50];
    HICON hIcon;

    switch (message) {
    case WM_CREATE:
        break;

    case WM_DESTROY:
        // ignore since wowexec must stay around
        return 0;

#ifdef DEBUG
    case WM_COMMAND:
        switch (LOWORD(wParam)) {
            case MM_ABOUT:
                LoadString(hAppInstance, errTitle, (LPSTR)chbuf, sizeof(chbuf));
                hIcon = LoadIcon(hAppInstance, MAKEINTRESOURCE(ID_WOWEXEC_ICON));
                ShellAbout(ghwndMain, (LPSTR)chbuf, (LPSTR)lpszAppTitle, hIcon);
            break;

            case MM_BREAK:
                _asm int 3
            break;

            case MM_FAULT:
                _asm mov cs:0,ax
            break;

            case MM_EXIT:
                ExitKernelThunk(0);
            break;

            case MM_WATSON:
                WinExec("drwatson", SW_MINIMIZE );
            break;

            case MM_PARTY:
            {
                FARPROC lpPartyDialogProc;

                lpPartyDialogProc = MakeProcInstance(PartyDialogProc, hAppInstance);

                DialogBox(hAppInstance, MAKEINTRESOURCE(ID_PARTY_DIALOG),
                          hwnd, lpPartyDialogProc);

                FreeProcInstance(lpPartyDialogProc);
            }
            break;

        }
        break;
#endif

    case WM_WOWEXECSTARTAPP:      // WM_USER+0

#ifdef DEBUG
        OutputDebugString("WOWEXEC - got WM_WOWEXECSTARTAPP\n");
#endif

        //
        // Either BaseSrv or Wow32 asked us to go looking for
        // commands to run.
        //

        if (!gfSharedWOW) {

            //
            // We shouldn't get this message unless we are the shared
            // WOW VDM!
            //

#ifdef DEBUG
            OutputDebugString("WOWEXEC - separate WOW VDM got WM_WOWEXECSTARTAPP!\n");
            _asm int 3;
#endif
            break;
        }

        //
        // Start requested apps until there are no more to start.
        // This handles the case where several Win16 apps are launched
        // in a row, before BaseSrv has the window handle for WowExec.
        //

        while (StartRequestedApp()) {
            /* Null stmt */ ;
        }
        break;

#define WM_WOWEXEC_START_TASK (WM_USER+2)
    case WM_WOWEXEC_START_TASK:
        {
            char sz[512];

//.........这里部分代码省略.........
开发者ID:chunhualiu,项目名称:OpenNT,代码行数:101,代码来源:wowexec.c


示例16: GetWindowLongPtr

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LoadStringResource函数代码示例发布时间:2022-05-30
下一篇:
C++ LoadStr函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap