BorDlg and BorDlg_grey not close from my app lazarus / 34-Windows ---------------------------------------------------------------------- nacsasoft · 2019-03-28 09:00 Hi Lazarus Fans! I have a problem. I'd like close a "Bordlg" and "BorDlg_Grey" type windows from my application. I use the FindWindow winapi function but I not recognize the window with name. I see these bordlg wins properties with winspy app (see https://drive.google.com/file/d/1mYSzI 7P8GAezGt9vGpe06YY9hWjArGRl/view?usp=sharing image). I don't send this windows with WM_CLOSE action because I don't get these windows HWND. I tested my app with other app (notepad) and work correct!! This is the code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  wHandle: THandle; begin   wHandle := FindWindow(nil, PChar(edtProgramName.Text));   if wHandle <> 0 then      PostMessage(wHandle, WM_CLOSE, 0, 0)  else      ShowMessage('Bezárás nem sikerült! (valszeg az ablak már nincs nyitva!!)');  exit; end;  Thank You for helps!! ---------------------------------------------------------------------- marcov · 2019-03-28 11:10 "BorDLG" is listed as the class in your screenshot, not the window title. As per msdn, the first argument of findwindow is class, (which you set to nil), and the second is the title. My guess is that what you see with "caption" is the title. Good luck! ---------------------------------------------------------------------- nacsasoft · 2019-03-28 12:18 Hi marcov! Thanks the quick response!! I now test my app with next parameters: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i wHandle := FindWindow('bordlg', PChar(edtProgramName.Text));   if wHandle <> 0 then      PostMessage(wHandle, WM_CLOSE, 0, 0)  else      ShowMessage('Bezárás nem sikerült! (valszeg az ablak már nincs nyitva!!)');  exit;  When edtProgramName.Text = window caption (on the image - '1 Zóna Fűtőszál') . Not work....no close the bordlg window... ---------------------------------------------------------------------- marcov · 2019-03-28 14:16 It doesn't seem to have a windowproc to handle closing. Anyway, my gdi is not that strong.