Code snippet from MS DXUT framework, showing how to correctly switch to fullscreen mode (without some code for saving current window state):
[pascal] // Going to fullscreen mode
// Hide the window to avoid animation of blank windows
ShowWindow(DXUTGetHWNDDeviceFullScreen, SW_HIDE);

// Set FS window style
SetWindowLong(DXUTGetHWNDDeviceFullScreen, GWL_STYLE, Integer(WS_POPUP or WS_SYSMENU));

// If using the same window for windowed and fullscreen mode, save and remove menu
if (DXUTGetHWNDDeviceFullScreen = DXUTGetHWNDDeviceWindowed) then
begin
hMenu := GetMenu(DXUTGetHWNDDeviceFullScreen);
GetDXUTState.SetMenu(hMenu);
SetMenu(DXUTGetHWNDDeviceFullScreen, 0);
end;

ZeroMemory(@wpFullscreen, SizeOf(TWindowPlacement));
wpFullscreen.length := SizeOf(TWindowPlacement);
GetWindowPlacement(DXUTGetHWNDDeviceFullScreen, @wpFullscreen);
if ((wpFullscreen.flags and WPF_RESTORETOMAXIMIZED) <> 0) then
begin
// Restore the window to normal if the window was maximized then minimized. This causes the
// WPF_RESTORETOMAXIMIZED flag to be set which will cause SW_RESTORE to restore the
// window from minimized to maxmized which isn't what we want
with wpFullscreen do flags := flags and not WPF_RESTORETOMAXIMIZED;
wpFullscreen.showCmd := SW_RESTORE;
SetWindowPlacement(DXUTGetHWNDDeviceFullScreen, @wpFullscreen);
end;
[/pascal]
The main line for you is:
SetWindowLong(DXUTGetHWNDDeviceFullScreen, GWL_STYLE, Integer(WS_POPUP or WS_SYSMENU));