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
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.