You are here: PSPad forum > Bug report / Hlášení chyb > Re: Using Multiple Displays

Re: Using Multiple Displays

Goto Page: Previous1 2 3 Next

#11 Re: Using Multiple Displays

Posted by: Freeman | Date: 2015-03-24 20:44 | IP: IP Logged

pspad:
I will find any second monitor and I will test it.

We can ask kamuz to test compiled sample.

Options: Reply | Quote | Up ^


#12 Re: Using Multiple Displays

Posted by: johnbentley | Date: 2015-06-27 13:24 | IP: IP Logged

On my triple monitor setup I can report the same problem as the OP.

I've tested the compiled sample. I keep the "Move application button" box ticked, but sometimes the taskbar icon correctly moves with the open application (to the next monitor); sometimes it doesn't.

I'll call my monitors "1", "2", "3" from left to right. With windows explorer open on 2 (the middle) I open the appliation (the compiled sample):

* Bad: The application opens on 3, with taskbar icon on 3. The application/taskbar correspondence is correct, but it shouldn't open on a different monitor.
* Good: Drag the application to 2. Icon correctly follows to 2.
* Good: Drag the application to 1. Icon correctly follow to 1.
* Bad: Drag the application to 2. Icon remains on 3.
* Bad: Drag the application to 3. Icon moves to 2.

I repeat variations of the above. The pattern is deteriministic, but I can never get the icon back to 3 (after the initial opening).

A very strange bug indeed. I'm on build 2665.

Edit: With the "Move application button" box unticked the taskbar icon correctly stays where it was last left.

Edited 2 time(s). Last edit at 2015-06-27 13:27 by johnbentley.

Options: Reply | Quote | Up ^


#13 Re: Using Multiple Displays

Posted by: bkneepkens | Date: 2016-06-20 09:22 | IP: IP Logged

I experienced the same problem with a Delphi application. The solution proved to be as follows.
I don't know what Delphi version was used to build PSPad, but this is what I did in Delphi 7:

1. In FormCreate, hide the VCL-controlled taskbar button and assign an handler for the OnActivate event:


procedure TfrmMain.FormCreate(Sender: TObject);
var
windowLong: integer;

begin
Application.OnActivate := OnApplicationActivate;

// Hide the taskbar button for the zero-size Application window.
// We'll let Windows deal with taskbar buttons and not the VCL.
windowLong := ((GetWindowLong(Application.Handle, GWL_EXSTYLE) and (not WS_EX_APPWINDOW)) or WS_EX_TOOLWINDOW);
SetWindowLong(Application.Handle, GWL_EXSTYLE, windowLong);
end;

2. Implement the OnActivate event as follows:


procedure TfrmMain.OnApplicationActivate(Sender: TObject);
begin;
// Set the focus to the currently visible form. This may not always
// happen automatically because we're bypassing part of the VCL.
try
Screen.ActiveForm.SetFocus();
except
end;
end;

3. Override CreateParams to show a taskbar button:


procedure CreateParams(var Params: TCreateParams); override;

procedure TfrmMain.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);

// Show a taskbar button
params.ExStyle := (params.ExStyle or WS_EX_APPWINDOW);

// Set the desktop as the window's parent.
// Without this the taskbar button will still appear, but then it
// won't move to Windows 10's second taskbar if the window is moved
// to a secondary monitor. (This is probably also true for Windows 8,
// but I haven't been able to test that).
params.WndParent := GetDesktopWindow();
end;

4. Handle the WM_SYSCOMMAND message to support minimize/restore:


procedure WMSysCommand(var msg: TWmSysCommand); message WM_SYSCOMMAND;

procedure TfrmMain.WMSysCommand(var msg: TWmSysCommand);
begin
// Bypass the VCL and let the Windows API
// handle minimize/restore functionality.
case (msg.CmdType and $FFF0) of
SC_MINIMIZE: begin
ShowWindow(Self.Handle, SW_MINIMIZE);
msg.Result := 0;
end;
SC_RESTORE : begin
ShowWindow(Self.Handle, SW_RESTORE);
msg.Result := 0;
end;
else begin
inherited;
end;
end;
end;

Hmm, the forum removes indentation, even within code tags... oh well. Hope this helps smiling smiley

Options: Reply | Quote | Up ^


#14 Re: Using Multiple Displays

Posted by: pspad | Date: 2016-06-20 09:51 | IP: IP Logged

Thank you. I will test it.
Don't be worry about indentation. I got all forum adds into mail, there is it indented.

Options: Reply | Quote | Up ^


#15 Re: Using Multiple Displays

Posted by: PGomersall | Date: 2017-01-26 14:57 | IP: IP Logged

Jan,
In current development build 2743 situation is still the same. Have you any update on finding a fix to this?
Pete

Options: Reply | Quote | Up ^


#16 Re: Using Multiple Displays

Posted by: PGomersall | Date: 2017-01-26 15:21 | IP: IP Logged

Jan,
Just a follow up; maybe it is partially fixed? If I move PSPad to new monitor, nothing happens to its icon; it stays on taskbar of originating monitor. However, after the move, if I minimize PSPad then it shows on correct taskbar.

Options: Reply | Quote | Up ^


#17 Re: Using Multiple Displays

Posted by: pspad | Date: 2017-01-26 18:11 | IP: IP Logged

PSPad uses old Delphi version now. I need to move it to new IDE version. It will be better than spend lot of time finding solution.

Options: Reply | Quote | Up ^


#18 Re: Using Multiple Displays

Posted by: Maya21 | Date: 2017-01-27 09:16 | IP: IP Logged

sasumner:
I noticed a multiple displays issue recently regarding what appears on which screen; maybe it is a known issue. I am using pspad 4.5.9 (2512).

At my desk I have a two-external-monitor setup with a notebook PC in a docking station; I keep the notebook's lid closed so that its screen isn't used. I run pspad's main window on the secondary monitor (the one without the Win7 taskbar at the bottom). This is the normal situation and all is good.

When I undock my PC and use it with its single screen, pspad's main window will "move" there after undocking (this is correct). When I do a replace the find/replace dialog comes up fine and I enter my search and this crazy bulk review replace text, but if I check the Prompt on Replace checkbox (as I usually do), the prompt dialog that should show upon each find match is not visible. I can still press Y or N (or Esc) for each found match, so I think the prompt dialog is actually there, it is just still on the second screen (which isn't there at this point).

This happen to me one (although i came back from a party)

--
phenq-avis.com

Options: Reply | Quote | Up ^


#19 Re: Using Multiple Displays

Posted by: CieraBrier | Date: 2017-01-31 08:04 | IP: IP Logged

pspad:
Freeman:
Jan, I wrote small sample, but cannot test it, because I have only one monitor:

Thank you. I will find any second monitor and I will test it.

MainForm to hidden Application.Handle, on every Application.MainForm move.

Options: Reply | Quote | Up ^


#20 Re: Using Multiple Displays

Posted by: CieraBrier | Date: 2017-01-31 23:11 | IP: IP Logged

Freeman:
kamuz:
Open PSPad and move main window to secondary monitor and icon on taskbar does not follows window.

Jan, I wrote small sample, but cannot test it, because I have only one monitor:

TMainForm = class(TForm)
protected
procedure WMWindowPosChanged(var Msg: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED;
end;

procedure TMainForm.WMWindowPosChanged(var Msg: TWMWindowPosChanged);
begin
inherited;
if not (csLoading in ComponentState) then
with Msg.WindowPos^ do
MoveWindow(Application.Handle, x, y, cx, cy, True);
end;

Edited 1 time(s). Last edit at 2017-02-06 07:34 by pspad.

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3 Next





Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR