Jump to content
  • Advertisement
Sign in to follow this  
mike74

DialogBox

This topic is 4627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i'm making a game. it's at http://www.coolgroups.com/rr2beta/. when someone runs the game and hits M, it's supposed to pop up a mouse config dialog. it does so on my home PC but not at the library. both systems are windows xp. any ideas why this would be? here's some code: BOOL CALLBACK MouseSensitivityProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: { HWND sliderhwnd = GetDlgItem(hwndDlg, 203); SendMessage( // returns LRESULT in lResult (HWND) sliderhwnd, // handle to destination control (UINT) TBM_SETRANGE, // message ID (WPARAM) TRUE, // = (WPARAM) (BOOL) fRedraw (LPARAM)MAKELONG (1, 11) // = (LPARAM) MAKELONG (lMinimum, lMaximum) ); SendMessage( (HWND) sliderhwnd, (UINT) TBM_SETTICFREQ, (WPARAM) 1, (LPARAM) 0 ); SendMessage((HWND) sliderhwnd, (UINT) TBM_SETPOS, (WPARAM) TRUE, (LPARAM) mousesensitivity ); return TRUE; } case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: case 207: { HWND sliderhwnd = GetDlgItem(hwndDlg, 203); mousesensitivity = SendMessage((HWND) sliderhwnd, (UINT) TBM_GETPOS, 0, 0); EndDialog(hwndDlg, 10); } return TRUE; case 210: EndDialog(hwndDlg, 2); return TRUE; } } return FALSE; } ... case 'M': { themouse->unacquire(); gamestatetype oldgamestate = gamestate; gamestate = MOUSECONFIG; ShowCursor(TRUE); DialogBox( GetModuleHandle(NULL), MAKEINTRESOURCE(200), hWnd, MouseSensitivityProc); ShowCursor(FALSE); gamestate = oldgamestate; themouse->acquire(); return 0; }

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
older versions of Windows do not register all of the common controls, of which the slider control is one. so make sure to call InitCommonControls or InitCommonControlsEx prior to the DialogBox call

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!