zhrongzh
路人甲
路人甲
  • 注册日期2003-10-22
  • 发帖数153
  • QQ
  • 铜币99枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1759回复:1

改变Mapinfo Professional 的标题

楼主#
更多 发布于:2003-12-09 11:11
Include "MENU.DEF"
Include "MAPBASIC.DEF"

Declare Sub Main()
Declare Sub EndApp
Declare SUb SetMIWinText

Declare Function GetActiveWindow32 Lib "user32" Alias "GetActiveWindow" () As Integer
Declare Function GetActiveWindow Lib "User" () as SmallInt
Declare Function GetWindowText32 Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, lpString As String, ByVal cch As Integer) As Integer
Declare Function GetWindowText Lib "User" (ByVal hWnd As SmallInt, lpString As String, ByVal aInt As SmallInt) As SmallInt
Declare Function SetWindowText32 Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String) As Integer
Declare Sub      SetWindowText Lib "User" (ByVal hWnd As SmallInt, ByVal Str As String)

Sub Main()
Create Menu "&API Calls" As
"Set MapInfo Window Text..."    Calling SetMIWinText,
     "&Remove API Calls"             Calling EndApp
Alter Menu Bar Add "API Calls"
End Sub

Sub EndApp
Alter Menu Bar Remove "API Calls"
Terminate Application "AAAAAAA.mbx"
End Sub

Sub SetMIWinText
  Dim sWinText As String
  Dim n, nWin, nRes As Integer

  If SystemInfo(SYS_INFO_MIPLATFORM) = MIPLATFORM_WIN32 Then
    nWin = GetActiveWindow32()
  ElseIf SystemInfo(SYS_INFO_MIPLATFORM) = MIPLATFORM_WIN16 Then
    nWin = GetActiveWindow()
  End If
 
 Dialog Title "Enter Text"
    Control EditText  Position 8,12  Value sWinText Into sWinText Width 100
    Control OKButton
    Control CancelButton
  If CommandInfo(CMD_INFO_DLG_OK) Then
    If SystemInfo(SYS_INFO_MIPLATFORM) = MIPLATFORM_WIN32 Then
      n = SetWindowText32(nWin, sWinText)
    ElseIf SystemInfo(SYS_INFO_MIPLATFORM) = MIPLATFORM_WIN16 Then
      Call SetWindowText(nWin, sWinText)
    End If
  End If
End Sub
喜欢0 评分0
gis1117
  • 注册日期
  • 发帖数
  • QQ
  • 铜币
  • 威望
  • 贡献值
  • 银元
1楼#
发布于:2003-12-09 15:24
oh,yeah,能说明下就更好了
举报 回复(0) 喜欢(0)     评分
echo2003
点子王
点子王
  • 注册日期2003-07-28
  • 发帖数2453
  • QQ76947571
  • 铜币5473枚
  • 威望1点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
2楼#
发布于:2003-12-09 17:08
没有注释的程序,称不上是好的程序!
举报 回复(0) 喜欢(0)     评分
游客

返回顶部