version 1.1, 2013/08/27 05:51:50 |
version 1.3, 2013/08/28 05:33:02 |
|
|
/* $OpenXM$ */ |
/* $OpenXM: OpenXM_contrib2/windows/post-msg-asirgui/cmdasir.c,v 1.2 2013/08/27 07:41:22 ohara Exp $ */ |
// cl test.c user32.lib |
// cl test.c user32.lib |
|
|
#include <windows.h> |
#include <windows.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <stdio.h> |
#include <stdio.h> |
|
#include <string.h> |
|
#include <io.h> |
#include <process.h> |
#include <process.h> |
|
|
char *winname2uxname(char winname[]); |
char *winname2uxname(char winname[]); |
Line 11 FILE *findAsirHandler(); |
|
Line 13 FILE *findAsirHandler(); |
|
int sendFileName(HWND hnd,char uname[]); |
int sendFileName(HWND hnd,char uname[]); |
int loadFile(HWND hnd, char *uname); |
int loadFile(HWND hnd, char *uname); |
int terminateAsir(HWND hnd); |
int terminateAsir(HWND hnd); |
|
int hasTemp(char *s); |
|
int pasteFile(HWND hnd, char *uname); |
|
|
int main(int argc, char *argv[]) |
int main(int argc, char *argv[]) |
{ |
{ |
HWND hnd; |
HWND hnd; |
int i,j,c,ii; |
int c,ii; |
char *uname=NULL; |
char *uname=NULL; |
FILE *fp=NULL; |
FILE *fp=NULL; |
FILE *fp2=NULL; |
FILE *fp2=NULL; |
char snameWin[1024]; |
char snameWin[1024]; |
char *snameUx; |
char *snameUx; |
char *s; |
|
char msg[1024]; |
char msg[1024]; |
char cmd[1024]; |
char cmd[1024]; |
int paste_contents=0; |
int paste_contents=0; |
Line 121 char *winname2uxname(char wname[]) { |
|
Line 124 char *winname2uxname(char wname[]) { |
|
return(uname); |
return(uname); |
} |
} |
|
|
|
#if 0 |
int hasTemp(char *s) { |
int hasTemp(char *s) { |
int i,n; |
int i; |
n=strlen(s); |
size_t n=strlen(s); |
for (i=0; i<n-3; i++) { |
for (i=0; i<n-3; i++) { |
if (strncmp(&(s[i]),"Temp",4)==0) return(1); |
if (strncmp(&(s[i]),"Temp",4)==0) return(1); |
} |
} |
return(0); |
return(0); |
} |
} |
|
#endif |
|
|
|
int hasTemp(char *s) { |
|
return strstr(s, "Temp")!=NULL; |
|
} |
|
|
FILE *findAsirHandler() { |
FILE *findAsirHandler() { |
int i; |
int i; |
FILE *hnd = NULL; |
FILE *hnd = NULL; |
Line 163 int sendFileName_ascii(HWND hnd,char uname[]) { |
|
Line 172 int sendFileName_ascii(HWND hnd,char uname[]) { |
|
} |
} |
#endif |
#endif |
int sendFileName(HWND hnd,char uname[]) { |
int sendFileName(HWND hnd,char uname[]) { |
int j; |
size_t len=strlen(uname)+1; |
int len=strlen(uname)+1; |
|
HGLOBAL hMem; |
HGLOBAL hMem; |
LPTSTR pMem; |
LPTSTR pMem; |
if (!OpenClipboard(NULL) ) return 1; |
if (!OpenClipboard(NULL) ) return 1; |
Line 208 int pasteFile(HWND hnd, char *uname) { |
|
Line 216 int pasteFile(HWND hnd, char *uname) { |
|
sendFileName(hnd,s); |
sendFileName(hnd,s); |
free(s); |
free(s); |
PostMessage(hnd,WM_CHAR,0xa,1); |
PostMessage(hnd,WM_CHAR,0xa,1); |
|
return 0; |
} |
} |