Solved

Run SAP GUI in Background

Posted on 2011-03-10
3
1,057 Views
Last Modified: 2013-11-27
Hi,
 I need a help with the follwed problem, How do I run SAP GUI in background or as process or even to be hidden

 and by inserting a transaction name to Text Box then press on button in .NET Application, the SAP GUI will be displayed for the user

 the porpse for being running in background or hidden or as proccess is to be displayed in minimum time to give the best reaction in MINIMUM TIME

Thanks
0
Comment
Question by:madmare
  • 2
3 Comments
 
LVL 4

Expert Comment

by:parnasso
ID: 35126396
Run the SAP GUI with SW_FORCEMINIMIZE flag or SW_HIDE in STARTUPINFO structure of CreateProcess WINAPI call.

STARTUPINFO si;
    PROCESS_INFORMATION pi;

    ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
    si.dwFlags = STARTF_USESSHOWWINDOW;
    si.wShowWindow = // SW_HIDE or SW_FORCEMINIMIZE
    ZeroMemory( &pi, sizeof(pi) );
 
    if( !CreateProcess( NULL,   
        "SAP GUI command line...",        // Command line
        NULL,           // Process handle not inheritable
        NULL,           // Thread handle not inheritable
        FALSE,          // Set handle inheritance to FALSE
        0,              // No creation flags
        NULL,           // Use parent's environment block
        NULL,           // Use parent's starting directory 
        &si,            // Pointer to STARTUPINFO structure
        &pi )           // Pointer to PROCESS_INFORMATION structure
    ) 
    {
        printf( "CreateProcess failed (%d).\n", GetLastError() );
        return;
    }

Open in new window

0
 

Author Comment

by:madmare
ID: 35126588
is it C# code ??
0
 
LVL 4

Accepted Solution

by:
parnasso earned 500 total points
ID: 35126686
I'm sorry it is C++ code. I should have posted the documentation reference too :

CreateProcess
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now