/build/static/layout/Breadcrumb_cap_w.png

WiseScript: Any way to disable the ability to move a dialog box?

I can currently remove the close button on a dialog box and also make it so that the dialog box is always on top of any other window. The "Show Desktop" button will not minimize the window either. Is there a way to stop a user from being able to move the window off the screen? Thanks for your help. Below is my code for what I already have. Just copy and paste it into the WiseScript Editor and the editor will show it in its native display format.


item: Remark
Text=Remove "Close" button in upper right corner so the dialog cannot be canceled.
end
item: Call DLL Function
Pathname=%SYS32%\USER32.DLL
Function Name=GetWindowLongA
Argument List=33
Argument List=21-16
Return Variable=2WNDSTYLE
Flags=00100000
end
item: Set Variable
Variable=WNDSTYLE
Value=WNDSTYLE - 524288
Flags=00100000
end
item: Call DLL Function
Pathname=%SYS32%\USER32.DLL
Function Name=SetWindowLongA
Argument List=33
Argument List=21-16
Argument List=20WNDSTYLE
Return Variable=2
Flags=00100000
end
item: Remark
end
item: Remark
Text=Set Window to always be on top; "Show Desktop" will not hide the window.
end
item: Call DLL Function
Pathname=%SYS%\user32.dll
Function Name=SetWindowPos
Argument List=33
Argument List=21-1
Argument List=210
Argument List=210
Argument List=210
Argument List=210
Argument List=2167
Return Variable=0
Flags=00100000
end

0 Comments   [ + ] Show comments

Answers (2)

Posted by: anonymous_9363 14 years ago
Red Belt
2
You can find all the function parameters and message numbers for the SetWindowLongA API on MSDN. IIRC, though, it's now superceded by SetWindowLongPtr

Also, please use the CODE tag for posting code or other lengthy/wide text. You can access the tag by clicking the button marked '<%'.
Posted by: Nomi1985 14 years ago
Senior Yellow Belt
0
Cool, thanks for the tip to the Windows API documentation. I was able to figure out how to accomplish what I wanted. It would have been nice to use SetWindowLongPtr for Windows 64-bit support, but I couldn't get that to work. Apparently just changing the call from SetWindowLongA to SetWindowLongPtr does not work. Anyways, here is the code for anyone else that ever wants to do the same thing: If anyone figures out how to get this to work for SetWindowLongPtr, please do post your code.

Also, this site is a great help: http://www.pinvoke.net/index.aspx


item: Remark
Text=Remove "Close" button in upper right corner so the dialog cannot be canceled.
end
item: Remark
Text=Also, the user will not be able to move the window.
end
item: Call DLL Function
Pathname=%SYS32%\USER32.DLL
Function Name=GetWindowLongA
Argument List=33
Argument List=21-16
Return Variable=2
Flags=00100000
end
item: Call DLL Function
Pathname=%SYS32%\USER32.DLL
Function Name=SetWindowLongA
Argument List=33
Argument List=21-16,8000,10000,20000,0
Return Variable=2
Flags=00100000
end
item: Remark
end
item: Remark
Text=Set Window to always be on top; "Show Desktop" will not hide the window.
end
item: Call DLL Function
Pathname=%SYS%\user32.dll
Function Name=SetWindowPos
Argument List=33
Argument List=21-1
Argument List=210
Argument List=210
Argument List=210
Argument List=210
Argument List=2167
Return Variable=0
Flags=00100000
end
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ