Skip to content

Commit

Permalink
added exe cpp file to generate standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
niccokunzmann committed Mar 26, 2015
1 parent 5234be2 commit 6f52482
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ Temporary Items
*.pyc
__pycache__
ips.csv
/releases
/standalone/DHCPGui.exe
44 changes: 44 additions & 0 deletions standalone/DHCPGui.cpp
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;
}

0 comments on commit 6f52482

Please sign in to comment.