Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created January 16, 2012 14:37
Show Gist options
  • Save springmeyer/1621154 to your computer and use it in GitHub Desktop.
Save springmeyer/1621154 to your computer and use it in GitHub Desktop.
first stab at a nodew.exe (like pythonw.exe)
diff --git a/common.gypi b/common.gypi
diff --git a/node.gyp b/node.gyp
index f9bc8ca..fe2f821 100644
--- a/node.gyp
+++ b/node.gyp
@@ -196,10 +196,17 @@
],
}],
],
- 'msvs-settings': {
+ 'msvs_settings': {
'VCLinkerTool': {
- 'SubSystem': 1, # /subsystem:console
+ 'target_conditions': [
+ ['_type=="executable"', {
+ 'SubSystem': 2, # console executable
+ }],
+ ],
},
+ 'VCResourceCompilerTool' : {
+ 'PreprocessorDefinitions': ["_WINDOWS"]
+ },
},
},
diff --git a/src/node_main.cc b/src/node_main.cc
index 3100149..d69de83 100644
--- a/src/node_main.cc
+++ b/src/node_main.cc
@@ -21,6 +21,14 @@
#include <node.h>
-int main(int argc, char *argv[]) {
- return node::Start(argc, argv);
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+int WINAPI WinMain(
+ HINSTANCE hInstance, /* handle to current instance */
+ HINSTANCE hPrevInstance, /* handle to previous instance */
+ LPTSTR lpCmdLine, /* pointer to command line */
+ int nCmdShow /* show state of window */
+){
+ return node::Start(__argc, __argv);
}
@graphnode
Copy link

Did it work?

@springmeyer
Copy link
Author

@graphnode - no, not yet, node just exists without doing anything. hoping to get back to it late this week or next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment