1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-13 06:43:42 +00:00

Updated windows privacy bar to set cursor on creation

This commit is contained in:
Bryan Roe
2022-02-09 19:44:48 -08:00
parent a626c63ee0
commit f13f01eef1
3 changed files with 14 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@@ -28,7 +28,8 @@ const FF_SWISS = (2 << 4); /* Variable stroke width, sans-serifed. */
const WM_NCLBUTTONDOWN = 0x00A1; const WM_NCLBUTTONDOWN = 0x00A1;
const HT_CAPTION = 2; const HT_CAPTION = 2;
const WM_WINDOWPOSCHANGING = 70; const WM_WINDOWPOSCHANGING = 70;
const CS_DROPSHADOW = 0x00020000; const IDC_ARROW = 32512;
const WM_COMMAND = 0x0111; const WM_COMMAND = 0x0111;
const WM_CTLCOLORSTATIC = 0x0138; const WM_CTLCOLORSTATIC = 0x0138;
@@ -228,7 +229,7 @@ function windows_notifybar_local(title)
{ {
window: window:
{ {
winstyles: MessagePump.WindowStyles.WS_VISIBLE | MessagePump.WindowStyles.WS_POPUP | MessagePump.WindowStyles.WS_BORDER | CS_DROPSHADOW, winstyles: MessagePump.WindowStyles.WS_VISIBLE | MessagePump.WindowStyles.WS_POPUP | MessagePump.WindowStyles.WS_BORDER,
x: start, y: m[i].top, left: m[i].left, right: m[i].right, width: barWidth, height: barHeight, title: this.notifybar.title, background: RGB(0, 54, 105) x: start, y: m[i].top, left: m[i].left, right: m[i].right, width: barWidth, height: barHeight, title: this.notifybar.title, background: RGB(0, 54, 105)
} }
}; };
@@ -270,11 +271,14 @@ function windows_notifybar_local(title)
h, // Parent window h, // Parent window
0xFFF1, // Child ID 0xFFF1, // Child ID
0, 0,
0).then(function (h) 0).then(function (c)
{ {
this.pump._addAsyncMethodCall(this.pump._user32.SendMessageW.async, [h, WM_SETFONT, this.pump.font, 1]); this.pump._addAsyncMethodCall(this.pump._user32.SendMessageW.async, [c, WM_SETFONT, this.pump.font, 1]);
}).parentPromise.pump = this; }).parentPromise.pump = this;
//this._addAsyncMethodCall(this._user32.SendMessageW.async, [h, WM_SETFONT, this.font, 1]).then(function (r) { console.log('FONT: ' + r.Val); }); this._addAsyncMethodCall(this._user32.LoadCursorA.async, [0, IDC_ARROW]).then(function (cs)
{
this.pump._addAsyncMethodCall(this.pump._user32.SetCursor.async, [cs]);
}).parentPromise.pump = this;
}); });
this.notifybar._pumps.peek().on('exit', function (h) this.notifybar._pumps.peek().on('exit', function (h)
{ {

View File

@@ -48,11 +48,13 @@ function WindowsMessagePump(options)
this._user32.CreateMethod('GetClientRect'); this._user32.CreateMethod('GetClientRect');
this._user32.CreateMethod('GetDC'); this._user32.CreateMethod('GetDC');
this._user32.CreateMethod('GetMessageW'); this._user32.CreateMethod('GetMessageW');
this._user32.CreateMethod('InvalidateRect') this._user32.CreateMethod('InvalidateRect');
this._user32.CreateMethod('LoadCursorA');
this._user32.CreateMethod('PostMessageA'); this._user32.CreateMethod('PostMessageA');
this._user32.CreateMethod('RegisterClassExW'); this._user32.CreateMethod('RegisterClassExW');
this._user32.CreateMethod('ReleaseCapture'); this._user32.CreateMethod('ReleaseCapture');
this._user32.CreateMethod('SendMessageW'); this._user32.CreateMethod('SendMessageW');
this._user32.CreateMethod('SetCursor');
this._user32.CreateMethod('SetWindowPos'); this._user32.CreateMethod('SetWindowPos');
this._user32.CreateMethod('SetWindowTextW'); this._user32.CreateMethod('SetWindowTextW');
this._user32.CreateMethod('ShowWindow'); this._user32.CreateMethod('ShowWindow');