回覆列表
  • 1 # iyrhf70

    將一條訊息投遞到指定視窗的訊息佇列第一個引數就是要投遞訊息的控制元件或視窗控制代碼~第二個是訊息常數Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Declare Function PostMessage& Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any)Dim hwd As LongPrivate Sub Command1_Click()Shell "notepad.exe", 1hwd = FindWindow(vbNullString, "無標題 - 記事本")End SubPrivate Sub Command2_Click()PostMessage hwd, &H10, 0, 0End SubPrivate Sub Form_Load()Command1.Caption = "開啟記事本"Command2.Caption = "關閉記事本"End Sub

  • 中秋節和大豐收的關聯?
  • 意氣自如的意思是什麼,出處是哪裡?