'以下添加到窗体中
PrivateDeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVallpClassNameAsString,ByVallpWindowNameAsString)AsLong
PrivateDeclareFunctionFlashWindowLib"user32"(ByValhwndAsLong,ByValbInvertAsLong)AsLong
PrivateDeclareFunctionSetWindowTextLib"user32"Alias"SetWindowTextA"(ByValhwndAsLong,ByVallpStringAsString)AsLong
'以下为按钮事件中
PrivateSubCommand1_Click()
DimlhWndAsLong'HoldsthehandleTothewindow
'获取到的窗体名称
lhWnd=FindWindow("Minesweeper","Minesweeper")
Text1.Text=lhWnd
IflhWnd<>0Then
'闪烁窗体
FlashWindowlhWnd,1
EndIf
IflhWnd<>0Then
'改变窗体标题
SetWindowTextlhWnd,"我改变了你的窗体的标题啦"
EndIf
EndSub