Shell – Giavapps Windows API

 

api_shell_execute(FileName, Parameters, ShowState) Performs an operation on a specified file.

FileName: specifies the file on which to execute the specified operation.
Parameters: specifies the parameters to be passed to the application.
ShowState: the flags that specify how an application is to be displayed when it is opened.

ShowState argument can be one of the following constants:

SW_HIDE Hides the window and activates another window.

SW_MAXIMIZE Maximizes the specified window.

SW_MINIMIZE Minimizes the specified window and activates the next top-level window in the Z order.

SW_RESTORE Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.

SW_SHOW Activates the window and displays it in its current size and position.

SW_SHOWDEFAULT Sets the show state based on the program that started the application.

SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.

SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.

SW_SHOWMINNOACTIVE Displays the window as a minimized window. This value is similar to SW_SHOWMINIMIZED, except the window is not activated.

SW_SHOWNA Displays the window in its current state. The active window remains active.

SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The active window remains active.

SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

 

api_shell_find_process(ProcessName) Returns the process id if the specified process is running or false otherwise.

ProcessName: process name (including .exe extension).

 

api_shell_find_process_count(ProcessName) Returns the number of processes running with the specified process name.

ProcessName: process name (including .exe extension).

 

Code Examples

 

Executing an External Program

 

api_shell_execute("cmd.exe","",SW_SHOW);

 

Selecting a File from the Explorer

 

api_shell_execute(“explorer.exe”,“/select,C:\WINDOWS\explorer.exe”,SW_SHOW);

 

Checking if a Process is Running

 

if(api_shell_find_process("cmd.exe"))
{
api_messagebox(window,"Process ‘cmd.exe’ is running!","INFO",MB_OK | MB_ICONINFORMATION);
}
else
{
api_messagebox(window,"Process ‘cmd.exe’ is not running!","INFO",MB_OK | MB_ICONINFORMATION);
}

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*