diff --git a/reactos/base/applications/games/winmine/CMakeLists.txt b/reactos/base/applications/games/winmine/CMakeLists.txt index baa1856c6ce..30cdd66e93c 100644 --- a/reactos/base/applications/games/winmine/CMakeLists.txt +++ b/reactos/base/applications/games/winmine/CMakeLists.txt @@ -7,7 +7,7 @@ list(APPEND SOURCE main.h) add_executable(winmine ${SOURCE} rsrc.rc) -set_module_type(winmine win32gui) +set_module_type(winmine win32gui UNICODE) target_link_libraries(winmine wine) add_importlibs(winmine user32 gdi32 advapi32 shell32 msvcrt kernel32 ntdll) add_pch(winmine main.h SOURCE) diff --git a/reactos/base/applications/games/winmine/dialog.c b/reactos/base/applications/games/winmine/dialog.c index 1ed5339cafa..3f632ae8cad 100644 --- a/reactos/base/applications/games/winmine/dialog.c +++ b/reactos/base/applications/games/winmine/dialog.c @@ -59,16 +59,15 @@ INT_PTR CALLBACK CongratsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lP switch( uMsg ) { case WM_INITDIALOG: p_board = (BOARD*) lParam; - SetDlgItemText( hDlg, IDC_EDITNAME, - p_board->best_name[p_board->difficulty] ); + SetDlgItemTextW( hDlg, IDC_EDITNAME, p_board->best_name[p_board->difficulty] ); return TRUE; case WM_COMMAND: switch( LOWORD( wParam ) ) { case IDOK: - GetDlgItemText( hDlg, IDC_EDITNAME, - p_board->best_name[p_board->difficulty], - sizeof( p_board->best_name[p_board->difficulty] ) ); + GetDlgItemTextW( hDlg, IDC_EDITNAME, + p_board->best_name[p_board->difficulty], + sizeof( p_board->best_name[p_board->difficulty] ) / sizeof(WCHAR) ); EndDialog( hDlg, 0 ); return TRUE; @@ -92,7 +91,7 @@ INT_PTR CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara /* set best names */ for( i = 0; i < 3; i++ ) - SetDlgItemText( hDlg, (IDC_NAME1) + i, p_board->best_name[i] ); + SetDlgItemTextW( hDlg, (IDC_NAME1) + i, p_board->best_name[i] ); /* set best times */ for( i = 0; i < 3; i++ ) diff --git a/reactos/base/applications/games/winmine/lang/bg-BG.rc b/reactos/base/applications/games/winmine/lang/bg-BG.rc index 458a7f898b9..174554d29f7 100644 --- a/reactos/base/applications/games/winmine/lang/bg-BG.rc +++ b/reactos/base/applications/games/winmine/lang/bg-BG.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "На&стройки" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/cs-CZ.rc b/reactos/base/applications/games/winmine/lang/cs-CZ.rc index 8fc6d1b9cad..aeb81b45bf9 100644 --- a/reactos/base/applications/games/winmine/lang/cs-CZ.rc +++ b/reactos/base/applications/games/winmine/lang/cs-CZ.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "N&astavení" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/da-DK.rc b/reactos/base/applications/games/winmine/lang/da-DK.rc index ee8b3692b04..4ed7225a7b4 100644 --- a/reactos/base/applications/games/winmine/lang/da-DK.rc +++ b/reactos/base/applications/games/winmine/lang/da-DK.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Ophavsret 2000 tilhører Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Indstillinger" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/de-DE.rc b/reactos/base/applications/games/winmine/lang/de-DE.rc index 15c8a508c3f..fb4d95224ba 100644 --- a/reactos/base/applications/games/winmine/lang/de-DE.rc +++ b/reactos/base/applications/games/winmine/lang/de-DE.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Optionen" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/en-US.rc b/reactos/base/applications/games/winmine/lang/en-US.rc index 942ae3f10d4..ade14cb86b7 100644 --- a/reactos/base/applications/games/winmine/lang/en-US.rc +++ b/reactos/base/applications/games/winmine/lang/en-US.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Options" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/es-ES.rc b/reactos/base/applications/games/winmine/lang/es-ES.rc index ade1e3b87e6..e8905e51012 100644 --- a/reactos/base/applications/games/winmine/lang/es-ES.rc +++ b/reactos/base/applications/games/winmine/lang/es-ES.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Opciones" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/fi-FI.rc b/reactos/base/applications/games/winmine/lang/fi-FI.rc index e5ef3fb05f3..532e96d4c10 100644 --- a/reactos/base/applications/games/winmine/lang/fi-FI.rc +++ b/reactos/base/applications/games/winmine/lang/fi-FI.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Valinnat" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/fr-FR.rc b/reactos/base/applications/games/winmine/lang/fr-FR.rc index e1487a1a0ce..8714aee56cd 100644 --- a/reactos/base/applications/games/winmine/lang/fr-FR.rc +++ b/reactos/base/applications/games/winmine/lang/fr-FR.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Options" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/he-IL.rc b/reactos/base/applications/games/winmine/lang/he-IL.rc index e20c2505df8..e4ad8baec6f 100644 --- a/reactos/base/applications/games/winmine/lang/he-IL.rc +++ b/reactos/base/applications/games/winmine/lang/he-IL.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&אפשרויות" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/it-IT.rc b/reactos/base/applications/games/winmine/lang/it-IT.rc index 53bf2bee83c..83ce838f3ed 100644 --- a/reactos/base/applications/games/winmine/lang/it-IT.rc +++ b/reactos/base/applications/games/winmine/lang/it-IT.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Opzioni" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/ja-JP.rc b/reactos/base/applications/games/winmine/lang/ja-JP.rc index c34175ab729..f14a42742a3 100644 --- a/reactos/base/applications/games/winmine/lang/ja-JP.rc +++ b/reactos/base/applications/games/winmine/lang/ja-JP.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "オプション(&O)" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/ko-KR.rc b/reactos/base/applications/games/winmine/lang/ko-KR.rc index bb054adfd62..f8fcec8fc12 100644 --- a/reactos/base/applications/games/winmine/lang/ko-KR.rc +++ b/reactos/base/applications/games/winmine/lang/ko-KR.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "옵션(&O)" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/lt-LT.rc b/reactos/base/applications/games/winmine/lang/lt-LT.rc index 1c1d92aabbb..c251c50fc3d 100644 --- a/reactos/base/applications/games/winmine/lang/lt-LT.rc +++ b/reactos/base/applications/games/winmine/lang/lt-LT.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Autoriaus teisės 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Parinktys" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/nl-NL.rc b/reactos/base/applications/games/winmine/lang/nl-NL.rc index 41c55aaf1f9..e7ad805bb2d 100644 --- a/reactos/base/applications/games/winmine/lang/nl-NL.rc +++ b/reactos/base/applications/games/winmine/lang/nl-NL.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Opties" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/no-NO.rc b/reactos/base/applications/games/winmine/lang/no-NO.rc index 9b39cb7a3be..a4a827edd79 100644 --- a/reactos/base/applications/games/winmine/lang/no-NO.rc +++ b/reactos/base/applications/games/winmine/lang/no-NO.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Kopirett 2000 tilhører Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Innstillinger" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/pl-PL.rc b/reactos/base/applications/games/winmine/lang/pl-PL.rc index bd75f8b76ae..44f55aa615c 100644 --- a/reactos/base/applications/games/winmine/lang/pl-PL.rc +++ b/reactos/base/applications/games/winmine/lang/pl-PL.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Opcje" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/pt-PT.rc b/reactos/base/applications/games/winmine/lang/pt-PT.rc index 50086f50bfc..a5d3718a892 100644 --- a/reactos/base/applications/games/winmine/lang/pt-PT.rc +++ b/reactos/base/applications/games/winmine/lang/pt-PT.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Opções" BEGIN @@ -38,7 +38,7 @@ BEGIN IDS_ABOUT "Direitos de autor 2000, Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Opções" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/ro-RO.rc b/reactos/base/applications/games/winmine/lang/ro-RO.rc index fd10bbca33f..d1995badaf2 100644 --- a/reactos/base/applications/games/winmine/lang/ro-RO.rc +++ b/reactos/base/applications/games/winmine/lang/ro-RO.rc @@ -8,7 +8,7 @@ BEGIN IDS_ABOUT "Drept de autor 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "J&oc" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/ru-RU.rc b/reactos/base/applications/games/winmine/lang/ru-RU.rc index 2c41c7a5908..375e6221d1f 100644 --- a/reactos/base/applications/games/winmine/lang/ru-RU.rc +++ b/reactos/base/applications/games/winmine/lang/ru-RU.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Игра" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/sl-SI.rc b/reactos/base/applications/games/winmine/lang/sl-SI.rc index 83369935c75..7fefdd22da1 100644 --- a/reactos/base/applications/games/winmine/lang/sl-SI.rc +++ b/reactos/base/applications/games/winmine/lang/sl-SI.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Možnosti" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/sq-AL.rc b/reactos/base/applications/games/winmine/lang/sq-AL.rc index bfef7ac317d..e5baf57666e 100644 --- a/reactos/base/applications/games/winmine/lang/sq-AL.rc +++ b/reactos/base/applications/games/winmine/lang/sq-AL.rc @@ -11,7 +11,7 @@ BEGIN IDS_ABOUT "Te Drejtat 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Opsione" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/sv-SE.rc b/reactos/base/applications/games/winmine/lang/sv-SE.rc index 92685a21b64..cfe1c2184fb 100644 --- a/reactos/base/applications/games/winmine/lang/sv-SE.rc +++ b/reactos/base/applications/games/winmine/lang/sv-SE.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "A<ernativ" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/tr-TR.rc b/reactos/base/applications/games/winmine/lang/tr-TR.rc index cc962c564aa..a7e2f21958e 100644 --- a/reactos/base/applications/games/winmine/lang/tr-TR.rc +++ b/reactos/base/applications/games/winmine/lang/tr-TR.rc @@ -9,7 +9,7 @@ BEGIN IDS_ABOUT "Telif Hakkı: 2000 - Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Seçenekler" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/uk-UA.rc b/reactos/base/applications/games/winmine/lang/uk-UA.rc index 034a53ea34e..2f567cc98ae 100644 --- a/reactos/base/applications/games/winmine/lang/uk-UA.rc +++ b/reactos/base/applications/games/winmine/lang/uk-UA.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "&Гра" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/zh-CN.rc b/reactos/base/applications/games/winmine/lang/zh-CN.rc index dcbd9240fe6..27e6c1f56be 100644 --- a/reactos/base/applications/games/winmine/lang/zh-CN.rc +++ b/reactos/base/applications/games/winmine/lang/zh-CN.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "选项(&O)" BEGIN diff --git a/reactos/base/applications/games/winmine/lang/zh-TW.rc b/reactos/base/applications/games/winmine/lang/zh-TW.rc index dc07ab86da9..cb214cd19bc 100644 --- a/reactos/base/applications/games/winmine/lang/zh-TW.rc +++ b/reactos/base/applications/games/winmine/lang/zh-TW.rc @@ -7,7 +7,7 @@ BEGIN IDS_ABOUT "Copyright 2000 Joshua Thielen" END -MENU_WINEMINE MENU +IDM_WINEMINE MENU BEGIN POPUP "選項(&O)" BEGIN diff --git a/reactos/base/applications/games/winmine/main.c b/reactos/base/applications/games/winmine/main.c index 477e9c043c6..fedd728f951 100644 --- a/reactos/base/applications/games/winmine/main.c +++ b/reactos/base/applications/games/winmine/main.c @@ -32,8 +32,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(winemine); static const DWORD wnd_style = WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME & ~WS_MAXIMIZEBOX; -static const char* registry_key = "Software\\Microsoft\\WinMine"; +static const WCHAR registry_key[] = {'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','M','i','n','e',0}; +static const WCHAR xposW[] = {'X','p','o','s',0}; +static const WCHAR yposW[] = {'Y','p','o','s',0}; +static const WCHAR heightW[] = {'H','e','i','g','h','t',0}; +static const WCHAR widthW[] = {'W','i','d','t','h',0}; +static const WCHAR minesW[] = {'M','i','n','e','s',0}; +static const WCHAR difficultyW[] = {'D','i','f','f','i','c','u','l','t','y',0}; +static const WCHAR markW[] = {'M','a','r','k',0}; +static const WCHAR nameW[] = {'N','a','m','e','%','u',0}; +static const WCHAR timeW[] = {'T','i','m','e','%','u',0}; void CheckLevel( BOARD *p_board ) { @@ -61,62 +72,61 @@ static void LoadBoard( BOARD *p_board ) DWORD size; DWORD type; HKEY hkey; - char data[MAX_PLAYER_NAME_SIZE+1]; - char key_name[8]; + WCHAR data[MAX_PLAYER_NAME_SIZE+1]; + WCHAR key_name[8]; unsigned i; - RegOpenKeyEx( HKEY_CURRENT_USER, registry_key, - 0, KEY_QUERY_VALUE, &hkey ); + RegOpenKeyExW( HKEY_CURRENT_USER, registry_key, 0, KEY_QUERY_VALUE, &hkey ); size = sizeof( p_board->pos.x ); - if( !RegQueryValueEx( hkey, "Xpos", NULL, &type, + if( !RegQueryValueExW( hkey, xposW, NULL, &type, (LPBYTE) &p_board->pos.x, &size ) == ERROR_SUCCESS ) p_board->pos.x = 0; size = sizeof( p_board->pos.y ); - if( !RegQueryValueEx( hkey, "Ypos", NULL, &type, + if( !RegQueryValueExW( hkey, yposW, NULL, &type, (LPBYTE) &p_board->pos.y, &size ) == ERROR_SUCCESS ) p_board->pos.y = 0; size = sizeof( p_board->rows ); - if( !RegQueryValueEx( hkey, "Height", NULL, &type, + if( !RegQueryValueExW( hkey, heightW, NULL, &type, (LPBYTE) &p_board->rows, &size ) == ERROR_SUCCESS ) p_board->rows = BEGINNER_ROWS; size = sizeof( p_board->cols ); - if( !RegQueryValueEx( hkey, "Width", NULL, &type, + if( !RegQueryValueExW( hkey, widthW, NULL, &type, (LPBYTE) &p_board->cols, &size ) == ERROR_SUCCESS ) p_board->cols = BEGINNER_COLS; size = sizeof( p_board->mines ); - if( !RegQueryValueEx( hkey, "Mines", NULL, &type, + if( !RegQueryValueExW( hkey, minesW, NULL, &type, (LPBYTE) &p_board->mines, &size ) == ERROR_SUCCESS ) p_board->mines = BEGINNER_MINES; size = sizeof( p_board->difficulty ); - if( !RegQueryValueEx( hkey, "Difficulty", NULL, &type, + if( !RegQueryValueExW( hkey, difficultyW, NULL, &type, (LPBYTE) &p_board->difficulty, &size ) == ERROR_SUCCESS ) p_board->difficulty = BEGINNER; size = sizeof( p_board->IsMarkQ ); - if( !RegQueryValueEx( hkey, "Mark", NULL, &type, + if( !RegQueryValueExW( hkey, markW, NULL, &type, (LPBYTE) &p_board->IsMarkQ, &size ) == ERROR_SUCCESS ) p_board->IsMarkQ = TRUE; for( i = 0; i < 3; i++ ) { - wsprintf( key_name, "Name%u", i+1 ); + wsprintfW( key_name, nameW, i+1 ); size = sizeof( data ); - if( RegQueryValueEx( hkey, key_name, NULL, &type, + if( RegQueryValueExW( hkey, key_name, NULL, &type, (LPBYTE) data, &size ) == ERROR_SUCCESS ) - lstrcpynA( p_board->best_name[i], data, sizeof(p_board->best_name[i]) ); + lstrcpynW( p_board->best_name[i], data, sizeof(p_board->best_name[i])/sizeof(WCHAR) ); else - LoadString( p_board->hInst, IDS_NOBODY, p_board->best_name[i], MAX_PLAYER_NAME_SIZE+1 ); + LoadStringW( p_board->hInst, IDS_NOBODY, p_board->best_name[i], MAX_PLAYER_NAME_SIZE+1 ); } for( i = 0; i < 3; i++ ) { - wsprintf( key_name, "Time%u", i+1 ); + wsprintfW( key_name, timeW, i+1 ); size = sizeof( p_board->best_time[i] ); - if( !RegQueryValueEx( hkey, key_name, NULL, &type, + if( !RegQueryValueExW( hkey, key_name, NULL, &type, (LPBYTE) &p_board->best_time[i], &size ) == ERROR_SUCCESS ) p_board->best_time[i] = 999; } @@ -127,9 +137,9 @@ static void InitBoard( BOARD *p_board ) { HMENU hMenu; - p_board->hMinesBMP = LoadBitmap( p_board->hInst, "mines"); - p_board->hFacesBMP = LoadBitmap( p_board->hInst, "faces"); - p_board->hLedsBMP = LoadBitmap( p_board->hInst, "leds"); + p_board->hMinesBMP = LoadBitmapW( p_board->hInst, MAKEINTRESOURCEW(IDI_MINES)); + p_board->hFacesBMP = LoadBitmapW( p_board->hInst, MAKEINTRESOURCEW(IDI_FACES)); + p_board->hLedsBMP = LoadBitmapW( p_board->hInst, MAKEINTRESOURCEW(IDI_LEDS)); LoadBoard( p_board ); @@ -147,32 +157,32 @@ static void SaveBoard( BOARD *p_board ) { HKEY hkey; unsigned i; - char data[MAX_PLAYER_NAME_SIZE+1]; - char key_name[8]; + WCHAR data[MAX_PLAYER_NAME_SIZE+1]; + WCHAR key_name[8]; - if( RegCreateKeyEx( HKEY_CURRENT_USER, registry_key, + if( RegCreateKeyExW( HKEY_CURRENT_USER, registry_key, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkey, NULL ) != ERROR_SUCCESS) return; - RegSetValueEx( hkey, "Xpos", 0, REG_DWORD, (LPBYTE) &p_board->pos.x, sizeof(p_board->pos.x) ); - RegSetValueEx( hkey, "Ypos", 0, REG_DWORD, (LPBYTE) &p_board->pos.y, sizeof(p_board->pos.y) ); - RegSetValueEx( hkey, "Difficulty", 0, REG_DWORD, (LPBYTE) &p_board->difficulty, sizeof(p_board->difficulty) ); - RegSetValueEx( hkey, "Height", 0, REG_DWORD, (LPBYTE) &p_board->rows, sizeof(p_board->rows) ); - RegSetValueEx( hkey, "Width", 0, REG_DWORD, (LPBYTE) &p_board->cols, sizeof(p_board->cols) ); - RegSetValueEx( hkey, "Mines", 0, REG_DWORD, (LPBYTE) &p_board->mines, sizeof(p_board->mines) ); - RegSetValueEx( hkey, "Mark", 0, REG_DWORD, (LPBYTE) &p_board->IsMarkQ, sizeof(p_board->IsMarkQ) ); + RegSetValueExW( hkey, xposW, 0, REG_DWORD, (LPBYTE) &p_board->pos.x, sizeof(p_board->pos.x) ); + RegSetValueExW( hkey, yposW, 0, REG_DWORD, (LPBYTE) &p_board->pos.y, sizeof(p_board->pos.y) ); + RegSetValueExW( hkey, difficultyW, 0, REG_DWORD, (LPBYTE) &p_board->difficulty, sizeof(p_board->difficulty) ); + RegSetValueExW( hkey, heightW, 0, REG_DWORD, (LPBYTE) &p_board->rows, sizeof(p_board->rows) ); + RegSetValueExW( hkey, widthW, 0, REG_DWORD, (LPBYTE) &p_board->cols, sizeof(p_board->cols) ); + RegSetValueExW( hkey, minesW, 0, REG_DWORD, (LPBYTE) &p_board->mines, sizeof(p_board->mines) ); + RegSetValueExW( hkey, markW, 0, REG_DWORD, (LPBYTE) &p_board->IsMarkQ, sizeof(p_board->IsMarkQ) ); for( i = 0; i < 3; i++ ) { - wsprintf( key_name, "Name%u", i+1 ); - lstrcpyn( data, p_board->best_name[i], sizeof( data ) ); - RegSetValueEx( hkey, key_name, 0, REG_SZ, (LPBYTE) data, strlen(data)+1 ); + wsprintfW( key_name, nameW, i+1 ); + lstrcpynW( data, p_board->best_name[i], sizeof(data)/sizeof(WCHAR) ); + RegSetValueExW( hkey, key_name, 0, REG_SZ, (LPBYTE) data, (lstrlenW(data)+1) * sizeof(WCHAR) ); } for( i = 0; i < 3; i++ ) { - wsprintf( key_name, "Time%u", i+1 ); - RegSetValueEx( hkey, key_name, 0, REG_DWORD, (LPBYTE) &p_board->best_time[i], sizeof(p_board->best_time[i]) ); + wsprintfW( key_name, timeW, i+1 ); + RegSetValueExW( hkey, key_name, 0, REG_DWORD, (LPBYTE) &p_board->best_time[i], sizeof(p_board->best_time[i]) ); } RegCloseKey( hkey ); } @@ -189,7 +199,7 @@ static void SetDifficulty( BOARD *p_board, DIFFICULTY difficulty ) HMENU hMenu; if ( difficulty == CUSTOM ) - if (DialogBoxParam( p_board->hInst, "DLG_CUSTOM", p_board->hWnd, + if (DialogBoxParamW( p_board->hInst, MAKEINTRESOURCEW(DLG_CUSTOM), p_board->hWnd, CustomDlgProc, (LPARAM) p_board) != 0) return; @@ -245,7 +255,7 @@ static void MoveOnScreen(RECT* rect) /* ... and move it into the work area (ie excluding task bar)*/ mi.cbSize = sizeof(mi); - GetMonitorInfo(hMonitor, &mi); + GetMonitorInfoW(hMonitor, &mi); ShiftBetween(&rect->left, &rect->right, mi.rcWork.left, mi.rcWork.right); ShiftBetween(&rect->top, &rect->bottom, mi.rcWork.top, mi.rcWork.bottom); @@ -820,11 +830,10 @@ static void TestBoard( HWND hWnd, BOARD *p_board, int x, int y, int msg ) p_board->time < p_board->best_time[p_board->difficulty] ) { p_board->best_time[p_board->difficulty] = p_board->time; - DialogBoxParam( p_board->hInst, "DLG_CONGRATS", hWnd, - CongratsDlgProc, (LPARAM) p_board); - - DialogBoxParam( p_board->hInst, "DLG_TIMES", hWnd, - TimesDlgProc, (LPARAM) p_board); + DialogBoxParamW( p_board->hInst, MAKEINTRESOURCEW(DLG_CONGRATS), hWnd, + CongratsDlgProc, (LPARAM) p_board); + DialogBoxParamW( p_board->hInst, MAKEINTRESOURCEW(DLG_TIMES), hWnd, + TimesDlgProc, (LPARAM) p_board); } } TestFace( p_board, pt, msg ); @@ -840,7 +849,7 @@ static LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara switch( msg ) { case WM_CREATE: - board.hInst = ((LPCREATESTRUCT) lParam)->hInstance; + board.hInst = ((LPCREATESTRUCTW) lParam)->hInstance; board.hWnd = hWnd; InitBoard( &board ); CreateBoard( &board ); @@ -884,7 +893,7 @@ static LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case WM_LBUTTONDOWN: WINE_TRACE("WM_LBUTTONDOWN\n"); - if( wParam & (MK_RBUTTON | MK_SHIFT) ) + if( wParam & MK_RBUTTON ) msg = WM_MBUTTONDOWN; TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg ); SetCapture( hWnd ); @@ -892,7 +901,7 @@ static LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case WM_LBUTTONUP: WINE_TRACE("WM_LBUTTONUP\n"); - if( wParam & (MK_RBUTTON | MK_SHIFT) ) + if( wParam & MK_RBUTTON ) msg = WM_MBUTTONUP; TestBoard( hWnd, &board, (short)LOWORD(lParam), (short)HIWORD(lParam), msg ); ReleaseCapture(); @@ -979,12 +988,12 @@ static LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara return 0; case IDM_EXIT: - SendMessage( hWnd, WM_CLOSE, 0, 0); + SendMessageW( hWnd, WM_CLOSE, 0, 0); return 0; case IDM_TIMES: - DialogBoxParam( board.hInst, "DLG_TIMES", hWnd, - TimesDlgProc, (LPARAM) &board); + DialogBoxParamW( board.hInst, MAKEINTRESOURCEW(DLG_TIMES), hWnd, + TimesDlgProc, (LPARAM) &board); return 0; case IDM_ABOUT: @@ -1001,18 +1010,18 @@ static LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara break; } } - return( DefWindowProc( hWnd, msg, wParam, lParam )); + return DefWindowProcW( hWnd, msg, wParam, lParam ); } -int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow ) +int WINAPI wWinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow ) { MSG msg; - WNDCLASSEX wc; + WNDCLASSEXW wc; HWND hWnd; HACCEL haccel; - char appname[20]; + WCHAR appname[20]; - LoadString( hInst, IDS_APPNAME, appname, sizeof(appname)); + LoadStringW( hInst, IDS_APPNAME, appname, sizeof(appname)/sizeof(WCHAR)); wc.cbSize = sizeof(wc); wc.style = 0; @@ -1020,16 +1029,16 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmd wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInst; - wc.hIcon = LoadIcon( hInst, "WINEMINE" ); - wc.hCursor = LoadCursor( 0, IDI_APPLICATION ); + wc.hIcon = LoadIconW( hInst, MAKEINTRESOURCEW(IDI_WINEMINE) ); + wc.hCursor = LoadCursorW( 0, (LPWSTR)IDI_APPLICATION ); wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE); //MOD for ROS - wc.lpszMenuName = "MENU_WINEMINE"; + wc.lpszMenuName = MAKEINTRESOURCEW(IDM_WINEMINE); wc.lpszClassName = appname; - wc.hIconSm = LoadImage( hInst, "WINEMINE", IMAGE_ICON, + wc.hIconSm = LoadImageW( hInst, MAKEINTRESOURCEW(IDI_WINEMINE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED ); - if (!RegisterClassEx(&wc)) ExitProcess(1); - hWnd = CreateWindow( appname, appname, + if (!RegisterClassExW(&wc)) ExitProcess(1); + hWnd = CreateWindowW( appname, appname, wnd_style, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, hInst, NULL ); @@ -1039,14 +1048,14 @@ int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmd ShowWindow( hWnd, cmdshow ); UpdateWindow( hWnd ); - haccel = LoadAccelerators( hInst, MAKEINTRESOURCE(IDA_WINEMINE) ); + haccel = LoadAcceleratorsW( hInst, MAKEINTRESOURCEW(IDA_WINEMINE) ); SetTimer( hWnd, ID_TIMER, 1000, NULL ); - while( GetMessage(&msg, 0, 0, 0) ) { - if (!TranslateAccelerator( hWnd, haccel, &msg )) + while( GetMessageW(&msg, 0, 0, 0) ) { + if (!TranslateAcceleratorW( hWnd, haccel, &msg )) TranslateMessage( &msg ); - DispatchMessage( &msg ); + DispatchMessageW( &msg ); } return msg.wParam; } diff --git a/reactos/base/applications/games/winmine/main.h b/reactos/base/applications/games/winmine/main.h index 826940b7957..3ac207e2681 100644 --- a/reactos/base/applications/games/winmine/main.h +++ b/reactos/base/applications/games/winmine/main.h @@ -95,7 +95,7 @@ typedef struct tagBOARD unsigned rows; unsigned cols; unsigned mines; - char best_name [3][MAX_PLAYER_NAME_SIZE+1]; + WCHAR best_name [3][MAX_PLAYER_NAME_SIZE+1]; DWORD best_time [3]; DIFFICULTY difficulty; diff --git a/reactos/base/applications/games/winmine/resource.h b/reactos/base/applications/games/winmine/resource.h index 5571ef93578..e77084fbb86 100644 --- a/reactos/base/applications/games/winmine/resource.h +++ b/reactos/base/applications/games/winmine/resource.h @@ -20,34 +20,45 @@ #pragma once -#define ID_TIMER 1000 +#define ID_TIMER 1000 /* menu defines */ -#define IDM_NEW 1001 -#define IDM_EXIT 1002 -#define IDM_TIMES 1003 -#define IDM_ABOUT 1004 -#define IDM_BEGINNER 1005 -#define IDM_ADVANCED 1006 -#define IDM_EXPERT 1007 -#define IDM_CUSTOM 1008 -#define IDM_MARKQ 1009 +#define IDM_NEW 1001 +#define IDM_EXIT 1002 +#define IDM_TIMES 1003 +#define IDM_ABOUT 1004 +#define IDM_BEGINNER 1005 +#define IDM_ADVANCED 1006 +#define IDM_EXPERT 1007 +#define IDM_CUSTOM 1008 +#define IDM_MARKQ 1009 -#define IDC_TIME1 1011 -#define IDC_TIME2 1012 -#define IDC_TIME3 1013 -#define IDC_NAME1 1014 -#define IDC_NAME2 1015 -#define IDC_NAME3 1016 +#define IDC_TIME1 1011 +#define IDC_TIME2 1012 +#define IDC_TIME3 1013 +#define IDC_NAME1 1014 +#define IDC_NAME2 1015 +#define IDC_NAME3 1016 -#define IDC_EDITNAME 1021 +#define IDC_EDITNAME 1021 -#define IDC_EDITCOLS 1031 -#define IDC_EDITROWS 1032 -#define IDC_EDITMINES 1033 +#define IDC_EDITCOLS 1031 +#define IDC_EDITROWS 1032 +#define IDC_EDITMINES 1033 -#define IDS_APPNAME 1101 -#define IDS_NOBODY 1102 -#define IDS_ABOUT 1103 +#define IDS_APPNAME 1101 +#define IDS_NOBODY 1102 +#define IDS_ABOUT 1103 -#define IDA_WINEMINE 1201 +#define IDA_WINEMINE 1201 + +#define IDM_WINEMINE 1 + +#define IDI_WINEMINE 1 +#define IDI_FACES 2 +#define IDI_LEDS 3 +#define IDI_MINES 4 + +#define DLG_TIMES 1 +#define DLG_CONGRATS 2 +#define DLG_CUSTOM 3 diff --git a/reactos/base/applications/games/winmine/rsrc.rc b/reactos/base/applications/games/winmine/rsrc.rc index 2c8be76accd..614e7da0351 100644 --- a/reactos/base/applications/games/winmine/rsrc.rc +++ b/reactos/base/applications/games/winmine/rsrc.rc @@ -33,16 +33,16 @@ BEGIN END /* @makedep: winemine.ico */ -WINEMINE ICON "rc/winemine.ico" +IDI_WINEMINE ICON "rc/winemine.ico" /* @makedep: faces.bmp */ -FACES BITMAP "rc/faces.bmp" +IDI_FACES BITMAP "rc/faces.bmp" /* @makedep: leds.bmp */ -LEDS BITMAP "rc/leds.bmp" +IDI_LEDS BITMAP "rc/leds.bmp" /* @makedep: mines.bmp */ -MINES BITMAP "rc/mines.bmp" +IDI_MINES BITMAP "rc/mines.bmp" #include diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 0af02390e56..be9c80c0091 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -235,7 +235,7 @@ reactos/base/applications/cmdutils/taskkill # Synced to Wine-1.7.27 reactos/base/applications/cmdutils/wmic # Synced to Wine-1.7.27 reactos/base/applications/cmdutils/wscript # Synced to WineStaging-1.7.37 reactos/base/applications/cmdutils/xcopy # Synced to WineStaging-1.7.37 -reactos/base/applications/games/winmine # Forked at Wine-1_3_5 +reactos/base/applications/games/winmine # Synced to WineStaging-1.7.37 with our own resources. reactos/base/applications/extrac32 # Synced to Wine-1.7.27 reactos/base/applications/iexplore # Synced to Wine-1.7.27 reactos/base/applications/notepad # Forked at Wine-20041201