Re: MI Snap option and MapBasic

2000-09-26 Thread Anssi Joutsiniemi

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]




RE: MI Snap option and MapBasic

2000-09-25 Thread Thomas Brix Lyng

Hi Kirk

This is a 32 bit DLL for MapInfo that allows you to pass key strokes from
Mapbasic as if typed by the user. (Amongst other uses this provides a
solution to turning snap on from mapbasic). 

 -- I won't send the .ZIP file to Mapinfo-L so mail me if you wan't
 it. ---
 
I downloaded it from the list some time ago. I haven't tried it but it
should do the job.

Regards

Thomas Brix Lyng
Frederikshavn Munincipal Administration
Denmark


 --
 Fra:  [EMAIL PROTECTED][SMTP:[EMAIL PROTECTED]]
 Sendt:22. september 2000 21:52
 Til:  [EMAIL PROTECTED]
 Emne: 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]