Solved

Run SAP GUI in Background

Posted on 2011-03-10
3
1,158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

717 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