December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmd As Int32) As Boolean Private Const HP_FAX_APP_TITLE As String = "HP Officejet 7200 series - Send Fax" Private Const SW_RESTORE As Long = 9 Public Const BM_CLICK As Long = &HF5 Private ipFax as IntPtr Sub Main() ' The Fax app window handle Dim parent As IntPtr = FindWindow(vbNullString, HP_FAX_APP_TITLE) ShowWindow(parent,SW_RESTORE) ' prior to this call, I have (according to Spy++ and Winspector Spy) found the correct handle, but for simplicity sake not ' showing the code. SendFax() End Sub Private Sub SendFax() ' this sendmessage returns a 0, whatever that means. SendMessage(ipFax, BM_CLICK, 0, 0) End Sub