当前位置: 首页>>代码示例>>C++>>正文


C++ popstring函数代码示例

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


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

示例1: BannerProc

BOOL CALLBACK BannerProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
  if (uMsg == WM_INITDIALOG)
  {
    int iMainStringSet = 0;

    popstring(buf);
    while (*(int*)buf == CHAR4_TO_DWORD('/','s','e','t') && !buf[4])
    {
      unsigned int id;
      popstring(buf);
      id = myatou(buf);
      popstring(buf);
      SetDlgItemText(hwndDlg, id, buf);
      popstring(buf);

      if (id == IDC_STR)
        iMainStringSet++;
    }

    SetWindowText(hwndDlg, buf);
    if (!iMainStringSet)
      SetDlgItemText(hwndDlg, IDC_STR, buf);

    if (!*buf)
      SetWindowLong(hwndDlg, GWL_EXSTYLE, GetWindowLong(hwndDlg, GWL_EXSTYLE) | WS_EX_TOOLWINDOW);
  }
  if (uMsg == WM_CLOSE)
  {
    DestroyWindow(hwndDlg);
  }
  return 0;
}
开发者ID:Mobivity,项目名称:nsis-logset-on-debian,代码行数:33,代码来源:Banner.c

示例2: __declspec

void __declspec(dllexport) UpdateDriver(HWND hwndParent, int string_size, 
	char *variables, stack_t **stacktop,
	extra_parameters *extra)
{
	int retval;	

	g_hwndParent=hwndParent;
	EXDLL_INIT();
	{
		BOOL restart = 0;
		DWORD flags = 0;//INSTALLFLAG_NONINTERACTIVE
		DWORD lastErrorCode;
		char hardwareID[256];
		char infFilePath[256];
		popstring(hardwareID);
		popstring(infFilePath);

		retval = eIDUpdateDriver(hwndParent,hardwareID,infFilePath,flags,&restart, &lastErrorCode);

		if(retval != 0)
		{
			//on succes, let the caller know if a system reboot was requested
			pushint((int)restart);
		}
		else
		{
			//on failure, send the error code
			pushint((int)lastErrorCode);
		}

		pushint(retval);
	}
}
开发者ID:Andhr3y,项目名称:dcfd-mw-applet,代码行数:33,代码来源:main.c

示例3: BannerProc

BOOL CALLBACK BannerProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
  if (uMsg == WM_INITDIALOG)
  {
    int iMainStringSet = 0;

    popstring(buf);
    while (lstrcmp(buf, _T("/set")) == 0)
    {
      unsigned int id;
      popstring(buf);
      id = myatou(buf);
      popstring(buf);
      SetDlgItemText(hwndDlg, id, buf);
      popstring(buf);

      if (id == IDC_STR)
        iMainStringSet++;
    }

    SetWindowText(hwndDlg, buf);
    if (!iMainStringSet)
      SetDlgItemText(hwndDlg, IDC_STR, buf);

    if (!*buf)
      SetWindowLongPtr(hwndDlg, GWL_EXSTYLE, GetWindowLongPtr(hwndDlg, GWL_EXSTYLE) | WS_EX_TOOLWINDOW);
  }
  if (uMsg == WM_CLOSE)
  {
    DestroyWindow(hwndDlg);
  }
  return 0;
}
开发者ID:kichik,项目名称:nsis-1,代码行数:33,代码来源:Banner.c

示例4: PopRegKeyArgs

static BOOL PopRegKeyArgs(TCHAR * path, BOOL *options)
{
  TCHAR * param = (TCHAR *)GlobalAlloc(GPTR, g_string_size*sizeof(TCHAR));
  int iRootKey;
  BOOL success = FALSE;

  if (!popstring(param))
  {
    *options = FALSE;
    if (lstrcmpi(param, _T("/noinherit")) == 0)
    {
      *options = TRUE;
      popstring(param);
    }
  }
  else
    ABORT("Root key name missing");

  iRootKey = ParseEnum(g_rootKeyNames, param);
  if (!ARRAY_CONTAINS(g_rootKeyPrefixes, iRootKey))
    ABORT_s("Bad root key name (%s)", param);

  if (popstring(param))
    ABORT("Registry key name missing");

  path[0] = 0;
  lstrcat(path, g_rootKeyPrefixes[iRootKey]);
  lstrcat(path, param);

  success = TRUE;

cleanup:
  GlobalFree(param);
  return success;
}
开发者ID:FelixBucket,项目名称:ToontownFritzServer,代码行数:35,代码来源:AccessControl.cpp

示例5: PopFileArgs

static const SchemeType * PopFileArgs(TCHAR * path, BOOL *options)
{
  if (popstring(path) == 0)
  {
    DWORD attr;
    *options = FALSE;
    if (lstrcmpi(path, _T("/noinherit")) == 0)
    {
      *options = TRUE;
      popstring(path);
    }
    attr = GetFileAttributes(path);

    if (INVALID_FILE_ATTRIBUTES != attr)
      return FILE_ATTRIBUTE_DIRECTORY & attr
        ? g_directoryScheme
        : g_fileScheme;
    else
      ABORT("Invalid filesystem path missing");
  }
  else
    ABORT("Filesystem path missing");

cleanup:
  return NULL;
}
开发者ID:FelixBucket,项目名称:ToontownFritzServer,代码行数:26,代码来源:AccessControl.cpp

示例6: PopPlacement

int NSDFUNC PopPlacement(int *x, int *y, int *width, int *height)
{
  RECT dialogRect;
  int  dialogWidth;
  int  dialogHeight;
  char buf[1024];

  GetClientRect(g_dialog.hwDialog, &dialogRect);
  dialogWidth = dialogRect.right;
  dialogHeight = dialogRect.bottom;

  if (popstring(buf, 1024))
    return 1;

  *x = ConvertPlacement(buf, dialogWidth, 0);

  if (popstring(buf, 1024))
    return 1;

  *y = ConvertPlacement(buf, dialogHeight, 1);

  if (popstring(buf, 1024))
    return 1;

  *width = ConvertPlacement(buf, dialogWidth, 0);

  if (popstring(buf, 1024))
    return 1;

  *height = ConvertPlacement(buf, dialogHeight, 1);

  ConvertPosToRTL(x, *width, dialogWidth);

  return 0;
}
开发者ID:kichik,项目名称:nsis-1,代码行数:35,代码来源:input.c

示例7: ChangeDACL

static void ChangeDACL(const SchemeType * scheme, TCHAR * path, DWORD mode, BOOL noinherit)
{
  TCHAR * param = (TCHAR *)LocalAlloc(LPTR, g_string_size*sizeof(TCHAR));
	TCHAR * trusteeName = NULL;
  PSID pSid = NULL;
  DWORD trusteeForm = TRUSTEE_IS_NAME;
  DWORD permissions = 0;

  PACL pOldAcl = NULL;
  PACL pNewAcl = NULL;
  EXPLICIT_ACCESS access;

  DWORD ret = 0;

  if (popstring(param))
    ABORT("Trustee is missing");

  if (NULL == (trusteeName = ParseTrustee(param, &trusteeForm)))
    ABORT_s("Bad trustee (%s)", param);

  if (popstring(param))
    ABORT("Permission flags are missing");

  if (0 == (permissions = ParsePermissions(scheme, param)))
    ABORT_s("Bad permission flags (%s)", param);

  ret = GetNamedSecurityInfo(path, scheme->type,
          DACL_SECURITY_INFORMATION,
          NULL, NULL, &pOldAcl, NULL, NULL);
  if (ret != ERROR_SUCCESS)
    ABORT_d("Cannot read access control list. Error code: %d", ret);

  BuildExplicitAccessWithName(&access, _T(""), permissions, (ACCESS_MODE)mode, 
    scheme->defaultInheritance);

  access.Trustee.TrusteeForm = (TRUSTEE_FORM)trusteeForm;
  access.Trustee.ptstrName = trusteeName;
  if (noinherit)
    access.grfInheritance = NO_INHERITANCE;

  ret = SetEntriesInAcl(1, &access, pOldAcl, &pNewAcl);
  if (ret != ERROR_SUCCESS)
    ABORT_d("Cannot build new access control list. Error code: %d", ret);

  ret = SetNamedSecurityInfo(path, scheme->type,
          DACL_SECURITY_INFORMATION,
          NULL, NULL, pNewAcl, NULL);
  if (ret != ERROR_SUCCESS)
    ABORT_d("Cannot apply new access control list. Error code: %d", ret);

cleanup:
  if (NULL != pNewAcl)
    LocalFree(pNewAcl);
  if (NULL != pOldAcl)
    LocalFree(pOldAcl);

  LocalFree(trusteeName);
  LocalFree(param);
}
开发者ID:FelixBucket,项目名称:ToontownFritzServer,代码行数:59,代码来源:AccessControl.cpp

示例8: DialogProc

BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
  int i, size;
  static HFONT font;
  switch (uMsg) {
  	case WM_INITDIALOG:
      for (i = langs_num - 1; i >= 0; i--) {
        SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)langs[i].name);
      }
      SetDlgItemText(hwndDlg, IDC_TEXT, g_wndtext);
      SetWindowText(hwndDlg, g_wndtitle);
      SendDlgItemMessage(hwndDlg, IDC_APPICON, STM_SETICON, (LPARAM)LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(103)), 0);
      for (i = 0; i < langs_num; i++) {
        if (!lstrcmp(langs[i].id, getuservariable(INST_LANG))) {
          SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_SETCURSEL, langs_num-i-1, 0);
          break;
        }
      }
      if (dofont && !popstring(temp))
      {
        size = myatoi(temp);
        if (!popstring(temp)) {
          LOGFONT f = {0,};
          if (lstrcmp(temp, "MS Shell Dlg")) {
            f.lfHeight = -MulDiv(size, GetDeviceCaps(GetDC(hwndDlg), LOGPIXELSY), 72);
            lstrcpy(f.lfFaceName, temp);
            font = CreateFontIndirect(&f);
            SendMessage(hwndDlg, WM_SETFONT, (WPARAM)font, 1);
            SendDlgItemMessage(hwndDlg, IDOK, WM_SETFONT, (WPARAM)font, 1);
            SendDlgItemMessage(hwndDlg, IDCANCEL, WM_SETFONT, (WPARAM)font, 1);
            SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, WM_SETFONT, (WPARAM)font, 1);
            SendDlgItemMessage(hwndDlg, IDC_TEXT, WM_SETFONT, (WPARAM)font, 1);
          }
        }
      }
      ShowWindow(hwndDlg, SW_SHOW);
      break;
    case WM_COMMAND:
      switch (LOWORD(wParam)) {
      	case IDOK:
          pushstring(langs[langs_num-SendDlgItemMessage(hwndDlg, IDC_LANGUAGE, CB_GETCURSEL, 0, 0)-1].id);
          EndDialog(hwndDlg, 0);
          break;
        case IDCANCEL:
          pushstring("cancel");
          EndDialog(hwndDlg, 1);
          break;
      }
      break;
    case WM_CLOSE:
      if (font) DeleteObject(font);
      pushstring("cancel");
      EndDialog(hwndDlg, 1);
      break;
    default:
      return 0;
  }
  return 1;
}
开发者ID:kichik,项目名称:nsis-1,代码行数:59,代码来源:LangDLL.c

示例9: __declspec

extern "C" void __declspec(dllexport) Sound(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) {
  DWORD flags = SND_FILENAME|SND_NODEFAULT;
  g_stacktop=stacktop;
  popstring(temp);
  if (lstrcmp(temp, "/WAIT"))
    flags |= SND_ASYNC;
  else
    popstring(temp);
  PlaySound(temp, 0, flags);
}
开发者ID:kichik,项目名称:nsis-1,代码行数:10,代码来源:BgImage.cpp

示例10: __declspec

extern "C" void __declspec(dllexport) Set(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop)
{
  g_stringsize = string_size;
  g_stacktop   = stacktop;
  g_variables  = variables;

  {
    IPropertyStore *m_pps = NULL;
    WCHAR wszPath[MAX_PATH];
    WCHAR wszAppID[MAX_PATH];
    TCHAR szPath[MAX_PATH];
    TCHAR szAppID[MAX_PATH];
    bool success = false;

    ZeroMemory(wszPath, sizeof(wszPath));
    ZeroMemory(wszAppID, sizeof(wszAppID));
    ZeroMemory(szPath, sizeof(szPath));
    ZeroMemory(szAppID, sizeof(szAppID));

    popstring(szPath, MAX_PATH);
    popstring(szAppID, MAX_PATH);

#if !defined(UNICODE)
    MultiByteToWideChar(CP_ACP, 0, szPath, -1, wszPath, MAX_PATH);
    MultiByteToWideChar(CP_ACP, 0, szAppID, -1, wszAppID, MAX_PATH);
#else
    wcscpy(wszPath, szPath);
    wcscpy(wszAppID, szAppID);
#endif

    ::CoInitialize(NULL);

    if (SUCCEEDED(SHGetPropertyStoreFromParsingName(wszPath, NULL, GPS_READWRITE, IID_PPV_ARGS(&m_pps))))
    {
      PROPVARIANT propvar;
      if (SUCCEEDED(InitPropVariantFromString(wszAppID, &propvar)))
      {
        if (SUCCEEDED(m_pps->SetValue(PKEY_AppUserModel_ID, propvar)))
        {
          if (SUCCEEDED(m_pps->Commit()))
          {
            success = true;
          }
        }
      }
    }

    if (m_pps != NULL)
      m_pps->Release();

    CoUninitialize();

    pushstring(success == true ? TEXT("0") : TEXT("-1"), MAX_PATH);
  }
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:55,代码来源:Set.cpp

示例11: __declspec

void __declspec(dllexport) CalculateSha512Sum(HWND hwndParent, int string_size,
	TCHAR *variables, stack_t **stacktop, extra_parameters *extra)
{
	int i;
	TCHAR filename[1024];
	Sha512Context context;
	HANDLE file;
	char buffer[512];
	char comp[1024];
	DWORD bytesread;
	SHA512_HASH sha512;
	int compout;
	EXDLL_INIT();
	popstring(filename);
	popstring(comp);
	Sha512Initialise(&context);
	file = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
		OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
	if (!file)
	{
		filename[0] = '0';
		filename[1] = 0;
		pushstring(comp);
		pushstring(filename);
		return;
	}
	while (1)
	{
		ReadFile(file, buffer, 512, &bytesread, NULL);
		if (!bytesread) break;
		Sha512Update(&context, buffer, bytesread);
		if (bytesread < 512) break;
	}
	Sha512Finalise(&context, &sha512);
	CloseHandle(file);
	for (i = 0; i < (512 / 8); i++)
	{
		buffer[i * 2] = hexdigit(sha512.bytes[i] >> 4);
		buffer[(i * 2) + 1] = hexdigit(sha512.bytes[i] & 0xF);
	}
	buffer[512 / 4] = 0;
	compout = memcmp(buffer, comp, 128);
	if (compout)
	{
		filename[0] = '0';
	}
	else
	{
		filename[0] = '1';
	}
	filename[1] = 0;
	pushstring(comp);
	pushstring(filename);
}
开发者ID:if15b006,项目名称:dxgl,代码行数:54,代码来源:sha512-nsis.c

示例12: __declspec

void __declspec(dllexport) SetUserData(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra)
{
  HWND hwCtl;
  struct nsControl* ctl;

  // get info from stack

  hwCtl = (HWND) popint();

  if (!IsWindow(hwCtl))
  {
    popint(); // remove user data from stack
    return;
  }

  // get descriptor

  ctl = GetControl(hwCtl);

  if (ctl == NULL)
    return;

  // set user data

  popstring(ctl->userData, USERDATA_SIZE);
}
开发者ID:kichik,项目名称:nsis-1,代码行数:26,代码来源:nsDialogs.c

示例13: __declspec

extern "C" void __declspec(dllexport) CreateMediaCenterShortcut( HWND hwndParent,
																  int string_size,
																  char *variables,
																  stack_t **stacktop)
{
	EXDLL_INIT();

	char *cBinPath = NULL;
	cBinPath = (char*)GlobalAlloc(GPTR, string_size);
	popstring( cBinPath );

	char shortcutLink[MAX_PATH];
	sprintf( shortcutLink, "\"%s\" -media", cBinPath );

	HRESULT hr = CoInitialize(NULL);
	char *mediaCenterPath = (char*)GlobalAlloc(GPTR, string_size);
	hr = SHGetFolderPathA( NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, mediaCenterPath );

	char shortcutPath[MAX_PATH];
	char filename[MAX_PATH];
	sprintf( shortcutPath, "%s\\Media Center Programs\\Darwinia", mediaCenterPath );
	sprintf( filename, "%s\\darwinia.lnk", shortcutPath );

	CreateLink( cBinPath, shortcutPath, filename, "", "-mediacenter" );
}
开发者ID:gene9,项目名称:Darwinia-and-Multiwinia-Source-Code,代码行数:25,代码来源:GESetup.cpp

示例14: __declspec

void __declspec(dllexport) GetFileMD5(HWND hwndParent, int string_size, 
                                      TCHAR *variables, stack_t **stacktop) {
  g_hwndParent=hwndParent;

  EXDLL_INIT();

  {
    TCHAR filename[MAX_PATH];
    char md5_string[33];
    HANDLE hFile;
    md5_byte_t digest[16];

    popstring(filename);
    
    hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
                                        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
    if (hFile == INVALID_HANDLE_VALUE) {
      //pushstring("ERROR: Unable to open file for MD5 calculation");
      pushstring(_T(""));
      return;
    }

    if (!FileMD5(hFile, digest)) {
      //pushstring("ERROR: Unable to calculate MD5");
      pushstring(_T(""));
    } else {
      md5_string[32] = '\0';
      MD5ToString(md5_string,digest);
      PushStringA(md5_string);
    }

    CloseHandle(hFile);
  }
}
开发者ID:151706061,项目名称:nsis-chinese,代码行数:34,代码来源:vpatchdll.c

示例15: __declspec

extern "C" void __declspec(dllexport) open_file_dialog(
  HWND hwndParent, 
  int string_size, 
	char *variables, 
  stack_t **stacktop)
{
	EXDLL_INIT();
		
	char szBuffer[1024]="";
	popstring(szBuffer);
	HWND hWndParent = (HWND)atoi(szBuffer);

	CFileDialog dlg(TRUE, _T("lic"), NULL, OFN_FILEMUSTEXIST, 
		_T("CrashFix License Files (*.lic)\0*.lic\0All Files (*.*)\0*.*\0\0"), hWndParent);
	INT_PTR nResult = dlg.DoModal(hWndParent);
	if(nResult==IDOK)
	{
		CStringA sFileName = dlg.m_szFileName;		
		pushstring(sFileName.GetBuffer());
	}
	else
	{
		pushstring("");
	}	
}
开发者ID:WarfaceKievTechOps,项目名称:crashfix,代码行数:25,代码来源:nsis_plugin.cpp


注:本文中的popstring函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。