NSIs Untitled window Movement
After the previous few, we loaded the background image, removed the original borders, controls, etc., and you found that when the mouse clicked on the window title bar, the window cannot be moved. Next, look at how our window implements the window movement. The subtext of the untitled move is to pass the message that was originally passed to the title bar to the title bar through your defined element callback, so just add the resources you added and the callback function to pass the message. Here is done by winproc this plugin.
Here we define a function callback to implement the window move operation
Function onguicallback
${if} $MSG = ${wm_lbuttondown}
SendMessage $HWNDPARENT ${wm_nclbuttondown} ${htcaption } $
${endif}
functionend
; The above is a callback function that determines the down event of the left mouse button and passes the message to the title bar.
Getfunctionaddress $ onguicallback
wndproc::oncallback $BGImage; handles borderless form movement; the
above is the current $bgimage as the callback body, When the user left click on the $bgimage, the message is passed to the form title bar, to achieve a borderless movement.
Let's look at the effect diagram:
Note: In the source code, the beginning of the section defines two variables:
var MSG, var Dialog.
The MSG variable is used in the move callback function, the dialog variable is not explicitly used, and if the $dialog variable is not declared, controlling the display of the graphic in the button's click event is not valid. (This is a personal practice, not an official explanation)