Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Run SAP GUI in Background

Posted on 2011-03-10
3
Medium Priority
?
1,270 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 2000 total points
ID: 35126686
I'm sorry it is C++ code. I should have posted the documentation reference too :

CreateProcess
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

596 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