Page 1 of 2

PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Fri Nov 19, 2010 12:13 pm
by Crusiatus Black
Hey there,

I've recently upgraded to Windows 7 from Windows XP, and I was very pleased, until I
encountered some issues with PureBasic (only PB) and Ultramon. I've got a legit version
of Ultramon and PB installed, however when I enable the titlebar buttons for moving
the window to another window, or maximizing the window to all desktops, the minimize
button sends WM_CLOSE to the window.

Now I've seen threads about this, however I'm wondering if this could be caused by
windows 7. I've never had this issue before on XP, and the PB editor is not the only
one that's being affected by this. Every window created by PureBasic via OpenWindow
does the same thing for me, closing when I'm minimizing it.

Is there a valid explanation for why this only happens with the PB Editor or PB coded apps?
Should I take this up with Ultramon?

I've disabled the 2 titlebar buttons, because I don't need them, so the PB Editor and PB apps
can minimize again. However, I'm wondering if other Windows 7 Professional x86 systems will
do the same with my applications. Well at least I know what to advise to people mailing me with
'Your application closes when I minimize it' :p

Thanks, if this wasn't posted in the right board, excuse me.

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Fri Nov 19, 2010 12:28 pm
by blueznl
Ouch, that's not good. I'm also a (registered) Ultramon user, and things are so much nicer when doing the 'multi monitor ping pong' thing :-)

I haven't been using Win7 on multi monitor setup yet though (still primarily using XP) but when I have some time I see if I suffer the same problem.

Dunno' if any freeware alternative (MultiMon) works on Windows 7 and suffers the same problem, if not you might contact the author of UltraMon, IIRC he fixed some issues with misbehaving software in the past (not implying that PB is misbehaving here :-))

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Fri Nov 19, 2010 12:45 pm
by Crusiatus Black
Indeed, important stuff on one monitor, other stuff on another monitor, makes working much easier hehe.

I'm going to try to see if the same issue is going to pop up on another system over here, however
I've tried it on a Windows 7 Enterprise x64 system as well, and no issues there. I might contact
him, but it's only (so far) caused when minimizing a PB window/PB app window on 7 Pro x86. Now
in my opinion, that's really weird :p

Thanks! :)

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Fri Nov 19, 2010 6:13 pm
by blueznl
Hey, een echte die-hard gebruikt tenminste twee (22") schermen :-)

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Fri Nov 19, 2010 6:21 pm
by GoodNPlenty
I am also a registered owner of PB4.51, Ultramon 3.0.10 and Windows 7 x64 Ultimate. When I minimize the PureBasic x86 Editor the minimize button also sends WM_CLOSE to the window. I have not disabled the title bar buttons for moving the window to another window, or maximizing the window to all desktops, since I use that option frequently. Although I do not know this to be a PureBasic issue, but out of the many applications I use PureBasic is the only one to exhibit this problem.

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Fri Nov 19, 2010 6:25 pm
by Crusiatus Black
And do you use the x64 editor too? Does it happen when you minimize the x64 editor as well?

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Fri Nov 19, 2010 6:26 pm
by Crusiatus Black
blueznl wrote:Hey, een echte die-hard gebruikt tenminste twee (22") schermen :-)
Precies, maar als je het verschil tussen de groottes van mijn schermen ziet, zie je waarom ik
een tweede nodig heb haha :p Mijn primaire is 17", mijn secundaire is 22" ook haha :p

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Fri Nov 19, 2010 11:45 pm
by GoodNPlenty
Crusiatus Black wrote:And do you use the x64 editor too? Does it happen when you minimize the x64 editor as well?
I have the same problem with the x64 editor as well. I have been creating an additional un saved PureBasic document in the editor with one line so that when I minimize it will ask if I want to save before closing PureBasic and I can click 'Cancel'. This will save me from reloading PureBasic each time. Not a good solution, but it at least reminds me that PureBasic is closing.

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Sat Nov 20, 2010 12:51 am
by Crusiatus Black
GoodNPlenty wrote:
Crusiatus Black wrote:And do you use the x64 editor too? Does it happen when you minimize the x64 editor as well?
I have the same problem with the x64 editor as well. I have been creating an additional un saved PureBasic document in the editor with one line so that when I minimize it will ask if I want to save before closing PureBasic and I can click 'Cancel'. This will save me from reloading PureBasic each time. Not a good solution, but it at least reminds me that PureBasic is closing.
That's exactly what I did before I found out that disabling the titlebar buttons completely solves
the weird behaviour, keeping the additional ultramon menu-entries does not cause this issue, so
you could use those for switching monitors.

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Sat Nov 20, 2010 2:55 am
by GoodNPlenty
Crusiatus Black wrote:
GoodNPlenty wrote:
Crusiatus Black wrote:And do you use the x64 editor too? Does it happen when you minimize the x64 editor as well?
I have the same problem with the x64 editor as well. I have been creating an additional un saved PureBasic document in the editor with one line so that when I minimize it will ask if I want to save before closing PureBasic and I can click 'Cancel'. This will save me from reloading PureBasic each time. Not a good solution, but it at least reminds me that PureBasic is closing.
That's exactly what I did before I found out that disabling the titlebar buttons completely solves
the weird behaviour, keeping the additional ultramon menu-entries does not cause this issue, so
you could use those for switching monitors.
That works great, just need some time to get used to using the menu. :D

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Sat Nov 20, 2010 12:29 pm
by Crusiatus Black
Haha same here, took me a bit, but at least nothing closes without my permission any more :p

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Sat Nov 20, 2010 9:47 pm
by blueznl
DId you contact UltraMon's author yet?

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Sat Nov 20, 2010 11:27 pm
by GoodNPlenty
blueznl wrote:DId you contact UltraMon's author yet?
I sent an email to 'support@realtimesoft.com' with a link to this post asking for their help in resolving this issue with the PureBasic x86 / x64 editor and UltraMon. I will post any reply that I receive.

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Sun Nov 21, 2010 4:10 am
by Crusiatus Black
GoodNPlenty wrote:
blueznl wrote:DId you contact UltraMon's author yet?
I sent an email to 'support@realtimesoft.com' with a link to this post asking for their help in resolving this issue with the PureBasic x86 / x64 editor and UltraMon. I will post any reply that I receive.
Thanks! :)

Re: PureBasic 4.5, Ultramon and titlebar-buttons

Posted: Sun Nov 21, 2010 8:41 pm
by GoodNPlenty
I received the prompt response below from Realtime Soft support and it fixes the problem for me. I somehow overlooked the compatibility tab. :D

I've been able to reproduce the issue, as a workaround go to UltraMon Options > Compatibility and configure custom settings for PureBasic, then select the 'use alternative method to add window buttons' option.

Here's what happens: when you minimize PureBasic, UltraMon removes the window buttons by posting WM_CLOSE to the button window. By default UltraMon creates the window for the buttons in the application process, meaning that the message loop of the application gets the posted message. Usually a message loop will forward all messages to the associated window procedure, but if the application doesn't do this and instead processes the WM_CLOSE message directly, this could cause the behavior you're seeing.

Using the alternative window buttons fixes the problem because the button window is created in the UltraMon process instead of the application process.