Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multimonitor-Problem with TBXMDI when MainForm on secondary monitor #1

Open
plashenkov opened this issue Feb 10, 2014 · 0 comments
Open

Comments

@plashenkov
Copy link
Owner

Issue imported from Google Code:
https://code.google.com/p/tbxlib/issues/detail?id=3

Reported by bernd.ott [at] quantendrehung.de, Jan 30, 2013

You need at least two monitors.
put the primary monitor on left side.
the secondary monitor hast to be on right side and in a higher position in windows.

see screenshot

use an mdi application.
put tbxmdi on form.
put mainform on secondary monitor in maximized mode.
put mdichild in max. mode.
click mdi close button.

you get an exception:
Exception class: ERangeError
Exception address: 0064F929

Stack list, generated 30.01.2013 15:38:01
[0064F924] TBXMDI.TTBXMDIButtonsItem.ItemClick + $4C
[004033BE] System.ErrorAt + $16
[0064F924] TBXMDI.TTBXMDIButtonsItem.ItemClick + $4C
[005B1CC8] TB2Item.TTBCustomItem.Click + $A8
[005B1BA7] TB2Item.TTBCustomItem.ClickWndProc + $BB
[004303AC] Classes.StdWndProc + $14
[0049093C] Forms.TApplication.ProcessMessage + $FC
[00490976] Forms.TApplication.HandleMessage + $A
[00490C6B] Forms.TApplication.Run + $B3

mdiproblem


sorry, component is ttbxmdihandler


file tbxmdi fails at:
SendMessage(ChildForm.Handle, WM_SYSCOMMAND, Cmd, GetMessagePos);

GetMessagePos delivers a negative position.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx

maybe that parameter can be 0 or -1. but that has to be testet


My suggest patch:

Index: TBXMDI.pas
===================================================================
--- TBXMDI.pas  (revision 19)
+++ TBXMDI.pas  (working copy)
@@ -286,7 +286,7 @@
   begin
     Form := Application.MainForm.ActiveMDIChild;
     if Assigned(Form) then
-      SendMessage(Form.Handle, WM_SYSCOMMAND, TTBXCustomItem(Sender).Tag, GetMessagePos);
+      SendMessage(Form.Handle, WM_SYSCOMMAND, TTBXCustomItem(Sender).Tag, -1);
   end;
 end;

@@ -606,7 +606,7 @@
         Cmd := SC_CLOSE
       else
         Cmd := SC_MINIMIZE;
-      SendMessage(ChildForm.Handle, WM_SYSCOMMAND, Cmd, GetMessagePos);
+      SendMessage(ChildForm.Handle, WM_SYSCOMMAND, Cmd, -1);
     end;
   end;
 end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant