Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 900
  • Last Modified:

Limit resizing a window and sizing controls on a window


i need to know how i can limit resizing of a window and when resizing the window, also some controls resize too.

Does anyone know where i can find information about the event (pbm_xxx) listed in the event id box? What means all this events?

1 Solution
You have to write scripts in 2 events on your window.
1.to limit resizing of your window.
you have to new user event.
event name: getminmaxinfo (long minmaxinfo)
event id: pbm_getminmaxinfo

this event has only one long argument for setting min-size, max-size of your window that you allow user to resize.

the problem is minmaxinfo a structure but pb cast it to long(pointer to memory). you need a trick to set these values in this long.

here are structures to be used for this event:
str_POINTAPI        ptReserved
str_POINTAPI        ptMaxSize
str_POINTAPI        ptMaxPosition
str_POINTAPI        ptMinTrackSize
str_POINTAPI        ptMaxTrackSize

    long x
    long y

I see 2 styles of programming to manage this long argument.
-1.make a DLL to set this value for you. see my demo stuff.

-2.use only powerscript, eric's stuff. you will see more information and download demo here.

2.for resizing your controls in that window.
pb already define this event.
event name: resize(sizetype, newwidth, newheight)
event id: pbm_resize

in this event you should to choose-case
if sizetype is
0 — (SIZE_RESTORED) ... resize your controls
1 — (SIZE_MINIMIZED) .... you should not resize your controls for this case.
2 — (SIZE_MAXIMIZED) ... resize your controls
3 — (SIZE_MAXSHOW) ... resize your controls
4 — (SIZE_MAXHIDE)  .... you should not resize your controls for this case.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now