In pseudocode this looks like: SetLastError(0)Īlso check the documentation for the the return value of SetWindowPos. SetWindowLong returns 0 if the function failed, unless the window style was 0 to begin with, in which case, you need to call SetLastError(0) before the call, and use the result of GetLastError to determine if the call actually failed. The second thing to check is what the return values from those API calls actually is. net's WinForms.) Set a breakpoint at the call to SetWindowLong, or check whether the value of hwnd is 0 before you make the API Calls. The first thing to check is whether the form actually has a window handle in the form load event. There's a bunch of things that could be going wrong here. If this isn't possible is there a way to disable or catch the title bar events, click and dragging it restores the window from full screen (but double clicking it does not maximize it?). I know the Popup window trick where you put a loop after it opens waiting for the window to close but I'm not a fan of DoEvents, just tends to crash the stack, especially on faster machines. I definitely want it to stop processing and wait for input. LStyle = lStyle And Not (WS_BORDER Or WS_DLGFRAME Or WS_MAXIMIZEBOX Or WS_MINIMIZEBOX Or WS_THICKFRAME Or WS_CAPTION)Ĭall SetWindowLong(Me.hwnd, GWL_STYLE, lStyle) LStyle = GetWindowLong(Me.hwnd, GWL_STYLE) SetWindowPos Me.hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER SetWindowLong Me.hwnd, GWL_EXSTYLE, GetWindowLong(Me.hwnd, GWL_EXSTYLE) And Not WS_EX_DLGMODALFRAME These are the API calls I make in the Form_Load event to try to get rid of it: Dim lStyle As Long I open it like this: DoCmd.OpenForm "Modal_Full_Screen", acNormal,, ,, acDialog Borderstyle is set to None, I hid all the title bar controls. I've also disabled any other API subclassing for the window transparency. I have everything working perfectly except for the title bar. I'm trying to replicate a Windows 10 style, full-screen modal dialog with a transparent background.
0 Comments
Leave a Reply. |