-#include <stdio.h>
#include <math.h>
+#include <windows.h>
-#define LOGFILE "log.txt"
+#define LOGFILE L"C:\\projects\\colon3wavtool\\log.txt"
static int log_args(int argc, char *argv[]);
int log_args(int argc, char *argv[])
{
- FILE *fp;
- fp = fopen(LOGFILE, "a");
- for (int i = 1; i < argc; i++) { //loop through argv[]
- char c;
- for (int n = 0; (c = argv[i][n]) != '\0'; n++) { //loop through each character
- putc(c, fp);
+ /* Doesnt work??
+ HANDLE hFile;
+
+ hFile = CreateFileW(
+ LOGFILE, //name of file (*wchar_t)
+ GENERIC_WRITE,
+ 0, NULL,
+ OPEN_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL
+ );
+
+ char *c = " ";
+ DWORD dwWritten;
+ for (int i = 1; i < argc; i++) {
+ for (int n = 0; (*c = argv[i][n]) != '\0'; n++) {
+ WriteFile(
+ hFile,
+ c,
+ 8,
+ &dwWritten,
+ NULL
+ );
};
- putc(' ', fp);
+ c = " ";
+ WriteFile(
+ hFile,
+ c,
+ 8,
+ &dwWritten,
+ NULL
+ );
};
- //fprintf(fp, "The tool has been CALLED!");
-
- putc('\n', fp);
- fclose(fp);
-
+ c = "\n";
+ WriteFile(
+ hFile,
+ c,
+ 8,
+ &dwWritten,
+ NULL
+ );
+ */
+
+
+ for (int i = 1; i < argc; i++) {
+ MessageBoxA(NULL, argv[i], "argument :3", MB_OK);
+ };
+
+
return 1;
};