- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does anyone know how to program the position of MessageBox to be elsewhere than right in the middle of the screen or Window? Or is it not possible? I know that I can always write my own version of MessageBox, but I would rather not.
Alan
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create an invisible window centered where you want and pass its handle as the HWND to MessageBox?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve,
Your suggestion will cover most cases, but because I don't know the size of the displayed Messagebox, I will have to keep it a safe distance from the edges.
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My bug has struck again, and once more I cannot post messages to the Forum. This one is kindly posted by the support staff.
With helpful leads from Paul Curtis, I have developed a function MessageBoxH that uses the same arguments as MessageBox, but with an optional extra Postion argument. It calls MessageBox and if the Position argument is present, uses a Hook Procedure to reposition the dialogue box.
If anyone would like the source code, ask me at alan.cruttenden@lineone.net
Alan
With helpful leads from Paul Curtis, I have developed a function MessageBoxH that uses the same arguments as MessageBox, but with an optional extra Postion argument. It calls MessageBox and if the Position argument is present, uses a Hook Procedure to reposition the dialogue box.
If anyone would like the source code, ask me at alan.cruttenden@lineone.net
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does this really work? I tried this in a Quickwin application, along the following lines:
Open a child window to unit X
Locate the window and size it using SETWSIZEQQ
hWnd = GETHWNDQQ (X)
IRETURN = MESSAGEBOX (hWnd, 'Message'C, 'Caption'C, MB_OK)
(This messagebox function is the same as Quickwin MESSAGEBOXQQ except that it takes the additional argument hWnd)
The message box works fine, but no matter what it pops up in the middle of the screen.
Open a child window to unit X
Locate the window and size it using SETWSIZEQQ
hWnd = GETHWNDQQ (X)
IRETURN = MESSAGEBOX (hWnd, 'Message'C, 'Caption'C, MB_OK)
(This messagebox function is the same as Quickwin MESSAGEBOXQQ except that it takes the additional argument hWnd)
The message box works fine, but no matter what it pops up in the middle of the screen.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page