comparison src/os_mswin.c @ 844:d3bbb5dd3913 v7.0f02

updated for version 7.0f02
author vimboss
date Thu, 27 Apr 2006 00:02:13 +0000
parents 9f279ebda751
children cc03a79fdbb9
comparison
equal deleted inserted replaced
843:9f279ebda751 844:d3bbb5dd3913
2693 CW_USEDEFAULT, CW_USEDEFAULT, 2693 CW_USEDEFAULT, CW_USEDEFAULT,
2694 100, 100, NULL, NULL, 2694 100, 100, NULL, NULL,
2695 s_hinst, NULL); 2695 s_hinst, NULL);
2696 } 2696 }
2697 2697
2698 /* Used by serverSendToVim() to find an alternate server name. */
2699 static char_u *altname_buf_ptr = NULL;
2700
2698 /* 2701 /*
2699 * Get the title of the window "hwnd", which is the Vim server name, in 2702 * Get the title of the window "hwnd", which is the Vim server name, in
2700 * "name[namelen]" and return the length. 2703 * "name[namelen]" and return the length.
2701 * Returns zero if window "hwnd" is not a Vim server. 2704 * Returns zero if window "hwnd" is not a Vim server.
2702 */ 2705 */
2728 /* If this is the server we're looking for, return its HWND */ 2731 /* If this is the server we're looking for, return its HWND */
2729 if (STRICMP(server, id->name) == 0) 2732 if (STRICMP(server, id->name) == 0)
2730 { 2733 {
2731 id->hwnd = hwnd; 2734 id->hwnd = hwnd;
2732 return FALSE; 2735 return FALSE;
2736 }
2737
2738 /* If we are looking for an alternate server, remember this name. */
2739 if (altname_buf_ptr != NULL
2740 && STRNICMP(server, id->name, STRLEN(id->name)) == 0
2741 && vim_isdigit(server[STRLEN(id->name)]))
2742 {
2743 STRCPY(altname_buf_ptr, server);
2744 altname_buf_ptr = NULL; /* don't use another name */
2733 } 2745 }
2734 2746
2735 /* Otherwise, keep looking */ 2747 /* Otherwise, keep looking */
2736 return TRUE; 2748 return TRUE;
2737 } 2749 }
2869 char_u **result; /* Result of eval'ed expression */ 2881 char_u **result; /* Result of eval'ed expression */
2870 void *ptarget; /* HWND of server */ 2882 void *ptarget; /* HWND of server */
2871 int asExpr; /* Expression or keys? */ 2883 int asExpr; /* Expression or keys? */
2872 int silent; /* don't complain about no server */ 2884 int silent; /* don't complain about no server */
2873 { 2885 {
2874 HWND target = findServer(name); 2886 HWND target;
2875 COPYDATASTRUCT data; 2887 COPYDATASTRUCT data;
2876 char_u *retval = NULL; 2888 char_u *retval = NULL;
2877 int retcode = 0; 2889 int retcode = 0;
2890 char_u altname_buf[MAX_PATH];
2891
2892 /* If the server name does not end in a digit then we look for an
2893 * alternate name. e.g. when "name" is GVIM the we may find GVIM2. */
2894 if (STRLEN(name) > 1 && !vim_isdigit(name[STRLEN(name) - 1]))
2895 altname_buf_ptr = altname_buf;
2896 altname_buf[0] = NUL;
2897 target = findServer(name);
2898 altname_buf_ptr = NULL;
2899 if (target == 0 && altname_buf[0] != NUL)
2900 /* Use another server name we found. */
2901 target = findServer(altname_buf);
2878 2902
2879 if (target == 0) 2903 if (target == 0)
2880 { 2904 {
2881 if (!silent) 2905 if (!silent)
2882 EMSG2(_(e_noserver), name); 2906 EMSG2(_(e_noserver), name);