Program Demo_PictureBox2; // #sign:Max: MAXBOX10: 17/02/2020 14:35:07 //#tech:82perf: 0:0:12.671 threads: 11 192.168.1.66 14:35:07 4.7.1.82 Const TEXTOUT = 'Runs 5-10 random pictures on a canvas get from a web service'; function OpenSCManagerX (lpMachineName : string; lpDatabaseName : string; dwDesiredAccess : DWORD): THANDLE; // external 'OpenSCManager@ADVAPI32.DLL.dll stdcall'; external 'OpenSCManagerA@advapi32.dll stdcall'; var iserv: ISWBemServices; iset: ISWbemObjectSet; ENum: IEnumVariant; vObj: OleVariant; aQuery, wmi_dom: string; { uses Windows, winsvc, shellapi; } function ServiceRunning(sMachine, sService: PChar): Boolean; begin //Result:= SERVICE_RUNNING = ServiceGetStatus(sMachine, sService); end; //Picture Box --------------------------------------------------------- // Const UrlPictureLookupInfo = 'https://picsum.photos/seed/%d/%d/%d'; procedure PIC_CloseClick(Sender: TObject; var action: TCloseAction); begin //afrm.Close; action:= cafree; writeln('picform close at: '+datetimetostr(now)); end; function RunPictureBox(const picnr, asizew, asizeh: integer; const UrlPicture,apath: string; save:boolean): string; var pngStream: TMemoryStream; apicfrm: TForm; begin pngStream:= TMemoryStream.Create; try HttpGet(Format(UrlPicture,[picnr, asizew, asizeh]), pngStream); writeln('pic size: '+itoa(pngStream.size)) except //if something wrong try using backup server. writeln('PICexcept: '+ExceptionToString(ExceptionType, ExceptionParam)); end; with TLinearBitmap.Create do try pngStream.Position:= 0; LoadFromStream2(pngStream,'JPG'); //or PNG apicfrm:= getForm2(asizew+1,asizeh+1, clblack, 'picsum.photos: '+'Id: '+inttostr(picnr)); apicfrm.onclose:= @Pic_CloseClick; paintToCanvas(apicfrm.canvas, Rect(1,2,Width,Height),false); if save then SaveToFile(apath); result:= apath; finally Dispose; Free; pngStream.Free; end; end; var rndpic: integer; Begin //@main // Println(TEXTOUT); maXcalcF('Sqrt(PI/e^2)') writeln('3. Get Task Process Priority Info:') // iserv:= WMIConnect(isloc,'localhost\root\SecurityCenter2','',''); // Get-WmiObject Win32_process -filter 'name = "ProcessName"' | foreach-object { $_.SetPriority(PriorityLevelID) } iserv:= WMIConnect(WMIStart,'localhost','',''); wmi_dom:= 'Win32_process'; iset:= WMIExecQuery(iserv,'Select * from '+wmi_dom+' WHERE Name = "maXbox4.exe"') if WMIRowFindFirst(iset, ENum, vObj) then repeat PrintF('PriorityLevelID of maXbox: %s ',[vObj.Priority]); //vObj.setPriority('128') until not WMIRowFindNext(ENum, vObj); vObj:= unassigned; writeln(GetLastErrorMessage) //enigma test writeln((uppercase(AllTrimSpaces('this is ä Ursprünglich Strng : string')))); writeln(StripSpaces('this is Strng : string')); writeln(uppercase(DelSpace('this is a hidden Strng : string'))); //sr:= loadfromfile((exepath+'mytexte.txt')) //sr:= alltrimspaces (sr) //writeln(uppercase(utf8decode(delspace(sr)))) if isInternet then for it:= 1 to 5 do begin rndpic:= random(30000) sleep(2000) RunPictureBox(rndpic,400,400,UrlPictureLookupInfo, {false=store pic} Exepath+'\images\'+itoa(rndpic)+'.jpg', False); end; End. ref: http://swissdelphicenter.ch/en/showcode.php?id=1275 https://github.com/FMXExpress/Cross-Platform-Samples/blob/master/89-HTTPImage/Unit1.pas Doc: 16235; is train test Do not use the service display name (as displayed in the services control panel applet.) You must use the real service name, as referenced in the registry under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services //https://www.heise.de/hintergrund/25-Jahre-Delphi-war-ein-Kind-seiner-Zeit-4660219.html?seite=3 https://www.heise.de/forum/heise-online/Kommentare/25-Jahre-Delphi-war-ein-Kind-seiner-Zeit/Ein-Teil-der-Code-Zukunft-ist-mehrsprachig/posting-36135387/show/ procedure TForm1.Button1Click(Sender: TObject); begin if NetHTTPClient1.Tag=NOT_BUSY then begin GaussianBlurEffect1.Enabled := True; ProgressBar1.Visible := True; Timer1.Enabled := True; TTask.Run(procedure var LResponse: TMemoryStream; begin LResponse := TMemoryStream.Create; try NetHTTPClient1.Get('https://picsum.photos/seed/'+Random.ToString+'/'+Image1.Width.ToString+'/'+Image1.Height.ToString,LResponse); TThread.Synchronize(nil,procedure begin Image1.Bitmap.LoadFromStream(LResponse); end); finally LResponse.Free; NetHTTPClient1.Tag := NOT_BUSY; GaussianBlurEffect1.Enabled := False; ProgressBar1.Visible := False; Timer1.Enabled := False; ProgressBar1.Value := 0; end; end); end; end; Combining three rotors from a set of five, each of the 3 rotor settings with 26 positions, and the plugboard with ten pairs of letters connected, the military Enigma has 158,962,555,217,826,360,000 different settings (nearly 159 quintillion or about 67 bits).[19] Note that (5x4x3) x (26^3) x [26! / (6! x 10! x 2^10)] = 158,962,555,217,826,360,000 ˜ 2^67.1 “Imagine a counterfactual history in which the British had not been able to decipher Enigma messages during the Battle of Britain, the naval war in the Mediterranean, the early years of the Battle of the Atlantic, or in the campaign in the Western Desert. Such a scenario is frightening, as it would be a history that depicts not just a longer, drawn-out war but potentially one with a quite different outcome.” „Stellen Sie sich eine kontrafaktische Geschichte vor, in der die Briten die Enigma-Sprüche während der [Luft-]Schlacht um England, des Seekriegs im Mittelmeer, der frühen Jahre der Atlantik-Schlacht oder im [Afrika-]Feldzug in der [Libyschen] Westlichen Wüste nicht hätten entziffern können. Ein solches Szenario ist beängstigend, denn es wäre eine Geschichte, die nicht nur einen längeren, langwierigen Krieg darstellt, sondern möglicherweise einen Krieg mit einem ganz anderen Ergebnis.“ – Sir Dermot Turing[140] There is a way to start a process with the desired priority. This can be done with a console command "start", available in the classic command prompt (cmd.exe). Here is how. Finally, using the console tool wmic, you can change an already running app's process priority level. This can be useful in various automation scripts. How to change the app priority level using wmic Open a new command prompt instance. Type or copy-paste the following command: https://winaero.com/blog/change-process-priority-windows-10/ Ref: https://kb.paessler.com/en/topic/1073-what-are-the-most-common-errors-when-monitoring-wmi https://msdn.microsoft.com/en-us/library/aa394217(v=vs.85).aspx EventType - //"BUILTIN\\Administrators"'; '1 Error '2 Warning() '3 Information() '4 Security audit success '5 Security audit failure Exception: Could not convert variant of type (OleStr) into type (Date). //NullStrictConvert := false; https://www.scribd.com/document/348528006/Work-with-WMI-System-Management-Second-Part "Hello Siri, open a shell!" Siri: "I don't see an app called "a shell". You could try searching the App Store." public class MainClassWMI { public static void MainWMI() { ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'"); ManagementObjectCollection queryCollection = query.Get(); foreach (ManagementObject mo in queryCollection) { string[] addresses = (string[])mo["IPAddress"]; foreach (string ipaddress in addresses) { Console.WriteLine("IP Address: {0}", ipaddress); } } } }