Mini size restricted window in PB

xiaoxiao2021-03-06  41

1. Define structures, external functions

TYPE POINT

From structure

Long x

Long Y

End Type

Type MinMaxInfo

From structure

Point ptreserved

Point PTMAXSIZE

Point ptmaxposition

Point Ptmintracksize

Point PTMaxTracksize

End Type

Subroutine getminmaxinfo

Ref minMaxinfo D,

Long S,

Long L)

Library 'kernel32.dll'

Alias ​​for RTLMoveMemory

Subroutine setminMaxInfo

Long D, MinMaxInfo S,

Long L)

Library 'kernel32.dll'

Alias ​​for RTLMoveMemory

2. Define variables as the minimum width and height of the window (MIN size)

Long il_orig_width = 400, IL_ORIG_HEIGHT = 400

3. Custom event UE_MINMAXINFO (PBM_GETMINMAXINFO)

MinMaxInfo LSTR_MINMAXINFO

/ * Copy The Data, Pointed by The Argument MinMaxInfo, To Our Lstr_MinMaxInfo Structure * /

GetminMaxInfo (LSTR_MINMAXINFO, MinMaxInfo, 40)

/ * SET the minimal size for company window * /

LSTR_MINMAXINFO.PTMINTRACKSIZE.X = UnitStopixels (il_orig_width, xunitstopixels!)

LSTR_MINMAXINFO.PTMINTRACKSIZE.Y = UnitStopixels (Il_orig_height, YunitStopixels!)

/ * COPY The Structure Back Into Memory At the Same Place * /

SETMINMAXINFO (MinMaxInfo, LSTR_MINMAXINFO, 40)

/ * Important, According to the MS API, WE MUST RETURN 0 * /

Return 0

转载请注明原文地址:https://www.9cbs.com/read-112286.html

New Post(0)