{"name":"closeDisplay","title":"closeDisplay","type":"command","url":"https://community.bistudio.com/wiki/closeDisplay","revid":323157,"updated":"2022-07-01T10:11:40Z","groups":["GUI Control"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","description":"Closes given display with exit code. It does not instantly close the display but does it on next simulation cycle. Most common exit codes are:\n\n```cpp\n#define IDC_OK        1 // emulate \"OK\" button\n#define IDC_CANCEL    2 // emulate \"Cancel\" button\n```\n\n> [!IMPORTANT]\n> Sometimes when one display is opened on top of another display the previous display may not close properly; some display EHs such as \"onUnload\" may never fire.\n> Use this command to manually handle such displays.","syntaxes":[{"syntax":"display closeDisplay exitCode","params":[{"name":"display","type":"Display","type_expr":"Display"},{"name":"exitCode","type":"Number","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"display"},"right":{"text":"exitCode"}}],"examples":[{"code":["_display closeDisplay 1;"]},{"code":["#define IDC_OK 1\n_display closeDisplay IDC_OK;"]}],"see_also":["createDisplay","closeDialog"]}