Recentemente, considerando a estrutura geral da interface do sistema MIS, decidi usar o MDI Child no módulo MDI Form+, mas o espaço de trabalho do formulário MDI sempre tem bordas grossas irritantes.
Encontrei a solução para a versão C ++ da Internet ontem à tarde e passei algum tempo para traduzi -la em Delphi.
Escreva o seguinte código no formulário MDI:
interface
TfmmAin = classe (tform)
...
Procedimento FormCreate (remetente: Tobject);
...
Privado
...
procedimento criatefwwndproc ();
Procedimento clientWndProc (VAR Mensagem: TMessage);
fim;
Implementação
...
procedimento tfmmAin.createfwndproc;
var
HWND1: HWND;
CCS: TclientCreatestruct;
Começar
ccs.hwindowmenu: = 0;
ccs.idfirstchild: = $ ff00;
hwnd1: = createwindowex (ws_ex_clientEdge,
'Mdiclient', '', ws_child ou ws_visible ou ws_group ou
Ws_tabstop ou ws_clipchildren ou ws_hscroll ou ws_vscroll ou
WS_CLIPSIBLINGS ou MDIS_ALLCHILDSTYLES, 0, 0, ClientWidth,
ClientHeight, Handle, 0, Hinstance, @ccs);
FclientInstance: = ponteiro (getwindowlong (hwnd1, gwl_wndproc));
DestrowWindow (HWND1);
fim;
procedimento tfmmAin.clientWndproc (var mensagem Var: tMessage);
// var
// mydc: hdc;
Começar
if (message.msg = wm_erasebkgnd) então
Começar
// O programa de origem que simula o VCL aqui preenche a área do cliente com a cor de fundo da janela principal.
// Você também pode desenhar um gráfico na área do cliente.
FILLRECT (HDC (message.wparam), clientrect, brow.handle);
// mydc: = twmeraseBkGND (mensagem) .dc;
// bitblt (mydc, (clientwidth - imback.picture.width) div 2,
// (clientHeight - imback.picture.Height) div 2,
// imback.picture.width, imback.picture.height,
// imback.picture.bitmap.canvas.handle, 0, 0, srccopy);
Message.Result: = 1;
fim
outro
Message.Result: = CallWindowProc (FClientInstance, ClientHandle,
Message.msg, message.wparam, message.lparam);
fim;
procedimento tfmmAin.formCreate (remetente: tobject);
Começar
// ********* Removendo Mdichild Border grossa *****************
CreatefWWNDProc ();
SetWindowlong (ClientHandle, gwl_wndproc,
LongInt (MakeObjectInstance (clientWndProc)));
SetWindowlong (ClientHandle, GWL_Exstyle, GetWindowlong (
ClientHandle, gwl_exstyle) e (não ws_ex_clientEdge));
SetWindowPOS (ClientHandle, 0,0,0,0,0, SWP_FRAMECHANGED
ou swp_noactivate ou swp_nomove ou swp_nosize ou swp_nozorder);
// ************************************************** **************
fim;