B4J Question [ Steam Client ] Closes the Form, but doesn't kill the application .

Waldemar Lima

Well-Known Member
Licensed User
I'm making a game for steam ( steampowered.com ) it works fine, but when I try to "kill" the game via SteamClient by clicking on "Stop Run",
1626360180207.png

the Form closes, but the application keeps running and it's only killed when I I go to the B4J client and click on "Kill Process", is there any way I can handle the request to close the game by the steam client?

1626360244480.png
 

William Lancee

Well-Known Member
Licensed User
Longtime User
I looked at your code, and what sticks out for me as for @LucaMs is the B4XPages.ShowPageAndRemovePreviousPages

It rare that you need to RemovePreviousPages in B4Xpages. In fact I don't recall having to use it.

Why don't you ty it with just ShowPage. Think of them being in a stack (which they are) that they behave quite orderly.

Unfortunately, even with downloading the Libraries, I could not get SteamWorks to work. I'm afraid I can't take time to find out why.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
do u have steam client installed on your PC ?
Maybe you could explain it all better, from the beginning.

Now you ask if he/we have a Steam client installed, but from what you've written so far it was clear that you wanted to create a client for a (that) game server (but in the video you use a browser, if I'm not mistaken).

So... we just don't know how this is supposed to work, what the purpose of your B4J project is and... everything, in short.

I looked at your code, and what sticks out for me as for @LucaMs is the B4XPages.ShowPageAndRemovePreviousPages
I had forgotten about it and above all initially I did not realize that it was B4XPages-B4J.
In this case, to have a single page-form open, it is necessary to use ShowPageAndRemovePreviousPages. To return to the previous page later, however, it is necessary to open it explicitly, using ShowOpen ("mainpage"), in this case.
 
Upvote 0

Waldemar Lima

Well-Known Member
Licensed User
hello All !

received a reply from the Steam support team >

Hi there,

The behavior of the Steam 'Stop' button is different depending on the platform (Windows, MacOS, or Linux). On Windows, Steam will send a WM_CLOSE message to the app's Windows. Elsewhere, a kill signal is sent to the game's process.

From your depot, it looks like your game is a Java-based game. It's possible that your game isn't properly handling the WM_CLOSE event. You may need to import the appropriate Windows DLL to interact with the Windows message pump and properly handle that message.

I would recommend posting your question on the Steamworks Development community forum. It is very likely that a developer there has encountered (and potentially resolved) the same issue that you have.

Best,
Steam Support Team

is there any way to treat or differentiate between a WM_CLOSE or if it was a user click on the window's close button?
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
I don't know. But you should put some logs in the Main module MainForm_Closed and MainForm_CloseRequest.

Run you App from the IDE. You should see the App being killed at the bottom in the Log panel.

If no logs then you're out of luck.

[note that the topic of this thread has deviated from the question]
 
Upvote 0
Top