public
Description: Io programming language
Homepage: http://iolanguage.com
Clone URL: git://github.com/stevedekorte/io.git
Fix URL openOnDesktop for Windows
U-CUSTOMER2007\Customer (author)
Wed Apr 23 14:34:09 -0700 2008
commit  d3c8e82360888f7a95622e338c62ed4db4843777
tree    ba2f981f1119733c650fe63d50eba59a6692223a
parent  1ecf2d753795359257ada60a983cb33d197a13cc
...
352
353
354
355
 
 
 
356
357
358
...
352
353
354
 
355
356
357
358
359
360
0
@@ -352,7 +352,9 @@ page := URL clone setURL(\"http://www.google.com/\") fetch
0
     if(platform == "Mac OS/X") then(
0
       System system("open " .. quotedUrl)
0
     ) elseif(platform containsSeq("Windows")) then(
0
- System shellExecute(url)
0
+ result := System shellExecute("open", url)
0
+ result ifError(result := System shellExecute("open", System getEnvironmentVariable("programfiles") .. "\\Internet Explorer\\iexplore.exe", url))
0
+ return(result)
0
     ) else(
0
       // assume generic Unix?
0
       System system("open " .. quotedUrl)
...
46
47
48
49
 
50
51
52
...
46
47
48
 
49
50
51
52
0
@@ -46,7 +46,7 @@ IoError *IoError_new(void *state)
0
 
0
 /* ----------------------------------------------------------- */
0
 
0
-IoSeq *IoError_newWithMessageFormat_(void *state, const char *format, ...)
0
+IoError *IoError_newWithMessageFormat_(void *state, const char *format, ...)
0
 {
0
   IoSymbol *message;
0
   
...
136
137
138
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
141
142
...
136
137
138
 
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
0
@@ -136,7 +136,29 @@ IoObject *IoObject_errorNumber(IoObject *self, IoObject *locals, IoMessage *m)
0
 #include <shellapi.h>
0
 IoObject *IoObject_shellExecute(IoObject *self, IoObject *locals, IoMessage *m)
0
 {
0
- return IONUMBER((int) ShellExecute(NULL, "open", CSTRING(IoMessage_locals_symbolArgAt_(m, locals, 0)), NULL, NULL, SW_SHOWNORMAL));
0
+ LPCTSTR operation;
0
+ LPCTSTR file;
0
+ LPCTSTR parameters;
0
+ LPCTSTR directory;
0
+ int displayFlag;
0
+ int result;
0
+
0
+ operation = CSTRING(IoMessage_locals_symbolArgAt_(m, locals, 0));
0
+ file = CSTRING(IoMessage_locals_symbolArgAt_(m, locals, 1));
0
+ parameters = IoMessage_argCount(m) > 2 ? CSTRING(IoMessage_locals_symbolArgAt_(m, locals, 2)) : NULL;
0
+ directory = IoMessage_argCount(m) > 3 ? CSTRING(IoMessage_locals_symbolArgAt_(m, locals, 3)) : NULL;
0
+ displayFlag = IoMessage_argCount(m) > 4 ? IoMessage_locals_intArgAt_(m, locals, 4) : SW_SHOWNORMAL;
0
+
0
+ result = (int)ShellExecute(NULL, operation, file, parameters, directory, displayFlag);
0
+
0
+ if(result > 32)
0
+ {
0
+ return self;
0
+ }
0
+ else
0
+ {
0
+ return (IoObject *)IoError_newWithMessageFormat_(IOSTATE, "ShellExecute Error %i", result);
0
+ }
0
 }
0
 #endif
0
 

Comments

    No one has commented yet.