Disable Moving a MsgBox
Posted: 23 Mar 2017, 09:27
Hi all,
how can I disable moving on a MsgBox.
With the MessageBox function (msdn) I can bind a MsgBox to a GUI (owner -> child) and stop other activities with the gui.
With the GuiDisableMove function I can disable moving my GUI but how can I stop moving a MsgBox (without create a MsgBox like GUI)?
how can I disable moving on a MsgBox.
With the MessageBox function (msdn) I can bind a MsgBox to a GUI (owner -> child) and stop other activities with the gui.
With the GuiDisableMove function I can disable moving my GUI but how can I stop moving a MsgBox (without create a MsgBox like GUI)?
Code: Select all
; GLOBAL SETTINGS ===============================================================================================================
#NoEnv
#SingleInstance Force
SetBatchLines -1
; GUI ===========================================================================================================================
Gui, +hWndhMyGUI
Gui, Margin, 10, 10
Gui, Add, Button, xm-1 ym w402 h200 gBUTTON_MSGBOX, % "Click me!"
Gui, Add, Edit, xm y+9 w400 0x801 vMyEdit
Gui, Show, AutoSize
GuiDisableMove(hMyGUI)
GuiDisableCloseButton(hMyGUI)
return
; SCRIPT ========================================================================================================================
BUTTON_MSGBOX:
ret := MessageBox(hMyGUI, "Random Title", "YES or NO?", 0x24)
GuiControl,, MyEdit, % (msg = 7) ? "NO!" : "YES!"
return
; FUNCTIONS =====================================================================================================================
MessageBox(handle, title, text, options)
{
return DllCall("user32\MessageBox", "ptr", handle, "str", text, "str", title, "uint", options)
}
GuiDisableMove(handle)
{
hMenu := DllCall("user32\GetSystemMenu", "ptr", handle, "int", false, "ptr")
DllCall("user32\RemoveMenu", "ptr", hMenu, "uint", 0xf010, "uint", 0)
return DllCall("user32\DrawMenuBar", "ptr", handle)
}
GuiDisableCloseButton(handle)
{
hMenu := DllCall("user32\GetSystemMenu", "ptr", handle, "int", false, "ptr")
DllCall("user32\EnableMenuItem", "ptr", hMenu, "uint", 0xf060, "uint", 0x3)
return DllCall("user32\DrawMenuBar", "ptr", handle)
}
; EXIT ==========================================================================================================================
GuiEscape:
GuiClose:
ExitApp
; ===============================================================================================================================