Link to home
Start Free TrialLog in
Avatar of jnsprad
jnspradFlag for United States of America

asked on

How do i obtain the text from the search bar that is located in syspro's quotation window.

Hello once again!

Im attempting to master a search query here with syspro, and without having any reference material Ive resorted to the web for help. Im Building a customized Pane, with the pane it pulls Quote num, jobs available, Quotation date, real wip value, and the number of items quoted. I got part of the view working, but what id like to setup is to be able to search for a specific quote number, or quotation date, or even by job Number. I see that Syspro already has a search bar at the top of the page, but im not sure how i would find out whats in it progmatically. is there a handle that is set with the value of the text box? or is it set to do something else and manually refresh all the panes with the data?
Avatar of SiddharthRout
SiddharthRout
Flag of India image

jnsprad: Hi. I haven't worked with Syspro but yes it is possible to get the handle for any window using VB. You need to use the API for that.

Logic
Use FindWindow API to get the handle of the window using it's caption.

Enumerate Child windows (even textbox is window) and get it's handle.

Sid
Avatar of jnsprad

ASKER

I understand your api command. But what i dont get is the · lpClassName what is that supposed to be? and how would i obtain that information from the other window?  I think your on to something though, if i could get its handle though, Syspro doenst use .net frame work (;-() so i cant use the.text to get the information inside of it... how would i go about reading the handle....the code syspro has is extreemly dull compared to .net.. i cant even use one line to define a variable. in .net i could use
 dim variable as string = "Something"

Open in new window

, in this i have to use:
 
dim varriable
varriable = "anyhting here, string, int, long anything"

Open in new window


just for refference, the code im using to find the windows handle is:
Public Class Form1
    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim name As String = FindWindow(, "Job Query")
        Messagebox.show(name)
    End Sub
End Class

Open in new window


 User generated image
To start with, change the Type of 'name' from String to Long as that is that FindWindow Returns. Second use vbnullstring. See this code. Does the messagebox return a 'Number'?

Public Class Form1
    Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    Handles Button1.Click
        Dim name As Long = FindWindow(vbNullString, "Job Query")
        MessageBox.Show(name)
    End Sub
End Class

Open in new window


Sid
Avatar of jnsprad

ASKER

Sorry for the log timed reply, work is getting busy. Your code does return a number. although its not a static number... Changes everytime i click the button
>>>Your code does return a number.

That's good :)

>>>Changes everytime i click the button

Yes, It will.

Let me write the next part and post it back. Will be able to do it in the next couple of hours as I am stepping out for sometime :)

Sid
Avatar of jnsprad

ASKER

bump?
ASKER CERTIFIED SOLUTION
Avatar of SiddharthRout
SiddharthRout
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jnsprad

ASKER

I have had Syllogist walk me through the procedure. I wasnt able to successfully able to gather the item due to multiple programming languages being used to produce the application. Ticket closed. Point awarded
Avatar of jnsprad

ASKER

Can be applied to any other programs as well..