Author Topic: non-english windows clipboard problem  (Read 3519 times)

six_L

  • Member
  • ***
  • Posts: 307
Re: non-english windows clipboard problem
« Reply #30 on: February 14, 2022, 05:06:56 AM »
Hi,bomz
the OS(non ansi) uses unicode API defaultly.
or use
Code: [Select]
LOCAL ansiBuf[2048]:BYTE

invoke OpenClipboard,NULL
invoke GetClipboardData,CF_UNICODETEXT ;CF_TEXT
mov hClipdata,rax
invoke GlobalLock,hClipdata
mov lpStr,rax
invoke SetDlgItemTextW,hWnd,IDC_OUTPUT2,lpStr
invoke RtlZeroMemory,addr ansiBuf,sizeof ansiBuf
invoke WideCharToMultiByte,CP_ACP,0,lpStr,-1,addr ansiBuf,2048,NULL,NULL
invoke SetDlgItemTextA,hWnd,IDC_OUTPUT1,addr ansiBuf
invoke GlobalUnlock,hClipdata
invoke EmptyClipboard
invoke CloseClipboard

« Last Edit: February 14, 2022, 06:16:20 AM by six_L »
Say you, Say me, Say the codes together for ever.

bomz

  • Member
  • **
  • Posts: 60
Re: non-english windows clipboard problem
« Reply #31 on: February 14, 2022, 07:16:13 AM »
invoke ActivateKeyboardLayout,0419h,0
interesting how use cf-text and cf_oemtext for input
« Last Edit: February 14, 2022, 07:16:50 PM by bomz »

bomz

  • Member
  • **
  • Posts: 60
Re: non-english windows clipboard problem
« Reply #32 on: February 15, 2022, 03:51:25 AM »
can anybody say how works cf-locale?
Code: [Select]
;invoke ActivateKeyboardLayout,0419h,0
invoke OpenClipboard,NULL
;invoke GetClipboardData,CF_LOCALE
;invoke MessageBox,0,eax,0,MB_ICONASTERISK
;invoke wsprintf,ADDR buffer,ADDR form,dword ptr[eax]
;invoke MessageBox,0,ADDR buffer,ADDR mestitle,MB_ICONASTERISK
invoke SetClipboardData, CF_LOCALE, 0419h
invoke GetClipboardData,CF_OEMTEXT
invoke MessageBox,0,eax,0,MB_ICONASTERISK
invoke CloseClipboard
invoke ExitProcess,0

Greenhorn

  • Member
  • ***
  • Posts: 476
Re: non-english windows clipboard problem
« Reply #33 on: February 15, 2022, 03:55:33 AM »
Forget about CF_LOCAL, instead use CF_UNICODE and your problems fade away.
Kole Feut un Nordenwind gift en krusen Büdel un en lütten Pint.

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: non-english windows clipboard problem
« Reply #34 on: February 15, 2022, 05:15:11 AM »
deleted
« Last Edit: February 24, 2022, 05:04:18 PM by nidud »

TimoVJL

  • Member
  • *****
  • Posts: 1296
Re: non-english windows clipboard problem
« Reply #35 on: February 15, 2022, 05:24:02 AM »
Using Free Clipboard Viewer someone could look what formats are already there, if someone copy something from another application.
May the source be with you

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: non-english windows clipboard problem
« Reply #36 on: February 15, 2022, 05:38:50 AM »
deleted
« Last Edit: February 24, 2022, 05:04:31 PM by nidud »

bomz

  • Member
  • **
  • Posts: 60
Re: non-english windows clipboard problem
« Reply #37 on: February 15, 2022, 06:20:40 AM »
Code: [Select]
invoke OpenClipboard,NULL
invoke GetUserDefaultLCID
invoke SetClipboardData, CF_LOCALE, eax
invoke GetClipboardData,CF_UNICODETEXT
invoke MessageBoxW,0,eax,0,MB_ICONASTERISK
invoke CloseClipboard
invoke ExitProcess,0

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: non-english windows clipboard problem
« Reply #38 on: February 24, 2022, 09:42:10 AM »
deleted
« Last Edit: February 24, 2022, 05:04:53 PM by nidud »

jj2007

  • Member
  • *****
  • Posts: 13873
  • Assembly is fun ;-)
    • MasmBasic
Re: non-english windows clipboard problem
« Reply #39 on: February 24, 2022, 11:42:10 AM »
deleted
« Last Edit: February 24, 2022, 09:30:51 PM by jj2007 »

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: non-english windows clipboard problem
« Reply #40 on: February 24, 2022, 01:44:00 PM »
deleted
« Last Edit: February 24, 2022, 05:05:16 PM by nidud »

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10573
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: non-english windows clipboard problem
« Reply #41 on: February 24, 2022, 02:33:45 PM »
Guys,

can we keep this squabling out of the campus ?
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
Re: non-english windows clipboard problem
« Reply #42 on: February 24, 2022, 03:08:49 PM »
I did ask to keep the squabling out of the campus.
« Last Edit: February 24, 2022, 04:34:24 PM by hutch-- »