Re: MI MB: How do I query dialog position (Win API?)

2000-01-05 Thread Anssi Joutsiniemi

Richard,

To get the hwnd for MI Dialog you have to loop through all child windows of MI window 
and find the the MDIClient window (for example by using GetClassName API). Then loop 
again through child windows of MDIClient and one of those is your Dialog window.
(By the way by looping through child windows of this Dialogbox you are able to access 
all dialog controls which can be modified with SendMessage function.)

Let me know if you have problems with my explaination. Have fun.

Regards,
Anssi

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 04, 2000 3:06 PM
Subject: MI MB: How do I query dialog position (Win API?)


> Listers,
> 
> I have a MapBasic application that presents the user with a dialog when a
> custom toolbutton is used.  I want the user to be able to move this dialog
> before it is dismissed and have the dialog posted to that new position the
> next time the toolbutton is used.  I don't think there is a way to do this
> with MapBasic alone because although the 'Dialog' statement has the
> 'position' parameter to position the dialog when its posted, there's no way
> of querying the current position once the user has moved it.  If I'm wrong
> on this, please let me know!
> 
> I thought of using the 'GetWindowPlacement' and 'SetWindowPlacement' API
> functions to get around this MB shortcoming but these functions both require
> the Windows Hwnd of the dialog box and I cannot find a way to get it.  I've
> tried using the 'FindWindow' API function, passing the caption of my dialog
> as the second argument (and "" for the first), but it just returns zero to
> me.  I've also tried using the 'GetTopWindow' API function like this -
> 'GetTopWindow(WindowInfo(WIN_MAPINFO, WIN_INFO_WND))' but that returns the
> Hwnd of the top document window (a map window in my case) rather than the
> dialog.  I tried both of these from handlers invoked when the dialog command
> buttons are used - so the dialog is still present and (I had hoped) is the
> 'top' window with the focus.  Can anyone suggest how I might use either of
> these functions successfully, or suggest an alternative method?
> 
> Thanks for any help you can provide.
> 
> Richard Burkmar
> ICL
> [EMAIL PROTECTED]
> 
> --
> To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
> "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]



MI MB: How do I query dialog position (Win API?)

2000-01-04 Thread Richard . Burkmar

Listers,

I have a MapBasic application that presents the user with a dialog when a
custom toolbutton is used.  I want the user to be able to move this dialog
before it is dismissed and have the dialog posted to that new position the
next time the toolbutton is used.  I don't think there is a way to do this
with MapBasic alone because although the 'Dialog' statement has the
'position' parameter to position the dialog when its posted, there's no way
of querying the current position once the user has moved it.  If I'm wrong
on this, please let me know!

I thought of using the 'GetWindowPlacement' and 'SetWindowPlacement' API
functions to get around this MB shortcoming but these functions both require
the Windows Hwnd of the dialog box and I cannot find a way to get it.  I've
tried using the 'FindWindow' API function, passing the caption of my dialog
as the second argument (and "" for the first), but it just returns zero to
me.  I've also tried using the 'GetTopWindow' API function like this -
'GetTopWindow(WindowInfo(WIN_MAPINFO, WIN_INFO_WND))' but that returns the
Hwnd of the top document window (a map window in my case) rather than the
dialog.  I tried both of these from handlers invoked when the dialog command
buttons are used - so the dialog is still present and (I had hoped) is the
'top' window with the focus.  Can anyone suggest how I might use either of
these functions successfully, or suggest an alternative method?

Thanks for any help you can provide.

Richard Burkmar
ICL
[EMAIL PROTECTED]

--
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]