Note that there are some explanatory texts on larger screens.

plurals
  1. POwinapi: removing decoration
    primarykey
    data
    text
    <p>This looks like a duplicate but hear me first. This is more on the debugging side. I'm trying to remove the borders of my window using the method <a href="https://stackoverflow.com/questions/2398746/removing-window-border/2400467#2400467">here</a>.</p> <p>What are some things that will make these functions not work? Hiding windows using <code>ShowWindow(Handle, SW_HIDE)</code> doesn't work also. I've made my own Window class with many functions so I don't wanna paste my whole code here.</p> <p>Here's my Initialization function for the window:</p> <pre><code>HRESULT SampleWindow::InitializeSimple(SampleWindow* win) { HRESULT hr; HWND hWnd; SampleWindow* sampleWin; sampleWin = new SampleWindow(); aMWindowProps-&gt;Center(); hWnd = CreateWindowEx( NULL, aMWindowProps-&gt;aWindowClass, aMWindowProps-&gt;aWindowTitle, WS_OVERLAPPEDWINDOW, aMWindowProps-&gt;aRealLeft, aMWindowProps-&gt;aRealTop, aMWindowProps-&gt;GetRelativePosWidth(), aMWindowProps-&gt;GetRelativePosHeight(), HWND_DESKTOP, NULL, *aMWindowProps-&gt;aHInstance, sampleWin); aMWindowProps-&gt;aHwnd = &amp;hWnd; hr = hWnd ? S_OK : E_FAIL; win-&gt;aHwnd = &amp;hWnd; //ShowWindow(hWnd, SW_SHOWNORMAL); return hr; } </code></pre> <p><code>WindowProps</code> as you can see contains various info about the window being created. I also have a <code>HWND</code> pointer variable in my class which points to the window handler.</p> <p>Here are some things I've tried on my main, where sw2 is a pointer to my window class:</p> <pre><code> ShowWindow(*sw2-&gt;aHwnd, SW_SHOW); //ShowWindow(*sw2-&gt;aHwnd, nCmdShow); LONG lStyle = GetWindowLong(*sw2-&gt;aHwnd, GWL_STYLE); lStyle &amp;= WS_POPUP; //lStyle &amp;= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU); SetWindowLong(*sw2-&gt;aHwnd, GWL_STYLE, lStyle); //ShowWindow(*sw2-&gt;aHwnd, SW_MINIMIZE); //ShowWindow(*sw2-&gt;aHwnd, SW_HIDE); //ShowWindow(*sw2-&gt;aHwnd, SW_HIDE); //SetWindowLong(*sw2-&gt;aHwnd, GWL_STYLE, GetWindowLong(*sw2-&gt;aHwnd, GWL_STYLE) &amp;&amp; ~ WS_BORDER &amp;&amp; ~ WS_SIZEBOX &amp;&amp; ~ WS_DLGFRAME); SetWindowPos(*sw2-&gt;aHwnd, HWND_TOP, sw2-&gt;aMWindowProps-&gt;aRealLeft, sw2-&gt;aMWindowProps-&gt;aRealTop, sw2-&gt;aMWindowProps-&gt;aRealWidth, sw2-&gt;aMWindowProps-&gt;aRealHeight, SWP_FRAMECHANGED); //LONG lExStyle = GetWindowLong(*sw2-&gt;aHwnd, GWL_EXSTYLE); //lExStyle &amp;= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE); //SetWindowLong(*sw2-&gt;aHwnd, GWL_EXSTYLE, lExStyle); //SetWindowPos(*sw2-&gt;aHwnd, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER); </code></pre> <p>I'd just like some suggestions on where to debug my code. I know the functions work as I've tested it on a much simpler window project (sample project from Microsoft).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload