#### Archived

This topic is now archived and is closed to further replies.

# Win32: Dumb question but...

## Recommended Posts

PHRICTION    122
I am embarrased to ask this, but I cannot find any explanation. I have an app that calls SetWindowLong GWL_STYLE to change the window style. Im learning Direct3D and its going from fullscreen, to windowed. Everything seems to work perfectly, except I always hear a windows default sound when it is called. But that isn''t all. I only hear it when SetWindowLong is called with WS_SYSMENU. There are no errors; I check the return value, and GetLastError, along with checking the return values of all the other major API calls in program. And I am fairly positive that it is caused by SetWindowLong. Again, the every thing looks like it works perfectly. It goes into windowed mode without any hitches, but that beep is making me paranoid. Any ideas?

#### Share this post

##### Share on other sites
foofightr    130
Does the sound come from the internal PC speaker, or the sound card?

#### Share this post

##### Share on other sites
PHRICTION    122
From the sound card.

Sorry, type above. It is the windows default beep sound, not "windows default sound".

[edited by - phriction on August 12, 2003 5:04:23 PM]

#### Share this post

##### Share on other sites
Martel    122
Are you using a keypress to switch modes? I don''t remember why, but I remember getting that before and it turned out to be that I was pressing some sys key that just happened to generate a "don''t do that" sound completely separate to whatever I was doing.

If you step over the code in the debugger, do you still get it?

#### Share this post

##### Share on other sites
PHRICTION    122
Hmm. If I step over SetWindowLong I am still getting the beep. I am using a keypress. I want it to toggle to fullscreen on an ALT-ENTER.

Here is the code in my window procedure:

case WM_SYSKEYDOWN:	//--------------------------------------------	//Fullscreen toggle	if( (lParam & 0x20000000) && (wParam == VK_RETURN) )	{		if( !D3DCode.MakeFullScreen() )		{			exit(EXIT_FAILURE);		}	}	break;

D3DCode being a class containing all the direct3d stuff in my app. I am not positive if that is the correct way to process a alt-enter. I do only get the beep going from fullscreen to windowed, and not fron windowed to fullscreen.

Thanks for the response.

edit: sorry, forgot the source tags. edit2: coherence. =)

[edited by - phriction on August 13, 2003 1:00:20 AM]

[edited by - phriction on August 13, 2003 1:04:16 AM]