What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [help] Windows widths and heights...

Pages: (3): « First « 1 [ 2 ] 3 » Last »
[help] Windows widths and heights...
Author: Message:
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: [help] Windows widths and heights...
Ok, I'm adding 6 to the width and 32 to the height, which counter-acts the borders.  Seems to work great!

One other thing...  is there a way to convert dialog units to pixels, and back again?
01-06-2010 07:31 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: [help] Windows widths and heights...
I think it's all dependant on screen resolution and some other factors, including font from what I've read, but the topics mostly all relate to VB and C++...

EDIT: http://www.freebasic.net/forum/viewtopic.php?p=83555 <-- Might Help

This post was edited on 01-06-2010 at 07:40 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
01-06-2010 07:37 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: [help] Windows widths and heights...
Looks a bit confusing...  :S

quote:
Originally posted by MSDN
MapDialogRect: http://msdn2.microsoft.com/en-us/library/ms645502.aspx

The MapDialogRect function converts the specified dialog box units to screen units (pixels). The function replaces the coordinates in the specified RECT structure with the converted coordinates, which allows the structure to be used to create a dialog box or position a control within a dialog box.
I need to convert pixels to dialog units, not dialog units to pixels...
01-06-2010 07:55 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: [help] Windows widths and heights...
I didn't check, but I thought maybe you could reverse the process?

If this is to convert the units from pixels (from the window) to dialog units (inside the xml), then can't you just force the measurements in pixels? I know it's probably not quite what you want, but it's guaranteed to look the same and will save having to add functions or classes to figure it out for you.
<Eljay> "Problems encountered: shit blew up" :zippy:
01-06-2010 08:13 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: [help] Windows widths and heights...
That's what I've thought about doing.  The user can always change it to dialog units if they want, but if they use the builder, then it'll have to be in pixels.  :P

[Image: attachment.php?pid=983973]

That's what the builder will look like.  ;)  Suggestions welcome.

Edit: I really doubt the feasibility of this, but I'm going to ask anyway.  Is there a way of working out the co-ordinates of a rectangle drawn with the mouse onto a Plus! window?  Would this need a certain control?  If this isn't possible, would I be able to record two clicks (one for the top-left, one for the bottom-right)?

.png File Attachment: Interface Writer - Window Builder.png (29.83 KB)
This file has been downloaded 300 time(s).

This post was edited on 01-06-2010 at 09:08 PM by whiz.
01-06-2010 08:53 PM
Profile E-Mail PM Find Quote Report
T-PO
Junior Member
**


Posts: 60
– / Male / Flag
Joined: Jun 2004
RE: [help] Windows widths and heights...
Looks great!

Keep up the good work!

T-PO
01-06-2010 09:17 PM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: [help] Windows widths and heights...
quote:
Originally posted by whiz
Edit: I really doubt the feasibility of this, but I'm going to ask anyway.  Is there a way of working out the co-ordinates of a rectangle drawn with the mouse onto a Plus! window?  Would this need a certain control?  If this isn't possible, would I be able to record two clicks (one for the top-left, one for the bottom-right)?

It certainly should be possible. You would have to deal with drawing the rectangle yourself using GDI or whatever, but you would basically just have to handle mouse messages (WM_LBUTTONDOWN,WM_MOUSEMOVE,etc.) and redraw the rectangle each time. Unfortunately there's no magic control that does this for you that I know of, but it shouldn't be too hard to implement.
01-06-2010 09:31 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: [help] Windows widths and heights...
Hmm...  :)  I'll have to think about it.  For now, I need some sleep and preparation for exams.  ;)
01-06-2010 09:49 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [help] Windows widths and heights... (solved for now)
quote:
Originally posted by whiz
Edit: I really doubt the feasibility of this, but I'm going to ask anyway.  Is there a way of working out the co-ordinates of a rectangle drawn with the mouse onto a Plus! window?  Would this need a certain control?  If this isn't possible, would I be able to record two clicks (one for the top-left, one for the bottom-right)?
Screenshot Sender has this capability for sending the Selected Area.

Have a look at the code: http://beta.screenshotsender.com/code/WindowHandl...ectArea_handler.js
And the Window: http://beta.screenshotsender.com/code/Languages/en/SelectArea.xml

Cheers!
01-06-2010 11:10 PM
Profile E-Mail PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: [help] Windows widths and heights... (solved for now)
quote:
Originally posted by matty
Screenshot Sender has this capability for sending the Selected Area.

Have a look at the code: http://beta.screenshotsender.com/code/WindowHandl...ectArea_handler.js
And the Window: http://beta.screenshotsender.com/code/Languages/en/SelectArea.xml

Cheers!
I've had a look at the two files, but I'm not exactly sure how to implement it.  How would I be able to draw a rectangle over a Plus! window, and get the left/top/width/height values in relation to that window?
01-07-2010 02:04 PM
Profile E-Mail PM Find Quote Report
Pages: (3): « First « 1 [ 2 ] 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On