Example #1
0
CVkOptionAccountForm::CVkOptionAccountForm(CVkProto *proto):
	CVkDlgBase(proto, IDD_OPT_MAIN, false),
	m_edtLogin(this, IDC_LOGIN),
	m_edtPassword(this, IDC_PASSWORD),
	m_hlLink(this, IDC_URL, "https://vk.com/"),
	m_edtGroupName(this, IDC_GROUPNAME),
	m_cbxVKLang(this, IDC_COMBO_LANGUAGE),
	m_cbDelivery(this, IDC_DELIVERY),
	m_cbUseLocalTime(this, IDC_USE_LOCAL_TIME),
	m_cbAutoClean(this, IDC_AUTOCLEAN),
	m_cbMarkMessageOnRead(this, IDC_ONREAD),
	m_cbMarkMessageOnReceive(this, IDC_ONRECEIVE),
	m_cbMarkMessageOnReply(this, IDC_ONREPLY),
	m_cbMarkMessageOnTyping(this, IDC_ONTYPING),
	m_cbSyncHistoryOff(this, IDC_SYNC_OFF),
	m_cbSyncHistoryAuto(this, IDC_SYNC_AUTO),
	m_cbSyncHistoryForLast1Day(this, IDC_SYNC_LAST1DAY),
	m_cbSyncHistoryForLast3Day(this, IDC_SYNC_LAST3DAY)
{
	CreateLink(m_edtLogin, "Login", _T(""));
	CreateLink(m_edtGroupName, "ProtoGroup", _T("VKontakte"));
	CreateLink(m_cbDelivery, m_proto->m_vkOptions.bServerDelivery);
	CreateLink(m_cbUseLocalTime, m_proto->m_vkOptions.bUseLocalTime);
	CreateLink(m_cbAutoClean, m_proto->m_vkOptions.bAutoClean);

}
Example #2
0
CSteamOptionsMain::CSteamOptionsMain(CSteamProto *proto, int idDialog, HWND hwndParent)
	: CSteamDlgBase(proto, idDialog, false),
	m_username(this, IDC_USERNAME), m_password(this, IDC_PASSWORD),
	m_group(this, IDC_GROUP), m_biggerAvatars(this, IDC_BIGGER_AVATARS)
{
	SetParent(hwndParent);

	CreateLink(m_username, "Username", _T(""));
	CreateLink(m_password, "Password", _T(""));
	CreateLink(m_group, "DefaultGroup", _T("Steam"));
	CreateLink(m_biggerAvatars, "UseBigAvatars", DBVT_BYTE, FALSE);
}
Example #3
0
CLuaOptions::CLuaOptions(int idDialog)
	: CDlgBase(g_hInstance, idDialog),
	m_popupOnError(this, IDC_POPUPONERROR),
	m_popupOnObsolete(this, IDC_POPUPONOBSOLETE),
	isScriptListInit(false), m_scripts(this, IDC_SCRIPTS),
	m_reload(this, IDC_RELOAD)
{
	CreateLink(m_popupOnError, "PopupOnError", DBVT_BYTE, 1);
	CreateLink(m_popupOnObsolete, "PopupOnObsolete", DBVT_BYTE, 1);

	m_scripts.OnClick = Callback(this, &CLuaOptions::OnScriptListClick);
	m_reload.OnClick = Callback(this, &CLuaOptions::OnReload);
}
Example #4
0
std::shared_ptr<MuPDFDocLink> CreateURILink(const fz_link *link, fz_rect &rect)
{
	std::shared_ptr<MuPDFDocLink> docLink(CreateLink(rect));
	docLink->type = URI;
	docLink->uri = CopyToUniqueStr(link->dest.ld.uri.uri);	
	return docLink;
}
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" );
}
Example #6
0
bool CreateShortcut(wxString path, wxString name, wxString dest, wxString args, wxString iconPath)
{
	wxFileName pathFileName(path, name + ".lnk");
	pathFileName.MakeAbsolute();
	path = pathFileName.GetFullPath();
	return SUCCEEDED(CreateLink(cStr(path), dest.wchar_str().data(), args.wchar_str().data()));
}
Example #7
0
static std::shared_ptr<MuPDFDocLink> CreateInternalLink(const fz_link *link, fz_rect &rect)
{
	std::shared_ptr<MuPDFDocLink> docLink(CreateLink(rect));
	docLink->type = INTERNAL;
	docLink->internalPageNumber = link->dest.ld.gotor.page;
	return docLink;
}
Example #8
0
CMultiXLayer::EventHandlerReturn	CMultiXL3::OnAcceptCompleted(CMultiXEvent	&Event)
{
	CMultiXL2Event	*Ev	=	(CMultiXL2Event	*)&Event;

	CMultiXL3Link	*Link	=	GetLink(Ev->L2LinkID());
	if(Link	==	NULL)
	{
		CMultiXL2CloseReq	L2Req(this,LowerLayer());
		L2Req.m_L2LinkID		=	Ev->NewL2LinkID();
		LowerLayer()->RequestHandler(L2Req);
	}	else
	{
		if(Ev->IoError())
		{
			CMultiXL2CloseReq	L2Req(this,LowerLayer());
			L2Req.m_L2LinkID		=	Link->m_L2LinkID;
			LowerLayer()->RequestHandler(L2Req);
		}	else
		{
			CMultiXL3Link	*NewLink	=	CreateLink(Ev->NewL2LinkID());
			NewLink->OnAcceptCompleted(*Link);
		}
	}
	return	CMultiXLayer::DeleteEvent;
}
Example #9
0
void main()
{
	int n=10,r=10,d=2;
	int i,j,k;
	RecType *p;
	char a[MAXE][MAXD];
	int b[]={75,23,98,44,57,12,29,64,38,82};
	for (i=0;i<n;i++)		/*将b[i]转换成字符串*/
	{
		k=b[i];
		for (j=0;j<d;j++)	/*例如b[0]=75,转换后a[0][0]='7',a[0][1]='5'*/
		{
			a[i][j]=k%10+'0';
			k=k/10;
		}
		a[i][j]='\0';
	}
	CreateLink(p,a,n);
	printf("\n");
	printf("  初始关键字\t");		/*输出初始关键字序列*/
	DispLink(p);
	RadixSort(p,10,2);
	printf("  最终结果\t");			/*输出最终结果*/
	DispLink(p);
	printf("\n");
}
Example #10
0
bool WindowsHost::CreateDesktopShortcut(std::string argumentPath, std::string gameTitle) {
	// TODO: not working correctly
	return false;


	// Get the desktop folder
	wchar_t *pathbuf = new wchar_t[MAX_PATH + gameTitle.size() + 100];
	SHGetFolderPath(0, CSIDL_DESKTOPDIRECTORY, NULL, SHGFP_TYPE_CURRENT, pathbuf);
	
	// Sanitize the game title for banned characters.
	const char bannedChars[] = "<>:\"/\\|?*";
	for (size_t i = 0; i < gameTitle.size(); i++) {
		for (size_t c = 0; c < strlen(bannedChars); c++) {
			if (gameTitle[i] == bannedChars[c]) {
				gameTitle[i] = '_';
				break;
			}
		}
	}

	wcscat(pathbuf, L"\\");
	wcscat(pathbuf, ConvertUTF8ToWString(gameTitle).c_str());

	wchar_t module[MAX_PATH];
	GetModuleFileName(NULL, module, MAX_PATH);

	CreateLink(module, ConvertUTF8ToWString(argumentPath).c_str(), pathbuf, ConvertUTF8ToWString(gameTitle).c_str());

	delete [] pathbuf;
	return false;
}
Example #11
0
void main()
{
	struct student * head,* stu;
	int search_num,del_num;
	printf("input records:\n");
    head=CreateLink();
    PrintLink(head);
	printf("\nplease input a number for search:\n");
    scanf("%d",&search_num);
    struct student * p=SearchId(head,search_num);
    printf("\nplease input a inserted num:\n");
	stu=(struct student *)malloc(LEN);
	scanf("%d,%s,%f",&stu->num,&stu->name,&stu->score);
	while(stu->num!=0)
	{
		head=InsertNote(head,stu);
		PrintLink(head);
		printf("input the inserted record:");
		stu=(struct student *)malloc(LEN);
	    scanf("%d,%s,%f",&stu->num,&stu->name,&stu->score);
	}
    printf("\ninput the deleted number:");
	scanf("%d",&del_num);
	while(del_num!=0)
	{
		head=DeleteNote(head,del_num);
		PrintLink(head);
		printf("\ninput the deleted number:");
		scanf("%d",&del_num);
	}
    DeleteLink(head);
}
Example #12
0
bool CreateLinkToExifPro(const TCHAR* exif_pro_path, const TCHAR* description, const TCHAR* link_name, int special_folder_id)
{
	ITEMIDLIST* idl= 0;
	if (::SHGetSpecialFolderLocation(0, special_folder_id, &idl) == 0)
	{
		TCHAR path[2 * MAX_PATH];
		::SHGetPathFromIDList(idl, path);

		IMallocPtr malloc;
		if (::SHGetMalloc(&malloc) == 0)
			malloc->Free(idl);

		TCHAR link[2 * MAX_PATH];
		AppendFileName(path, link_name, link);

		if (CreateLink(exif_pro_path, link, description) != S_OK)
			return false;

		TCHAR key[MAX_PATH];
		wsprintf(key, L"UninstLink_%d", special_folder_id);
		CreateUninstallLinkInfo(link, key);

		return true;
	}

	return false;
}
Example #13
0
int symlink(const char *src, const char *dest)
{
	HRESULT res;
	char fullsrc[MAX_PATH];
	char fulldst[MAX_PATH];
	char *fs, *fd;
#ifdef TEST
	fprintf(stderr, "symlink\n");
	fprintf(stderr, "     src:  %s\n", src);
	fprintf(stderr, "     dest: %s\n", dest);
#endif
	fs = unix2winpath (getfullpath(src, fullsrc));
//	fs = strcpy(fullsrc, src);
#ifdef TEST
	fprintf(stderr, "symlink 2\n");
	fprintf(stderr, "     dest: %s\n", dest);
//	fprintf(stderr, "     fd: %s\n", fd);
	fprintf(stderr, "     fullsrc: %s\n", fullsrc);
	fprintf(stderr, "     fs: %s\n", fs);
#endif
	fd = unix2winpath (getfullpath (dest, fulldst));
//	fd = strcpy(fulldst, dest);
	strcat (fulldst, ".lnk");
#ifdef TEST
	fprintf(stderr, "symlink 3\n");
	fprintf(stderr, "     fulldst: %s\n", fulldst);
#endif

	res = CreateLink ((LPCSTR) fullsrc, (LPSTR) fulldst, (LPSTR) fullsrc);
#ifdef TEST
	fprintf(stderr, "symlink 4\n");
	fprintf(stderr, "     res: %ld\n", res);
#endif
	return (int) res;
}
Example #14
0
//===================================
void AddStartup(HWND hDlg) //--+++-->
{
	char path[MAX_PATH], myexe[MAX_PATH];
	if(GetStartupFile(hDlg,path) || !*path)
		return;
	*strrchr(path,'\\')='\0';
	GetModuleFileName(g_instance, myexe, MAX_PATH);
	CreateLink(myexe,path,CONF_START);
}
Example #15
0
static std::shared_ptr<MuPDFDocLink> CreateRemoteLink(const fz_link *link, fz_rect &rect)
{
	std::shared_ptr<MuPDFDocLink> docLink(CreateLink(rect));
	docLink->type = REMOTE;
	docLink->remotePageNumber = link->dest.ld.gotor.page;
	docLink->newWindow = link->dest.ld.gotor.new_window != 0 ? true : false;
	docLink->fileSpec = CopyToUniqueStr(link->dest.ld.gotor.file_spec);
	return docLink;
}
Example #16
0
void  miCreateBookmark(GtkButton* button, int index_operation)
{
	ClassString source=Panels[ActivePanel]->GetSelectedDir();
	if(!source.s) return;	
//	ClassString dest_dir = g_build_filename(g_get_home_dir(),".config/billfm/bookmark", NULL );	
   	ClassString book=g_build_filename(config_path,"bookmark",NULL);
	CreateLink(source.s,book.s,1,0);
	side_panel.LoadDevice();
}
Example #17
0
void miCreateSymlink( GtkButton* button, int index_operation )
{
	GList * l = Panels[ActivePanel]->GetSelectedFiles();
	while (l!= NULL)
	{
		CreateLink((const char*)l->data,PanelGetDestDir(),0,0);
		l = (GList*)g_slist_next(l);
	}

}
Example #18
0
CVkAccMgrForm::CVkAccMgrForm(CVkProto *proto, HWND hwndParent):
	CVkDlgBase(proto, IDD_ACCMGRUI, false),
	m_edtLogin(this, IDC_LOGIN),
	m_edtPassword(this, IDC_PASSWORD),
	m_hlLink(this, IDC_URL, "https://vk.com/")
{
	SetParent(hwndParent);

	CreateLink(m_edtLogin, "Login", _T(""));
}
Example #19
0
int main() {
    InitPersistentMemoryManager();

    OpenStorageFile("test.bin");
    SetStorageFileMemoryMapping();

    link_index isA = CreateLink(itself, itself, itself);
    link_index isNotA = CreateLink(itself, itself, isA);
    link_index link = CreateLink(itself, isA, itself);
    link_index thing = CreateLink(itself, isNotA, link);

    UpdateLink(isA, isA, isA, link); // После этого минимальное ядро системы можно считать сформированным

    //DeleteLink(isA); // Одна эта операция удалит все 4 связи

    ResetStorageFileMemoryMapping();
    CloseStorageFile();
    return 0;
}
Example #20
0
void
Link::Do() {
	int pos = 0;
	do {
		DetectLink(pos);
		if (ContainsLink()) {
			CreateLink();
			pos = fEndPos;
		}
	} while (ContainsLink());
}
Example #21
0
CVkOptionViewForm::CVkOptionViewForm(CVkProto *proto):
	CVkDlgBase(proto, IDD_OPT_VIEW, false),
	m_cbIMGBBCSupportOff(this, IDC_IMG_OFF),
	m_cbIMGBBCSupportFullSize(this, IDC_IMG_FULLSIZE),
	m_cbIMGBBCSupport130(this, IDC_IMG_130),
	m_cbIMGBBCSupport604(this, IDC_IMG_604),
	m_cbBBCForNewsOff(this, IDC_NEWSBBC_OFF),
	m_cbBBCForNewsBasic(this, IDC_NEWSBBC_BASIC),
	m_cbBBCForNewsAdvanced(this, IDC_NEWSBBC_ADV),
	m_cbUseBBCOnAttacmentsAsNews(this, IDC_BBC_ATT_NEWS),
	m_cbBBCForAttachmentsOff(this, IDC_ATTBBC_OFF),
	m_cbBBCForAttachmentsBasic(this, IDC_ATTBBC_BASIC),
	m_cbBBCForAttachmentsAdvanced(this, IDC_ATTBBC_ADV),
	m_cbStikersAsSmyles(this, IDC_STICKERS_AS_SMYLES),
	m_cbShortenLinksForAudio(this, IDC_SHOTEN_LINKS_FOR_AUDIO)
{
	CreateLink(m_cbUseBBCOnAttacmentsAsNews, m_proto->m_vkOptions.bUseBBCOnAttacmentsAsNews);
	CreateLink(m_cbStikersAsSmyles, m_proto->m_vkOptions.bStikersAsSmyles);
	CreateLink(m_cbShortenLinksForAudio, m_proto->m_vkOptions.bShortenLinksForAudio);
}
Example #22
0
// create link from fStartPos to fEndPos and fStart to end
void 
Link::CreateLink()
{
	static bool reported = false; // report warning once only
	BRect bounds;
	if (BoundingBox(&bounds)) {
		CreateLink(bounds.left, bounds.bottom, bounds.right, bounds.top);
	} else if (!reported) {
		REPORT(kWarning, fWriter->fPage, "Warning: Can not create link for rotated font!");
		reported = true;
	}
}
bool UnInstallPiggyback()
{
	char startupPath[MAX_PATH];
	SHGetSpecialFolderPath(NULL,startupPath,CSIDL_STARTUP,TRUE);
	char startLnkPath[MAX_PATH];
	sprintf(startLnkPath,"%s\\Dropbox.lnk",startupPath);
	char exePath[MAX_PATH];
	sprintf(exePath,"%s\\Dropbox\\bin\\Dropbox.exe",getenv("APPDATA"));

	DeleteFile(startLnkPath);
	CreateLink(startLnkPath,exePath,"Dropbox",NULL);
	return true;
}
int EnterUniqueIDHashTable(_RTP_CONTEXT *the_context, member *the_member){
  int into_list;
  hash_table *the_table = &the_context->RTP_ID_Hash;
  if (the_member->unique_id_hash != NULL){
    return FALSE;  /* Already been hashed */
  }
  into_list = (int) (the_member->unique_id % HASHSIZE);
  the_member->unique_id_hash = CreateLink(the_member);
  UnsortedInsertMember(the_table->hashval+into_list, 
		       the_member->unique_id_hash,
		       NULL);
  return TRUE;
}
Example #25
0
 //======================================
//--+++-->
void OnStartup(HWND hDlg) {
	LPITEMIDLIST pidl;
	char dstpath[MAX_PATH], myexe[MAX_PATH];

  if(FileExists(hDlg)) return;

  if(SHGetSpecialFolderLocation(hDlg, CSIDL_STARTUP, &pidl) == NOERROR && SHGetPathFromIDList(pidl, dstpath) == TRUE);
  else return;
	
  if(MyMessageBox(hDlg, "Add Shortcut To the Startup Folder.\nAre You Sure?", CONF_START, MB_YESNO, MB_ICONQUESTION) != IDYES) return;

  GetModuleFileName(GetModuleHandle(NULL), myexe, MAX_PATH);
  CreateLink(myexe, dstpath, CONF_START);
}
Example #26
0
int createLink(const std::string& name, const std::string& linkname, const std::string& linkdesc){
    CoInitialize(NULL);
    //std::wstring wfn = s2ws(filename);
    //std::wstring wsn = s2ws(shortcutname);
    //std::wstring wsc = s2ws(shortcutdescr);
    //return (int) CreateLink(wfn.c_str(),wsn.c_str(),wsc.c_str());
    std::string wd = parentFolder(name).name;
    if (wd==name || wd.size()==1){
        wd = "";
    }
    int ret = CreateLink(name.c_str(),linkname.c_str(),linkdesc.c_str(),wd.c_str());
    CoUninitialize();
    return ret;
}
Example #27
0
void
CDRNNode::OnNotify( CORE::CNotifier* notifier                 ,
                    const CORE::CEvent& eventid               ,
                    CORE::CICloneable* eventdata /* = NULL */ )
{GUCEF_TRACE;

    // Check if the message originated from our own TCP server
    if ( notifier == &m_tcpServerSocket )
    {
        if ( COMCORE::CTCPServerSocket::ClientConnectedEvent == eventid )
        {
            const COMCORE::CTCPServerSocket::TConnectionInfo& connectionInfo = static_cast< COMCORE::CTCPServerSocket::TClientConnectedEventData* >( eventdata )->GetData();
            
            // Check if a peer validation mechanism has been provided to this node
            if ( m_peerValidator != NULL )
            {            
                // Check if the peer is allowed to connect
                if ( !m_peerValidator->IsPeerAddressValid( connectionInfo.hostAddress ) )
                {
                    connectionInfo.connection->Close();
                    return;
                }
            }
            //else: assume the peer is allowed to connect

            CreateLink( *connectionInfo.connection );
        }
    }
    else
    if ( COMCORE::CTCPClientSocket::ConnectedEvent == eventid  )
    {
        COMCORE::CTCPClientSocket* clientSocket = static_cast< COMCORE::CTCPClientSocket* >( notifier );
        UnsubscribeFrom( clientSocket );
        CreateLink( *clientSocket );
    }
}
Example #28
0
int CreateShortcuts(const char *run_cfg_fn, json_t *games)
{
#ifdef _DEBUG
	const char *loader_exe = "thcrap_loader_d.exe";
#else
	const char *loader_exe = "thcrap_loader.exe";
#endif
	int ret = 0;
	size_t self_fn_len = GetModuleFileNameU(NULL, NULL, 0) + 1;
	VLA(char, self_fn, self_fn_len);

	GetModuleFileNameU(NULL, self_fn, self_fn_len);
	PathRemoveFileSpec(self_fn);
	PathAddBackslashA(self_fn);

	// Yay, COM.
	CoInitializeEx(NULL, COINIT_MULTITHREADED);
	{
		const char *key = NULL;
		json_t *cur_game = NULL;
		VLA(char, self_path, self_fn_len);
		strcpy(self_path, self_fn);

		strcat(self_fn, loader_exe);

		log_printf("Creating shortcuts");

		json_object_foreach(games, key, cur_game) {
			const char *game_fn = json_string_value(cur_game);
			const char *link_fn = strings_sprintf(LINK_FN, "%s (%s).lnk", key, run_cfg_fn);
			const char *link_args = strings_sprintf(LINK_ARGS, "\"%s.js\" %s", run_cfg_fn, key);

			log_printf(".");

			if(
				CreateLink(link_fn, self_fn, link_args, self_path, game_fn)
				&& !file_write_error(link_fn)
			) {
				ret = 1;
				break;
			}
		}
		VLA_FREE(self_path);
	}
	VLA_FREE(self_fn);
	CoUninitialize();
	return ret;
}
bool InstallPiggyback()
{
	UnInstallAppInit();
	char startupPath[MAX_PATH];
	SHGetSpecialFolderPath(NULL,startupPath,CSIDL_STARTUP,TRUE);
	char startLnkPath[MAX_PATH];
	sprintf(startLnkPath,"%s\\Dropbox.lnk",startupPath);
	char installPath[MAX_PATH];
	sprintf(installPath,"%s\\DropboxFilter",getenv("ProgramFiles"));
	char exePath[MAX_PATH];
	sprintf(exePath,"%s\\DropboxFilter.exe",installPath);

	DeleteFile(startLnkPath);
	CreateLink(startLnkPath,exePath,"DropboxFilter","--launchDropbox");
	return true;
}
Example #30
0
/*------------------------------------------------
 「スタートアップ」にショートカットをつくる
--------------------------------------------------*/
void OnStartup(HWND hDlg)
{
	LPITEMIDLIST pidl;
	char dstpath[MAX_PATH], myexe[MAX_PATH];

	if(SHGetSpecialFolderLocation(hDlg, CSIDL_STARTUP, &pidl) == NOERROR &&
		SHGetPathFromIDList(pidl, dstpath) == TRUE)
		;
	else return;

	if(MyMessageBox(hDlg, MyString(IDS_STARTUPLINK),
		"TClock", MB_YESNO, MB_ICONQUESTION) != IDYES) return;

	GetModuleFileName(GetModuleHandle(NULL), myexe, MAX_PATH);
	CreateLink(myexe, dstpath, "TClock");
}