help with msgplus windows please |
Author: |
Message: |
waynewilson2
Junior Member
Posts: 55
Joined: Oct 2007
|
O.P. help with msgplus windows please
i was just wondering, how, if its possible, to change the width of a Msg Plus Window that i created, i have a var assigned to it, it is 'tehwin' but the way i want to change the size of it is by using a button, or command.
Thanks In Advance
---Wayne Wilson
|
|
11-04-2007 07:43 PM |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
RE: help with msgplus windows please
Here you go! For more options, check out the SetWindowPos MSDN page.
code: function SetWindowSize(PlusWnd, Width, Height) {
var HWND_TOP = 0;
var SWP_NOMOVE = 0x2;
var SWP_NOZORDER = 0x4;
Interop.Call("user32", "SetWindowPos", PlusWnd.Handle, HWND_TOP, 0, 0, Width, Height, SWP_NOMOVE | SWP_NOZORDER);
}
//Usage
SetWindowSize(tehwin, 500, 400);
This post was edited on 11-10-2007 at 04:04 PM by Matti.
|
|
11-04-2007 07:57 PM |
|
|
waynewilson2
Junior Member
Posts: 55
Joined: Oct 2007
|
O.P. RE: help with msgplus windows please
thanks
code: if (PlusWnd.Height > 63){
SetWindowSize(tehwin, 533, 310);
}else{
SetWindowSize(tehwin, 533, 62.5);
}
can you tell me whats wrong with this? it changes to the smaller size, but not back to the bigger one...
|
|
11-04-2007 08:04 PM |
|
|
ArkaneArkade
Full Member
The One and Only
Posts: 193 Reputation: 5
39 / /
Joined: Mar 2007
|
RE: help with msgplus windows please
What do you mean "won't change back to the bigger"? Are you clicking the same button twice, or are you manually resizing the window before calling the function?
I'll guess that you need to change "if (PlusWnd.Height > 63)" to "if (PlusWnd.Height < 63)" (less than). Can't be sure this would be your issue but it's the only thing making sense to me immediately.
|
|
11-04-2007 09:39 PM |
|
|
waynewilson2
Junior Member
Posts: 55
Joined: Oct 2007
|
O.P. RE: help with msgplus windows please
quote: Originally posted by Leroux
What do you mean "won't change back to the bigger"? Are you clicking the same button twice, or are you manually resizing the window before calling the function?
I'll guess that you need to change "if (PlusWnd.Height > 63)" to "if (PlusWnd.Height < 63)" (less than). Can't be sure this would be your issue but it's the only thing making sense to me immediately.
nah, greater than is what its supposed to be, and each way it should resize the window...
the way it should be is
if (PlusWnd.Height > 63){
will check if the window is taller than 63px, and if it is then it will make it smaller, and otherwise, it returns it to the original size, but it will only call the else, it will not call the main portion...i tried changing the symbol to greater than, and still nothing...
|
|
11-05-2007 01:07 AM |
|
|
roflmao456
Skinning Contest Winner
Posts: 955 Reputation: 24
30 / /
Joined: Nov 2006
Status: Away
|
RE: help with msgplus windows please
i think you can use Interop for this; you can try using a variable (boolean) instead.
i think "PlusWnd.Height" only returns the height that's in the XML.
[quote]
Ultimatess6: What a noob mod
|
|
11-05-2007 01:11 AM |
|
|
ArkaneArkade
Full Member
The One and Only
Posts: 193 Reputation: 5
39 / /
Joined: Mar 2007
|
RE: help with msgplus windows please
OK, my mistake. As I said, I know nothing of windows.
It's not that you're stating (PlusWnd.Height > 63). PlusWnd is only really the identifier used in the MPLScripting docs, so shouldn't it be (tehwin.Height > 63).
That would explain why it always calls the else - if no window by name of PlusWnd exists, then none can be >/</= to anything, so it will always be the else clause.
|
|
11-05-2007 01:16 AM |
|
|
waynewilson2
Junior Member
Posts: 55
Joined: Oct 2007
|
O.P. RE: help with msgplus windows please
quote: Originally posted by Leroux
OK, my mistake. As I said, I know nothing of windows.
It's not that you're stating (PlusWnd.Height > 63). PlusWnd is only really the identifier used in the MPLScripting docs, so shouldn't it be (tehwin.Height > 63).
That would explain why it always calls the else - if no window by name of PlusWnd exists, then none can be >/</= to anything, so it will always be the else clause.
no...its in a control click function...tehwin and PlusWnd do the same thing
This post was edited on 11-05-2007 at 05:38 AM by waynewilson2.
|
|
11-05-2007 05:36 AM |
|
|
Volv
Skinning Contest Winner
Posts: 1233 Reputation: 31
35 / /
Joined: Oct 2004
|
RE: help with msgplus windows please
Err, I think the most important problem here is that Pluswnd.Height is not a valid property...
The only valid properties for a PlusWnd Object are
PlusWnd.Handle
PlusWnd.Visible
PlusWnd.WindowId
This post was edited on 11-05-2007 at 05:48 AM by Volv.
|
|
11-05-2007 05:47 AM |
|
|
waynewilson2
Junior Member
Posts: 55
Joined: Oct 2007
|
O.P. RE: help with msgplus windows please
ok, then how would i get the height of the window?? lol
|
|
11-05-2007 05:48 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|