mirror of
https://github.com/typeable/wai.git
synced 2025-01-06 05:25:53 +03:00
13 lines
329 B
C
13 lines
329 B
C
#include <windows.h>
|
|
#include <shellapi.h>
|
|
#include <stdio.h>
|
|
|
|
void launch(int port, char *s)
|
|
{
|
|
int len = 8 + strlen("http://127.0.0.1:") + strlen(s);
|
|
char *buff = malloc(len);
|
|
_snprintf(buff, len, "http://127.0.0.1:%d/%s", port, s);
|
|
ShellExecute(NULL, "open", buff, NULL, NULL, SW_SHOWNORMAL);
|
|
free(buff);
|
|
}
|