aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Watters <kevinwatters@gmail.com>2019-04-06 08:41:56 -0400
committerKevin Watters <kevinwatters@gmail.com>2019-04-06 08:41:56 -0400
commit6ab471ff871ce4e7f8f6790e540d80c616b608e3 (patch)
tree8b64b5a4a683342fec8d963fc85f130e40c96625
parent957e1e1f07db06ff241bc43be737e1b9becf5fdd (diff)
parent155b138aa43421489f37f6e76393d1fb8e56480e (diff)
Merge branch 'master' of github.com:odin-lang/Odin
-rw-r--r--core/sys/win32/helpers.odin29
1 files changed, 29 insertions, 0 deletions
diff --git a/core/sys/win32/helpers.odin b/core/sys/win32/helpers.odin
new file mode 100644
index 000000000..fd8b7c3c5
--- /dev/null
+++ b/core/sys/win32/helpers.odin
@@ -0,0 +1,29 @@
+// +build windows
+package win32
+
+import "core:strings";
+
+call_external_process :: proc(program, command_line: string) -> bool {
+ si := Startup_Info{ cb=size_of(Startup_Info) };
+ pi := Process_Information{};
+
+ return cast(bool)create_process_w(
+ utf8_to_wstring(program),
+ utf8_to_wstring(command_line),
+ nil,
+ nil,
+ Bool(false),
+ u32(0x10),
+ nil,
+ nil,
+ &si,
+ &pi
+ );
+}
+
+open_website :: proc(url: string) -> bool {
+ p :: "C:\\Windows\\System32\\cmd.exe";
+ arg := []string{"/C", "start", url};
+ args := strings.join(arg, " ", context.temp_allocator);
+ return call_external_process(p, args);
+} \ No newline at end of file