Kirk,

>From version 550 on Set Window statement have had option to turn snap mode on/off. 
>See Reference for that.

For earlier versions you need to work around with WinAPI. The trick is to send message 
directly to MapperWindow via SendMessage API to simulate keyboard input. See the 
following code.

The only problem here is that different localizations use different codes to for snap 
mode. For example Finnish version uses 'P' instead of  'S' to turn the snap mode. 
Jacques Paris have collected enermous amount of information on localizations, maybe 
this data is one he already have documented to help you out.

Anssi

'***********************
Include "mapbasic.def"

Define WM_CHAR  &H102

Declare Sub Main
Declare Function SendMessageBynum Lib "user32" Alias "SendMessageA"
    (ByVal hwnd As Integer, ByVal wMsg As Integer,
     ByVal wParam As Integer, ByVal lParam As Integer) As Integer

Sub Main
 Dim MIWnd, iDummy, iwP as Integer


 iwP = Asc("S") 'UK version
' iwP = Asc("P") 'Finnish localization

 If WindowInfo(FrontWindow(),WIN_INFO_TYPE) = WIN_MAPPER Then
  MIWnd = WindowInfo(FrontWindow(),WIN_INFO_WND)
  iDummy = SendMessageBynum(MIWnd,WM_CHAR,iwP,1)
 End If 

End Sub
'***********************



----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 22, 2000 8:06 PM
Subject: MI Snap option and MapBasic


> Hello again,
> 
> I thought this would be simple but I can not seem to find a wat to toggle a
> window's snap option on and off using MapBasic.  Would someone tell me if
> this is possible?
> 
> Kirk Regular
> www.gds.nf.net
> ----------------------------------------------------------------------
> 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]

Reply via email to