+- +-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Stats

Members
Total Members: 129
Latest: dilpreetkaur
New This Month: 1
New This Week: 1
New Today: 0
Stats
Total Posts: 319
Total Topics: 160
Most Online Today: 2
Most Online Ever: 68
(October 18, 2019, 12:38:07 am)
Users Online
Members: 0
Guests: 1
Total: 1

Author Topic: Can your computer display Japanese characters?  (Read 370 times)

zwclose7

  • Administrator
  • Full Member
  • *****
  • Posts: 155
  • I love anime and science!
    • View Profile
    • My blog
Can your computer display Japanese characters?
« on: December 14, 2016, 10:39:23 pm »
Can your computer display Japanese characters? This program will test the Japanese support of your computer.





Source code

Code: [Select]
#include <Windows.h>

int WINAPI wWinMain(HINSTANCE hInst,HINSTANCE hPrev,LPWSTR lpCmdLine,int nCmdShow)
{
int msg;
HANDLE hFile;
DWORD write;
wchar_t* jp=L"こんにちは\nひかり\nやみ";

MessageBox(0,L"Can your computer display Japanese characters? This program will test the Japanese support of your computer.\n\nClick OK to continue.",L"Japanese Characters Test program",MB_ICONINFORMATION);

msg=MessageBox(0,L"First, can you see Japanese characters in this message box?\n\nアメリカ\nフランス\nイギリス\nイタリア\nロシア",L"Japanese Characters Test program",MB_ICONQUESTION|MB_YESNO);

switch(msg)
{
   case IDYES:
   MessageBox(0,L"That's great! Your computer can display Japanese characters correctly.",L"Japanese Characters Test program",MB_ICONINFORMATION);
   break;
   case IDNO:
   MessageBox(0,L"Sorry, your computer do not support Japanese characters.",L"Japanese Characters Test program",MB_ICONSTOP);
   return -1;
}

MessageBox(0,L"This program will now create a file with Japanese file name in the current directory. Click OK to continue.",L"Japanese Characters Test program",MB_ICONINFORMATION);

hFile=CreateFile(L"テスト.txt",GENERIC_WRITE,0,NULL,CREATE_ALWAYS,0,NULL);

if(hFile==INVALID_HANDLE_VALUE)
{
MessageBox(0,L"Error creating file.",L"Error",MB_ICONSTOP);
return -1;
}

if(!WriteFile(hFile,jp,wcslen(jp),&write,NULL))
{
MessageBox(0,L"Error writing file.",L"Error",MB_ICONSTOP);
CloseHandle(hFile);
return -1;
}

CloseHandle(hFile);

msg=MessageBox(0,L"Did the file name displayed correctly?",L"Japanese Characters Test program",MB_ICONQUESTION|MB_YESNO);

switch(msg)
{
    case IDYES:
MessageBox(0,L"That's great! Your computer can display Japanese file name correctly.",L"Japanese Characters Test program",MB_ICONINFORMATION);
break;
case IDNO:
MessageBox(0,L"Sorry, your computer can't display Japanese file name correctly.",L"Japanese Characters Test program",MB_ICONSTOP);
return -1;
}

MessageBox(0,L"This program will now open a Japanese site. Click OK to continue.",L"Japanese Characters Test program",MB_ICONINFORMATION);
ShellExecute(0,L"open",L"http://ja.wikipedia.org",NULL,NULL,SW_SHOW);

Sleep(1000);

msg=MessageBox(0,L"Can you see Japanese characters in your browser?",L"Japanese Characters Test program",MB_ICONQUESTION|MB_YESNO);

switch(msg)
{
    case IDYES:
MessageBox(0,L"That's great! Your browser can display Japanese characters correctly.",L"Japanese Characters Test program",MB_ICONINFORMATION);
break;
case IDNO:
MessageBox(0,L"Sorry, your browser can't display Japanese characters correctly.",L"Japanese Characters Test program",MB_ICONSTOP);
return -1;
}

return 0;
}

 

+-Recent Topics

Independent Call Girls in Chandigarh by dilpreetkaur
June 21, 2021, 01:02:52 pm

Hi zwclose7. How to create process by using NT apis? by zwclose7
June 01, 2021, 03:09:52 pm

Poison of the Day by zwclose7
March 16, 2020, 06:45:08 pm

IRC by AzeS
February 17, 2020, 08:18:01 am

Native API tutorial by hMihaiDavid
January 08, 2019, 02:11:02 am

The properties of GP nerve agent by xchg
October 19, 2018, 07:40:57 pm

A new route of synthesis for G-series agents by Basquyatti
October 15, 2018, 06:12:57 am

Synthesis of Methylisobutylcarbinylsarin (GH) by APC process by Basquyatti
October 14, 2018, 07:55:33 am

Synthesis conventional of Sarin by Basquyatti
October 02, 2018, 07:57:32 am

Reaction CX-7 (Experimental) by zwclose7
October 02, 2018, 12:46:47 am