<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SetScrollRange(...)]]></title><description><![CDATA[<p>Ich habe mit dem Ressourceneditor einen Dialog mit Scrollbars erzeugt.<br />
Nun will ich mit</p>
<pre><code>SetScrollRange(GetDlgItem(hwnd,IDC_SCROLLBAR1),SB_CTL,0,255,FALSE);
</code></pre>
<p>den Range einstellen. Mein Scrollbar macht aber nichts dergleichen.</p>
<p>(Bin ich normal?) <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Nee, was mach ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/79316/setscrollrange</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 20:09:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/79316.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Jul 2004 19:48:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SetScrollRange(...) on Fri, 09 Jul 2004 19:48:28 GMT]]></title><description><![CDATA[<p>Ich habe mit dem Ressourceneditor einen Dialog mit Scrollbars erzeugt.<br />
Nun will ich mit</p>
<pre><code>SetScrollRange(GetDlgItem(hwnd,IDC_SCROLLBAR1),SB_CTL,0,255,FALSE);
</code></pre>
<p>den Range einstellen. Mein Scrollbar macht aber nichts dergleichen.</p>
<p>(Bin ich normal?) <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Nee, was mach ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557128</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557128</guid><dc:creator><![CDATA[scheissPi-ber**]]></dc:creator><pubDate>Fri, 09 Jul 2004 19:48:28 GMT</pubDate></item><item><title><![CDATA[Reply to SetScrollRange(...) on Sat, 10 Jul 2004 08:21:39 GMT]]></title><description><![CDATA[<p>Was liefert der Aufruf zurück? Evtl. dann noch GetLastError befragen?<br />
Oder mal hinten TRUE statt FALSE angeben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557273</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sat, 10 Jul 2004 08:21:39 GMT</pubDate></item><item><title><![CDATA[Reply to SetScrollRange(...) on Sat, 10 Jul 2004 15:46:21 GMT]]></title><description><![CDATA[<p>Der Aufruf liefert: true<br />
GetLastError liefert: Ungültiges Fensterhandle</p>
<p>Es spielt auch keine Rolle ob true oder false steht.</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557576</guid><dc:creator><![CDATA[scheissPi-ber**]]></dc:creator><pubDate>Sat, 10 Jul 2004 15:46:21 GMT</pubDate></item><item><title><![CDATA[Reply to SetScrollRange(...) on Sat, 10 Jul 2004 18:52:01 GMT]]></title><description><![CDATA[<p>scheissPi-ber[] schrieb:</p>
<blockquote>
<p>Der Aufruf liefert: true</p>
</blockquote>
<blockquote>
<p>If the function succeeds, the return value is nonzero.</p>
</blockquote>
<p>Demnach scheint der Aufruf ja erfolgreich gewesen zu sein - der Fehler mit dem ungültigen Fensterhandle scheint also nichts damit zu tun zu haben, oder doch?</p>
<p>scheissPi-ber[] schrieb:</p>
<blockquote>
<p>GetLastError liefert: Ungültiges Fensterhandle</p>
</blockquote>
<p>Dann scheinst du bei GetDlgItem(hwnd,IDC_SCROLLBAR1) etwas falsch zu machen. Entweder ist hwnd nicht das Parent der Scrollbar, oder deine ID ist falsch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /><br />
Ermittle mal das Fenster-Handle vorher in einem extra Aufruf und prüfe, ob es gültig ist (ungleich NULL).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557714</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557714</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sat, 10 Jul 2004 18:52:01 GMT</pubDate></item><item><title><![CDATA[Reply to SetScrollRange(...) on Sat, 10 Jul 2004 22:23:39 GMT]]></title><description><![CDATA[<p>hmm ich denke diese Prob kanns auch nicht sein: Ich habe eine Zeile davor mal ein ShowScrollbar(GetDlgItem(hwnd,IDC_SCROLLBAR1),SB_CTL,false); gemacht und das hat auch geklappt.</p>
<p>tja ich poste mal den code...villeicht ist sonst auch was voll falsch ;)!!</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;

#include &quot;resource.h&quot;

LRESULT CALLBACK WindProc (HWND, UINT, WPARAM, LPARAM) ;

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
    static TCHAR szAppName[] = TEXT (&quot;DIALOG01&quot;) ;

    HWND hwnd;
    MSG msg;
    WNDCLASS windclass;

    windclass.style         = CS_HREDRAW | CS_VREDRAW;
    windclass.lpfnWndProc   = WindProc; 
    windclass.cbClsExtra    = 0;
    windclass.cbWndExtra    = DLGWINDOWEXTRA;    
    windclass.hInstance     = hInstance ;
    windclass.hIcon         = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON));
    windclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
    windclass.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1) ;
    windclass.lpszMenuName  = NULL;
    windclass.lpszClassName = szAppName ;

    if (!RegisterClass(&amp;windclass))
        return 0 ;

    hwnd = CreateDialog(hInstance, szAppName, NULL,NULL) ; 

    InitCommonControls();    
	ShowWindow (hwnd, iCmdShow);

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
	//ShowScrollBar(GetDlgItem(hwnd,IDC_SCROLLBAR1),SB_CTL,false); //funktoniert normal
	if(SetScrollRange(GetDlgItem(hwnd,IDC_SCROLLBAR1),SB_CTL,1,100,true)){
		MessageBox(hwnd,&quot;hat funktioniert&quot;,&quot;Juhu&quot;,NULL);
		if(GetDlgItem(hwnd,IDC_SCROLLBAR1) != NULL)
			MessageBox(hwnd,&quot;GetDlgItem(hwnd,IDC_SCROLLBAR1) ist OK&quot;,&quot;OK&quot;,NULL);
		if(hwnd != NULL)
			MessageBox(hwnd,&quot;hwnd ist OK&quot;,&quot;OK&quot;,NULL);
		else{}
	}
	else
		MessageBox(hwnd,&quot;shit&quot;,&quot;voll fuck&quot;,NULL);

	DWORD dwError = GetLastError();
	HLOCAL hlocal = NULL;

	BOOL fOk = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
		NULL,
		dwError,
		MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT),
		(PTSTR)&amp;hlocal,
		0,
		NULL);
	MessageBox(hwnd,(PTSTR)hlocal,&quot;scheisse&quot;,NULL);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

	UpdateWindow(hwnd);

	while (GetMessage (&amp;msg, NULL, 0, 0)) 
    {
        TranslateMessage (&amp;msg) ;
        DispatchMessage (&amp;msg) ;
    }
    return msg.wParam ;
}

LRESULT CALLBACK WindProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
        case WM_CREATE:
			{
			}
        break;
        case WM_DESTROY:
            PostQuitMessage(0);
        break;
		return 0 ;
    }
    return DefWindowProc (hwnd, message, wParam, lParam) ;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/557851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557851</guid><dc:creator><![CDATA[scheissPi-ber**]]></dc:creator><pubDate>Sat, 10 Jul 2004 22:23:39 GMT</pubDate></item><item><title><![CDATA[Reply to SetScrollRange(...) on Sun, 11 Jul 2004 11:00:22 GMT]]></title><description><![CDATA[<p>- Du registrierst unnötiger Weise eine Fensterklasse (du erstellst ja nur den Dialog)<br />
- Du hast unnötiger Weise eine WndProc, dir fehlt aber eine DialogProc (musst du dann auch noch bei CreateDialog angeben)</p>
<p>Ggf. wäre es für dich hier einfacher DialogBox anstelle von CreateDialog zu verwenden (wenn du nur ein Fenster hast ist doch eigentlich modal oder nicht modal egal).<br />
Ansonsten solltest du dir mal <a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/usingdialogboxes.asp" rel="nofollow">hier</a> die Code-Samples anschauen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/557963</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557963</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 11 Jul 2004 11:00:22 GMT</pubDate></item><item><title><![CDATA[Reply to SetScrollRange(...) on Sun, 11 Jul 2004 11:16:49 GMT]]></title><description><![CDATA[<p>thx...^^<br />
ich habe eben diese Version in einem Winapi tutorial gelesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/557972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/557972</guid><dc:creator><![CDATA[scheissPi-ber**]]></dc:creator><pubDate>Sun, 11 Jul 2004 11:16:49 GMT</pubDate></item><item><title><![CDATA[Reply to SetScrollRange(...) on Sun, 11 Jul 2004 11:51:28 GMT]]></title><description><![CDATA[<p>Läuft es jetzt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/558003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/558003</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 11 Jul 2004 11:51:28 GMT</pubDate></item><item><title><![CDATA[Reply to SetScrollRange(...) on Sun, 11 Jul 2004 12:07:21 GMT]]></title><description><![CDATA[<p>tja ich mache es jetzt mit CreateWindow(..) (und DialogBox(..))<br />
Ich verstehe nur nicht das man Tutorials schreibt bei welchen man nicht mal einen Scrollbar richtig benutzen kann <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> (oder villeicht liegt es einfach an mir <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> )</p>
<p>Und jetzt geht es auch!!!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/558017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/558017</guid><dc:creator><![CDATA[scheissPi-ber**]]></dc:creator><pubDate>Sun, 11 Jul 2004 12:07:21 GMT</pubDate></item></channel></rss>