by
Eric Peachey >> Wed, 15 Dec 1999 21:00:31 GMT
Hello Brendan,
1. I want to create a form without a title bar and create my own (with rounded corners etc). What I want to be able to do is to allow the user to click and hold on the replacement title bar and allow the form to be dragged (but only when the replacement title bar is clicked). Can anyone tell me how to do this?
I think all you need to do is defined below. Somebody else gave me these so can't answer detailed questions.
Eric in Dunedin
This is the mouse down event for your picture control (your new gucci title bar thing say):
picGucciTitlebar_mouseDown(pict: Picture input; button: Integer; shift: Integer;
x: Real; y: Real) updating;
vars
begin
moveForm(self.hwnd);
end;
This is the moveForm method:
moveForm(hwnd:Integer);
constants
WM_SYSCOMMAND : Integer = #112;
WM_LBUTTONUP : Integer = #202;
MOUSE_MOVE : Integer = #f012;
SC_MOVE : Integer = #f010;
vars
begin
// This method allows for the movement of a form by directly accessing windows - the same as would happen
// if you clicked and dragged the standard windows blue tool bar at the top of each form. This method gives
// the ability to suppress the windows blue toolbar and use your own layout instead. If you turn off the
// pc's control panel setting to 'show windows while dragging', the movement will show a phantom rectangle
// being moved around the screen.
// To set up the external function do the following:
// 1) Go to External Function browser
// 2) Add library - user32
// 3) Add external function - name = sendMessage
// entry point = sendMessage
// library = user32
// 4) Define sendMessage signature as follows:
// sendMessage(hwnd:Integer;msg:Integer;lParam:Integer;wParam:Integer):Integer is SendMessageA in user32
call sendMessage(hwnd,WM_LBUTTONUP,0,0);
call sendMessage(hwnd,WM_SYSCOMMAND,MOUSE_MOVE,0);
end;
The sendMessage external function (may already be defined in RootSchema (was in Jade 4.2 anyway)
sendMessage(hwnd:Integer; msg:Integer; wparam:Integer; lparam:Integer):Integer is SendMessageA in user32;