This commit is contained in:
Vadim Lopatin 2017-08-14 10:05:55 +03:00
parent 5b96e81d1e
commit e58f2a1abe
3 changed files with 23 additions and 14 deletions

View File

@ -713,6 +713,11 @@ alias currentDir = std.file.getcwd;
return path[0 .. lastSlash + 1];
}
/// Returns current executable path and file name
@property string exeFilename() {
return thisExePath();
}
/**
Returns application data directory

View File

@ -1505,8 +1505,10 @@ version (Windows) {
return result;
}
/// split command line arg list; prepend with executable file name
string[] splitCmdLine(string line) {
string[] res;
res ~= exeFilename();
int start = 0;
bool insideQuotes = false;
for (int i = 0; i <= line.length; i++) {

View File

@ -276,11 +276,11 @@ class Win32Window : Window {
if (flags & WindowFlag.Fullscreen) {
// fullscreen
x = screenRc.left;
y = screenRc.top;
_dx = screenRc.width;
_dy = screenRc.height;
ws = WS_POPUP;
x = screenRc.left;
y = screenRc.top;
_dx = screenRc.width;
_dy = screenRc.height;
ws = WS_POPUP;
}
@ -366,16 +366,16 @@ class Win32Window : Window {
if (_hwnd) {
hMonitor = MonitorFromWindow(_hwnd, MONITOR_DEFAULTTONEAREST);
} else {
hMonitor = MonitorFromPoint(POINT(0,0), MONITOR_DEFAULTTOPRIMARY);
hMonitor = MonitorFromPoint(POINT(0,0), MONITOR_DEFAULTTOPRIMARY);
}
GetMonitorInfo(hMonitor,
&monitor_info);
Rect res;
res.left = monitor_info.rcMonitor.left;
res.top = monitor_info.rcMonitor.top;
res.right = monitor_info.rcMonitor.right;
res.bottom = monitor_info.rcMonitor.bottom;
return res;
&monitor_info);
Rect res;
res.left = monitor_info.rcMonitor.left;
res.top = monitor_info.rcMonitor.top;
res.right = monitor_info.rcMonitor.right;
res.bottom = monitor_info.rcMonitor.bottom;
return res;
}
~this() {
@ -1087,7 +1087,7 @@ class Win32Platform : Platform {
for (uint i = 0; i + 1 < _windowList.length; i++) {
if (_windowList[i] is w) {
for (uint j = i + 1; j < _windowList.length; j++) {
if (_windowList[j].flags & WindowFlag.Modal && _windowList[j]._windowState != WindowState.hidden)
if (_windowList[j].flags & WindowFlag.Modal && _windowList[j].windowState != WindowState.hidden)
return true;
}
return false;
@ -1205,8 +1205,10 @@ int DLANGUIWinMain(void* hInstance, void* hPrevInstance,
return result;
}
/// split command line arg list; prepend with executable file name
string[] splitCmdLine(string line) {
string[] res;
res ~= exeFilename();
int start = 0;
bool insideQuotes = false;
for (int i = 0; i <= line.length; i++) {