include "mapbasic.def" Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Integer, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Integer) As Integer declare sub main declare sub skraa_view declare sub skraa_exit Sub Main Create Menu "Skråfotos" as "Kig" Helpmsg "Åben skråfoto i browser" Calling skraa_view, "Afslut" Calling skraa_exit Alter Menu Bar Add "Skråfotos" End sub sub skraa_view Dim map_win_id,i,j As Integer map_win_id = FrontWindow() if windowinfo(map_win_id,WIN_INFO_TYPE)<>WIN_MAPPER then j=0 for i = 1 to NumWindows() if windowinfo(WindowID(i),WIN_INFO_TYPE)=WIN_MAPPER then j=j+1 end if next if j=1 then for i = 1 to NumWindows() if windowinfo(WindowID(i),WIN_INFO_TYPE)=WIN_MAPPER then map_win_id=WindowID(i) end if next end if end if if windowinfo(map_win_id,WIN_INFO_TYPE)<>WIN_MAPPER then note "Switch to a mapper window" else Dim hWnd, nRc As Integer Dim sOp, sFile As String Dim x, y as float set coordsys Earth Projection 1, 104 x = MapperInfo(map_win_id, MAPPER_INFO_CENTERX) y = MapperInfo(map_win_id, MAPPER_INFO_CENTERY) hWnd = WindowInfo(WIN_MAPINFO, WIN_INFO_WND) sOp = "open" sFile = "http://skraafoto.kortforsyningen.dk/oblivisionjsoff/index.aspx?project=Denmark&lon="+x+"&lat="+y nRc = ShellExecute(hWnd, sOp, sFile, "", "" , 0) end if end sub sub skraa_exit end program end sub