This example creates a dialog and changes it's border style to non-sizeable with no Minimize or Maximize button.
Dialog>Dialog1
Caption=MyDialog
Top=121
Width=226
Left=77
Height=140
Label=Hello World,40,24
Button=OK,48,48,75,25,2
EndDialog>Dialog1
Let>WS_CAPTION=12582912
Let>WS_MINIMIZEBOX=131072
Let>WS_MAXIMIZEBOX=65536
Let>WS_SYSMENU=524288
Let>WS_THICKFRAME=262144
//change the style of MyDialog to non-sizeable with a system menu,
//but no max or min boxes
Show>Dialog1
LibFunc>user32,FindWindowA,dhwnd,TForm,MyDialog
Let>style={%WS_CAPTION% OR %WS_SYSMENU%}
LibFunc>user32,SetWindowLongA,sres,dhwnd,-16,style
CloseDialog>Dialog1
Show>Dialog1,r
To change the style OR different values together. E.g. to add a Mazimize box:
Let>style={%WS_CAPTION% OR %WS_SYSMENU% OR %WS_MAXIMIZEBOX%}
To have no system menu or Minimize or Mazimize buttons:
Let>style={%WS_CAPTION%}
To make it sizeable:
Let>style={%WS_CAPTION% OR %WS_THICKFRAME%}
Just OR whichever option you want to create the style you want.
Change Border Style of Dialogs
Moderators: Dorian (MJT support), JRL, Phil Pendlebury
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Here's a dialog with no border. It displays for 5 seconds then closes:
Dialog>Dialog1
Caption=MyDialog
Top=121
Width=226
Left=77
Height=140
Label=Hello World,40,24
EndDialog>Dialog1
Let>WS_CAPTION=12582912
Let>WS_MINIMIZEBOX=131072
Let>WS_MAXIMIZEBOX=65536
Let>WS_SYSMENU=524288
Let>WS_THICKFRAME=262144
Let>WS_POPUP=2147483648
Let>WS_CHILD=1073741824
//change the style of MyDialog to non-sizeable with a system menu,
//but no max or min boxes
Show>Dialog1
LibFunc>user32,FindWindowA,dhwnd,TForm,MyDialog
Let>style=WS_CHILD
LibFunc>user32,SetWindowLongA,sres,dhwnd,-16,style
CloseDialog>Dialog1
Show>Dialog1
Wait>5
CloseDialog>Dialog1
Dialog>Dialog1
Caption=MyDialog
Top=121
Width=226
Left=77
Height=140
Label=Hello World,40,24
EndDialog>Dialog1
Let>WS_CAPTION=12582912
Let>WS_MINIMIZEBOX=131072
Let>WS_MAXIMIZEBOX=65536
Let>WS_SYSMENU=524288
Let>WS_THICKFRAME=262144
Let>WS_POPUP=2147483648
Let>WS_CHILD=1073741824
//change the style of MyDialog to non-sizeable with a system menu,
//but no max or min boxes
Show>Dialog1
LibFunc>user32,FindWindowA,dhwnd,TForm,MyDialog
Let>style=WS_CHILD
LibFunc>user32,SetWindowLongA,sres,dhwnd,-16,style
CloseDialog>Dialog1
Show>Dialog1
Wait>5
CloseDialog>Dialog1
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?