Because you did not tell us exactly which Forms version you are using, we may not be able to offer an accurate answer. Please read the following before making any additional posts:
So, with that said, I am hoping you are using some Forms version that is web based only. I am going to further assume that the "X" to which you are referring is the browser's X. If I am correct then unfortunately, you cannot change the way the browser works (at least not easily). You can however trap the fact that the user tried to close it and throw a message/alert so they can be made aware of what will happen if they continue. Refer to MyOracleSupport Note 605327.1 for details. Be aware that this will not work if you are using separateFrame=true in your configuration.
As Michael mentioned, if you are trying to prevent the user from closing the Browser using the MDI Windows [ X ] - this is very difficult. If you want to prevent the user from closing a Forms window, then this can be done through the When-Window-Closed trigger. You can perform your tests to determine if the window is closable (eg: it's not the Specific window you don't want closed) and either allow the window to be closed or block it's closure. You can check the :SYSTEM.EVENT_WINDOW system property to determine which window is displayed. Remember, when performing comparisons with system properties/variables you should the NAME_IN function instead of direct reference. For example:
-- Use this... IF ( NAME_IN('SYSTEM.EVENT_WINDOW') = 'YOUR WINDOW NAME' ) THEN ... -- instead of this... IF ( :SYSTEM.EVENT_WINDOW = 'YOUR WINDOW NAME' ) THEN