<?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[Warum funktioniert das unter NT4.0 aber nicht unter XP Pro?]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe unter Win NT4.0 ein Taskbar Programm geschrieben das wunderbar funktioniert.<br />
Es sitzt am oberen Bildschirmrand und erscheint wenn man mit der Maus ganz nach oben fährt.<br />
Wirklich simpel.</p>
<p>Leider erscheint unter Windows XP Pro schon bei Programm Start ein GPF. Kann das aber nicht näher verfolgen, da<br />
ich nur unter Win NT4.0 arbeite.<br />
Vielleicht kann mir jemand helfen?</p>
<p>Hier ist der code:</p>
<pre><code class="language-asm">.data?

hInstance			dd ?
CommandLine			dd ?
hWnd				dd ?

hIcon		dd ?
hTimer		dd ?
hMenu		dd ?
hBOOL		dd ?
lngWidth		dd ?

.code
WndProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
	;/* Local variables */
	LOCAL point:POINT
	LOCAL rect:RECT

	;/*Note:  used  the style-manager addin (Radasm != default ) */

	mov		eax,uMsg
	.if eax==WM_INITDIALOG
		push		hWin
		pop		hWnd

		;/* our application icon */
		invoke LoadIcon,hInstance,500
		mov hIcon,eax
		invoke SendMessage,hWin,WM_SETICON,NULL,hIcon

		;/* creating the timer, every half-second */
		invoke SetTimer,hWin,hTimer,100, NULL	

		;/* Get the screen width */
		invoke GetWindowRect,NULL,addr rect
		mov edx,rect.right
		mov lngWidth,edx		;/* Screenwidth now stored in our variable */
		;/* Set our dialog position and width */
		invoke SetWindowPos,hWin,HWND_TOPMOST,0,0,addr lngWidth,35,SWP_SHOWWINDOW or SWP_NOACTIVATE

		;/* creating our simple menu  */
		invoke CreatePopupMenu
		mov hMenu,eax
		invoke AppendMenu, hMenu, MF_STRING, IDM_SETTINGS, SADD(&quot;Settings&quot;)
		invoke AppendMenu, hMenu, MF_STRING, IDM_ABOUT, SADD(&quot;About&quot;)
		invoke AppendMenu, hMenu, MF_SEPARATOR, 0, 0
		invoke AppendMenu, hMenu, MF_STRING, IDM_QUIT, SADD(&quot;Quit&quot;)

	.elseif eax==WM_TIMER
		;/* Get user mouse position */
		invoke GetCursorPos,addr point
		mov ebx, point.y	
		.if ebx == 0 	;/*if user mouse is on Screentop then show our taskbar */
			invoke SetWindowPos,hWin,HWND_TOPMOST,0,0,addr lngWidth,35,SWP_SHOWWINDOW or SWP_NOACTIVATE
			mov hBOOL, 0
		.elseif ebx&gt;35 ;/* else we hide the taskbar */
			.if hBOOL != 1		;/* using a simple boolean as a trick to prevent infinite loop */
				invoke SetWindowPos,hWin,HWND_TOPMOST,0,0,addr lngWidth,35,SWP_HIDEWINDOW
				mov hBOOL, 1
			.endif
		.endif	

	.elseif eax==WM_COMMAND
		mov		eax,wParam
		and		eax,0FFFFh
		.if eax==IDM_SETTINGS	
		.elseif eax==IDM_ABOUT
			fn MessageBox,hWin,&quot;This is a little taskbar demo - created for fun.&quot;,&quot;ASMbar by Me&quot;,MB_OK or MB_ICONINFORMATION
		.elseif eax==IDM_QUIT
			invoke SendMessage,hWin,WM_CLOSE,0,0
		.endif

	.elseif eax==WM_LBUTTONDOWN
		;/* drag taskbar */
        	mov eax,lParam
        	invoke PostMessage,hWin,WM_NCLBUTTONDOWN,HTCAPTION,eax

    	.elseif eax==WM_CONTEXTMENU   
    		;/* user right clicks somewhere on the taskbar --&gt; popupmenu */ 
        	mov eax, lParam
        	and eax, 0FFFFh
        	mov ebx, lParam
        	shr ebx, 16
        	invoke TrackPopupMenu, hMenu, TPM_LEFTALIGN, eax, ebx, 0, hWin, 0

	.elseif eax==WM_CLOSE
		;/* kill timer on exit */
		invoke KillTimer, hWin, hTimer
		invoke DestroyWindow,hWin
	.elseif uMsg==WM_DESTROY
		invoke PostQuitMessage,NULL
	.else
		invoke DefWindowProc,hWin,uMsg,wParam,lParam
		ret
	.endif
	xor    eax,eax
	ret

WndProc endp
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/83022/warum-funktioniert-das-unter-nt4-0-aber-nicht-unter-xp-pro</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 09:19:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/83022.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Aug 2004 07:24:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Warum funktioniert das unter NT4.0 aber nicht unter XP Pro? on Tue, 17 Aug 2004 07:24:37 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe unter Win NT4.0 ein Taskbar Programm geschrieben das wunderbar funktioniert.<br />
Es sitzt am oberen Bildschirmrand und erscheint wenn man mit der Maus ganz nach oben fährt.<br />
Wirklich simpel.</p>
<p>Leider erscheint unter Windows XP Pro schon bei Programm Start ein GPF. Kann das aber nicht näher verfolgen, da<br />
ich nur unter Win NT4.0 arbeite.<br />
Vielleicht kann mir jemand helfen?</p>
<p>Hier ist der code:</p>
<pre><code class="language-asm">.data?

hInstance			dd ?
CommandLine			dd ?
hWnd				dd ?

hIcon		dd ?
hTimer		dd ?
hMenu		dd ?
hBOOL		dd ?
lngWidth		dd ?

.code
WndProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
	;/* Local variables */
	LOCAL point:POINT
	LOCAL rect:RECT

	;/*Note:  used  the style-manager addin (Radasm != default ) */

	mov		eax,uMsg
	.if eax==WM_INITDIALOG
		push		hWin
		pop		hWnd

		;/* our application icon */
		invoke LoadIcon,hInstance,500
		mov hIcon,eax
		invoke SendMessage,hWin,WM_SETICON,NULL,hIcon

		;/* creating the timer, every half-second */
		invoke SetTimer,hWin,hTimer,100, NULL	

		;/* Get the screen width */
		invoke GetWindowRect,NULL,addr rect
		mov edx,rect.right
		mov lngWidth,edx		;/* Screenwidth now stored in our variable */
		;/* Set our dialog position and width */
		invoke SetWindowPos,hWin,HWND_TOPMOST,0,0,addr lngWidth,35,SWP_SHOWWINDOW or SWP_NOACTIVATE

		;/* creating our simple menu  */
		invoke CreatePopupMenu
		mov hMenu,eax
		invoke AppendMenu, hMenu, MF_STRING, IDM_SETTINGS, SADD(&quot;Settings&quot;)
		invoke AppendMenu, hMenu, MF_STRING, IDM_ABOUT, SADD(&quot;About&quot;)
		invoke AppendMenu, hMenu, MF_SEPARATOR, 0, 0
		invoke AppendMenu, hMenu, MF_STRING, IDM_QUIT, SADD(&quot;Quit&quot;)

	.elseif eax==WM_TIMER
		;/* Get user mouse position */
		invoke GetCursorPos,addr point
		mov ebx, point.y	
		.if ebx == 0 	;/*if user mouse is on Screentop then show our taskbar */
			invoke SetWindowPos,hWin,HWND_TOPMOST,0,0,addr lngWidth,35,SWP_SHOWWINDOW or SWP_NOACTIVATE
			mov hBOOL, 0
		.elseif ebx&gt;35 ;/* else we hide the taskbar */
			.if hBOOL != 1		;/* using a simple boolean as a trick to prevent infinite loop */
				invoke SetWindowPos,hWin,HWND_TOPMOST,0,0,addr lngWidth,35,SWP_HIDEWINDOW
				mov hBOOL, 1
			.endif
		.endif	

	.elseif eax==WM_COMMAND
		mov		eax,wParam
		and		eax,0FFFFh
		.if eax==IDM_SETTINGS	
		.elseif eax==IDM_ABOUT
			fn MessageBox,hWin,&quot;This is a little taskbar demo - created for fun.&quot;,&quot;ASMbar by Me&quot;,MB_OK or MB_ICONINFORMATION
		.elseif eax==IDM_QUIT
			invoke SendMessage,hWin,WM_CLOSE,0,0
		.endif

	.elseif eax==WM_LBUTTONDOWN
		;/* drag taskbar */
        	mov eax,lParam
        	invoke PostMessage,hWin,WM_NCLBUTTONDOWN,HTCAPTION,eax

    	.elseif eax==WM_CONTEXTMENU   
    		;/* user right clicks somewhere on the taskbar --&gt; popupmenu */ 
        	mov eax, lParam
        	and eax, 0FFFFh
        	mov ebx, lParam
        	shr ebx, 16
        	invoke TrackPopupMenu, hMenu, TPM_LEFTALIGN, eax, ebx, 0, hWin, 0

	.elseif eax==WM_CLOSE
		;/* kill timer on exit */
		invoke KillTimer, hWin, hTimer
		invoke DestroyWindow,hWin
	.elseif uMsg==WM_DESTROY
		invoke PostQuitMessage,NULL
	.else
		invoke DefWindowProc,hWin,uMsg,wParam,lParam
		ret
	.endif
	xor    eax,eax
	ret

WndProc endp
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/584334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/584334</guid><dc:creator><![CDATA[Blumentopf]]></dc:creator><pubDate>Tue, 17 Aug 2004 07:24:37 GMT</pubDate></item></channel></rss>