external_function FindWindow "FindWindowA" user32.dll pointer lpszClassName string lpszWindowName returns handle\r
external_function GetSystemMenu "GetSystemMenu" user32.dll handle hwnd dword bRevert returns dword\r
external_function EnableMenuItem "EnableMenuItem" user32.dll handle hmenu integer uIDEnableItem integer uEnable returns integer\r
+external_function ShowWindow "ShowWindow" user32.dll handle hWnd integer nCmdShow returns integer
external_function ShellExecute "ShellExecuteA" shell32.dll handle hWnd pointer lpOperation pointer lpFile pointer lpParameters pointer lpDirectory integer nShowCmd returns integer\r
external_function CreateProcess "CreateProcessA" kernel32.dll pointer lpAN pointer lpCL pointer lpPA pointer lpTA integer bIH dword dwCF pointer lpE pointer lpCD pointer lpSI pointer lpPi returns integer\r
external_function OpenProcess "OpenProcess" kernel32.dll dword dwDesiredAccessas integer bInheritHandle dword dwProcId returns handle\r
\r
function_return 0\r
end_function\r
+
+// Manipulate cmd window to minimise maximise etc. E.g show_window("pap", SW_MINIMIZE)
+function show_window global string argv integer argv2 returns integer
+ local number Ret
+ local handle hWnd
+
+ move (SetConsoleTitle(argv)) to strmark
+ move (FindWindow(0, argv)) to hWnd
+ move (ShowWindow(hWnd, argv2)) to ret
+
+ function_return ret
+end_function
\r
// This function will run any external application directly from dataflex\r
// argv = application to run (command name/path) argv2 = any parameters to pass to the program argv3 = directory to run from\r