Dragging Window = Halted Execution

BlitzMax Forums/BlitzMax Programming/Dragging Window = Halted Execution

Eikon(Posted 2006) [#1]
I am using a standard graphics window, non GUI. Normally this wouldn't be much of an issue, but I am writing a networked game. This means the user can invoke the auto disconnect routine just by dragging the window for a few seconds. It really isn't the best way to keep packets in sync when the user can halt program execution either. How can I get around this?


TartanTangerine (was Indiepath)(Posted 2006) [#2]
It appears the way to do this is within the System Mod, for which we have no source!

BUT we have a hack :D It's not ideal but it disables any clicking in the Titlebar area. It does need you to modify the d3d7graphics.bmx

Look for this function :
Function WndProc( hwnd,message,wp,lp ) "win32"

Put this code immediately beneath the function heading :-
If message = WM_NCHITTEST
		If DefWindowProcA(hwnd, WM_NCHITTEST, wp, lp) = 2 Return
	EndIf

And rebuilt modules.


Eikon(Posted 2006) [#3]
Thanks, Indie. It's working good for DX, any fix for OGL?

If anyone knows any other methods, please let me know.


TartanTangerine (was Indiepath)(Posted 2006) [#4]
Oh yeah. Lol

glgraphics.win32.c
make it so:-
static _stdcall long _wndProc( HWND hwnd,UINT msg,WPARAM wp,LPARAM lp ){

	if (msg == WM_NCHITTEST)
	{
		if (DefWindowProc(hwnd, WM_NCHITTEST, wp, lp) == 2) return 0; 
	}

And I don't know the MacOS API so I can't do that one.


Eikon(Posted 2006) [#5]
Works great. Thanks again :)


boomboommax(Posted 2006) [#6]
thread it


Eikon(Posted 2006) [#7]
Can you elaborate, ol' engaged one?


boomboommax(Posted 2006) [#8]
well, if you stick your rendering/logic etc in a seperate thread etc, you can have it so that if someone drags the window around for like an hour (or less:P) it will still all update and you wont timeout (there was an example of this on one of the purebasic forums, opengl cube with threading i think it was)

(however if you want it crossplatform you will have to work out how todo it on all of course but i think its a better solution)


TartanTangerine (was Indiepath)(Posted 2006) [#9]
It would be easier to write your own functions to move the screen.