dialogs show up centered globally not locally.
-
- Enthusiast
- Posts: 480
- Joined: Thu Jul 27, 2006 4:06 am
dialogs show up centered globally not locally.
Whenever a dialog pops up it's centered (ie. to the desktop) and not to the application itself (the IDE) this makes it very annoying for those using more than one monitor or split screen, it's just way too annoying.
Is there any way this could be fixed in the editor without having to resort for third-party solutions?
By dialog I mean syntax errors, etc. MessageBox()
Is there any way this could be fixed in the editor without having to resort for third-party solutions?
By dialog I mean syntax errors, etc. MessageBox()


-
- Enthusiast
- Posts: 480
- Joined: Thu Jul 27, 2006 4:06 am
Messing with the positioning of standard dialogs is bad practice because then the dialog stops behaving the way people are used to. Its not about "passing the ball", its about complying to the rules set up by the OS to have a good overall user experience.
Anyway, have fun pretending and waiting... :roll:
Anyway, have fun pretending and waiting... :roll:
quidquid Latine dictum sit altum videtur
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Oh boy, the sensitivity of a butcher ... :roll:superadnim wrote:I will pretend I didn't read that answer from the staff and will continue to wait for a proper answer.
It's actually pretty easy to fix that via API. On the other hand, you're such a dick I guess reading a little MSDN is what you really need.

Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
I took some code from user 'Eddy', below is my conversion of his code, it allows placement of any requester, AFAIK. It's Windows behaviour, by the way.
The code below is used in CodeCaddy, and seems to run fine...
The code below is used in CodeCaddy, and seems to run fine...
Code: Select all
Procedure.i x_requesterposition_callback(window.i,message.i,wparam.i,lparam.i) ; used for x_setrequesterposition()
Protected result.i
Global x_requesterposition_x.i, x_requesterposition_y.i, x_requesterposition_callback.i
Global x_requesterposition_hook.i, x_requesterposition_window.i
;
Select message
Case #WM_DESTROY
SetWindowLong_(window,#GWL_WNDPROC,x_requesterposition_callback)
Case #WM_CREATE ; update requester position (special case for InputRequester)
SetWindowPos_(window,#HWND_TOPMOST,x_requesterposition_x,x_requesterposition_y,0,0,#SWP_NOSIZE|#SWP_NOACTIVATE)
Case #WM_INITDIALOG ; update requester position
SetWindowPos_(Window,#HWND_TOPMOST,x_requesterposition_x,x_requesterposition_y,0,0,#SWP_NOSIZE|#SWP_NOACTIVATE)
result = CallWindowProc_(x_requesterposition_callback,window,message,wparam,lparam)
SetWindowPos_(Window,#HWND_TOPMOST,x_requesterposition_x,x_requesterposition_y,0,0,#SWP_NOSIZE|#SWP_NOACTIVATE)
ProcedureReturn result
EndSelect
ProcedureReturn CallWindowProc_(x_requesterposition_callback,window,message,wparam,lparam)
EndProcedure
Procedure.i x_requesterposition_hook(idhook.i,wparam.i,lparam.i) ; used for x_setrequesterposition()
Protected *x_requesterposition_cwp.CWPSTRUCT, windowclass.s, result.i, message.i, window.i
Global x_requesterposition_x.i, x_requesterposition_y.i, x_requesterposition_callback.i
Global x_requesterposition_hook.i, x_requesterposition_window.i
;
*x_requesterposition_cwp.CWPSTRUCT = lParam
message = *x_requesterposition_cwp\Message
window = *x_requesterposition_cwp\hwnd
;
; special case for InputRequester
;
windowClass = Space(255)
GetClassName_(window,@windowclass,255)
If LCase(windowclass)="inputrequester"
message = #WM_INITDIALOG
EndIf
;
Select message
Case #WM_INITDIALOG ; modify Requester callback
x_requesterposition_callback = SetWindowLong_(window,#GWL_WNDPROC,@x_requesterposition_callback())
result = CallNextHookEx_(x_requesterposition_hook, idHook,wParam,lParam)
UnhookWindowsHookEx_(x_requesterposition_hook)
x_requesterposition_hook = 0
Default
result = CallNextHookEx_(x_requesterposition_hook,idhook,wparam,lparam)
EndSelect
;
ProcedureReturn result
EndProcedure
Procedure x_setrequesterposition(x.i,y.i,windownr.i) ; set x/y position of the next purebasic requester
Global x_requesterposition_x.i, x_requesterposition_y.i, x_requesterposition_callback.i
Global x_requesterposition_hook.i, x_requesterposition_window.i
;
; *** set x/y position of the next purebasic requester
;
; in: x.l - horizontal position
; y.l - vertical position
; windownr - number of parentwindow
; retval: none
; out: none
;
; from the purebasic forum, by eddy, dunno how it works, or even if it works properly... :-)
;
; note: only call this with a window open! otherwise it may cause all sorts of unpredictable errors, if neccessary open
; an invisible window with x_requesterposition_window = OpenWindow(#PB_Any,x,y,0,0,#PB_Window_Invisible,"")
;
x_requesterposition_x = x
x_requesterposition_y = y
x_requesterposition_window = windownr
;
; modify parent hook
;
x_requesterposition_hook = SetWindowsHookEx_(#WH_CALLWNDPROC,@x_requesterposition_hook(),GetModuleHandle_(0),GetWindowThreadProcessId_(WindowID(x_requesterposition_window),0))
;
EndProcedure
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
-
- Addict
- Posts: 1027
- Joined: Sun May 15, 2005 5:15 am
- Location: Australia
- Contact:
@superadnim: sounds like you're using (in nvidia terminology) "as one large horizontal desktop" (stretching the windows desktop across the two monitors)
So either switch to extended desktop mode (dualview in nvidia control panel language) or, if you have an nvidia card, go into nview properties and set the option "reposition dialog boxes on" to "move to application display" (I'm sure ati has a similar option)
If you don't like extended desktop mode; suck it up, or get something like ultramon for the "smart taskbar"
And answers like "I will pretend I didn't read that" are pretty childish. Especially when you have options like this
So either switch to extended desktop mode (dualview in nvidia control panel language) or, if you have an nvidia card, go into nview properties and set the option "reposition dialog boxes on" to "move to application display" (I'm sure ati has a similar option)
If you don't like extended desktop mode; suck it up, or get something like ultramon for the "smart taskbar"
And answers like "I will pretend I didn't read that" are pretty childish. Especially when you have options like this
Demonio Ardente
Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact: