Solved

Run SAP GUI in Background

Posted on 2011-03-10
3
997 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

744 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

11 Experts available now in Live!

Get 1:1 Help Now