1. Enter the component as follows:
No | Komponen | Properti | Nilai |
1 | Button1 | Caption | Non Aktifkan Dialog Killer |
Name | BtnNonAktif | ||
2 | Button2 | Caption | Aktifkan Dialog Killer |
Name | BtnAktif | ||
3 | Edit1 | Caption | - |
Name | EdText | ||
4 | Label1 | Name | LblKet |
Caption | Kondisi Dialog Killer | ||
5 | Timer1 | Enabled | False |
2. Arrange the visualization program design become as follows:
3. Then enter the source code as follows on each component that is mentioned in the table below.
I
hope this writing can give benefit to the visitors, readers, developer
and me. Thanks for visiting and availability for sharing this article by
pressing Share To Facebook, Twitter button or just press like button.
No. | Component Name | Source Code |
1 | BtnNonaktif | timer1.Enabled:=false; lblket.Caption:='Dialog killer non aktive'; |
2 | Btnaktif | timer1.Enabled:=true; LblKet.Caption:='Dialog killer aktif' ; |
3 | Timer1 | hwnd := FindWindow(nil, pChar(edText.Text)); application.ProcessMessages; PostMessage(hWnd,WM_KEYDOWN,VK_RETURN,1); application.ProcessMessages; |
4 | Form1 | var i :integer; begin Lblket.Caption:=' Dialog killer non aktive ' ; Form1.Caption:=ParamStr(0); for i := 1 to ParamCount do begin if lowercase(paramstr(i))= 'exit' then Application.Terminate else if paramstr(i)<>'' then Edtext.Text:=paramstr(i); end; end; |
Then execute the program, the result is as follows;
Picture 3. The steps to make dialog killer :Dialog Killer in non active and active condition
The example of Dialog Killer usage is as follows:
There is dialog box which is occurred in monitor named SWKendali
Picture 4. The steps to make dialog killer :Appear dialog box named SWKendali
Activate Dialog Killer to close dialog box named “Swkendali”
Picture 5. The steps to make dialog killer :Activate Dialog Killer
Automatically, the Swkendali dialog box which is appeared will close directly.