summaryrefslogtreecommitdiff
path: root/src/windows/draw.c
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2022-11-06 16:28:17 -0800
committerLouie S <louie@example.com>2022-11-06 16:28:17 -0800
commit2c29b6a5145a4c44cbef03197db64cd2d7decd15 (patch)
treedb4129c7efad3b79ee1b21c5ed4ef634044de5eb /src/windows/draw.c
parent77c6ef13a0599fdb9966a3a7dc967e204b77c7d5 (diff)
Basic functionality for using autotools over basic Makefile
Diffstat (limited to 'src/windows/draw.c')
-rw-r--r--src/windows/draw.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/windows/draw.c b/src/windows/draw.c
new file mode 100644
index 0000000..28bef68
--- /dev/null
+++ b/src/windows/draw.c
@@ -0,0 +1,44 @@
+#include <stdbool.h>
+#include <windows.h>
+
+#include "../include/draw.h"
+#include "../include/entry.h"
+#include "../include/group.h"
+
+void launch(){
+ char *program = get_gprog(g[g_hover]);
+ char *flags = get_gflags(g[g_hover]);
+ char *path = get_epath(e[e_hover]);
+ bool quotes = get_gquotes(g[g_hover]);
+ char file[BUF_LEN];
+ char params[BUF_LEN];
+
+ file[0] = '\0';
+
+ if(!(strcmp(program, "./"))){
+ strcat(file, "/C ");
+ strcat(file, "\"");
+ strcat(file, path);
+ strcat(file, "\"");
+ ShellExecute(NULL, NULL, "cmd.exe", file, NULL, SW_HIDE);
+ }
+
+ else{
+ if(quotes) strcat(file, "\"");
+ strcat(file, program);
+ if(quotes) strcat(file, "\"");
+
+ params[0] = '\0';
+ if(flags[0] != '\0'){
+ strcat(params, flags);
+ strcat(params, " ");
+ }
+ strcat(params, "\"");
+ strcat(params, path);
+ strcat(params, "\"");
+
+ ShellExecute(NULL, NULL, file, params, NULL, SW_SHOW);
+ }
+
+ return;
+}