Skip to Content
author's profile photo Former Member
Former Member

Main Window Handle or Process ID of the current B1 client instance

Does anyone know how to get either the Main Window Handle or the Windows Process ID of the current B1 client session. GetProcessesByName("SAP Business One") will not work if there is more than one B1 Session Open.

Any help is appreciated.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 03, 2011 at 09:15 PM

    Hi,

    You may check this: get-sbo-process-id-on-terminal-server

    Thanks,

    Gordon

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 04, 2011 at 05:53 AM

    Im doing it so:

    Dim myProcess As System.Diagnostics.Process = System.Diagnostics.Process.GetCurrentProcess()

    Dim ProccessInfo As New Process_Basic_Information

    Dim ProcHandle As IntPtr = Process.GetProcessById(myProcess.Id).Handle

    Dim RetLength As UInteger

    NtQueryInformationProcess(ProcHandle, PROCESSBASICINFORMATION, ProccessInfo, Marshal.SizeOf(ProccessInfo), RetLength)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 04, 2011 at 05:07 PM

    Petr,

    Thanks for your reply. It appears that your code will get the process id of the addon, but I need the process id of the current instance of SAP Business One. Am I missing something?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.