-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added exe cpp file to generate standalone
- Loading branch information
1 parent
5234be2
commit 6f52482
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,5 @@ Temporary Items | |
*.pyc | ||
__pycache__ | ||
ips.csv | ||
/releases | ||
/standalone/DHCPGui.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
// based on https://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx | ||
|
||
#include <windows.h> | ||
#include <stdio.h> | ||
#include <tchar.h> | ||
|
||
int _tmain( int argc, TCHAR *argv[] ) | ||
{ | ||
STARTUPINFO si; | ||
PROCESS_INFORMATION pi; | ||
TCHAR command[] = "\"Portable Python 3\\App\\pythonw.exe\" \"dhcpgui.pyw\""; | ||
TCHAR directory[] = "server"; | ||
|
||
ZeroMemory( &si, sizeof(si) ); | ||
si.cb = sizeof(si); | ||
ZeroMemory( &pi, sizeof(pi) ); | ||
|
||
// Start the child process. | ||
if( !CreateProcess( NULL, // No module name (use command line) | ||
command, // Command line | ||
NULL, // Process handle not inheritable | ||
NULL, // Thread handle not inheritable | ||
FALSE, // Set handle inheritance to FALSE | ||
0, // No creation flags | ||
NULL, // Use parent's environment block | ||
directory, // Use parent's starting directory | ||
&si, // Pointer to STARTUPINFO structure | ||
&pi ) // Pointer to PROCESS_INFORMATION structure | ||
) | ||
{ | ||
printf( "CreateProcess failed (%d).\n", GetLastError() ); | ||
return 1; | ||
} | ||
/* | ||
// Wait until child process exits. | ||
WaitForSingleObject( pi.hProcess, INFINITE ); | ||
// Close process and thread handles. | ||
CloseHandle( pi.hProcess ); | ||
CloseHandle( pi.hThread ); | ||
*/ | ||
return 0; | ||
} |