buf : array [1..250] of char;
......
SendMessage(RichViewEdit1.Handle, WM_GETTEXT, TextCount, integer(@buf));
buf : array [1..250] of char;
......
SendMessage(RichViewEdit1.Handle, WM_GETTEXT, TextCount, integer(@buf));
Dim buf(1 to 250) As Byte
SendMessage RichViewEdit1.Handle, WM_GETTEXT, TextCount, VarPtr(buf(1))
Dim buf(1 to 250) As Byte
SendMessage RichViewEdit1.Handle, WM_GETTEXT, TextCount, buf(1)
SendMessage wWnd, WM_SETTEXT, Len(PasteString) + 1, ByVal PasteString
Хакер писал(а):Это значит, что в объявлении функции стоит гадкий ByRef.
c_Pos = SendMessage(wWnd, WM_GETSEL, 0, 0)
SendMessage wWnd, WM_SETSEL, 0, с_Pos
В моей справке по API я их вообще
ApiViewer 2004 v.3.10
Win32api.apv v.3.00
08.08.2004
Declarations:6189
Constants:52940
Types:479
Enumerations:9
Hello Dave,
A possible work-around is to SendMessage
(http://msdn2.microsoft.com/EN-US/library/ms644950.aspx) WM_GETSEL to get
the current selection of text in a specified handle. But it may complicates
the solution. I am still waiting for Product team's response, to see if
they have better resolutions. Thanks for your patience.
Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
Public Const EM_EXGETSEL = &H434
Public Const EM_EXSETSEL = &H437
Public Const EM_AUTOURLDETECT As Long = (WM_USER + 91)
Public Const EM_CANPASTE As Long = (WM_USER + 50)
Public Const EM_CANREDO As Long = (WM_USER + 85)
Public Const EM_CHARFROMPOS As Long = &HD7
Public Const EM_CANUNDO As Long = &HC6
Public Const EM_CONVPOSITION As Long = (WM_USER + 108)
Public Const EM_DISPLAYBAND As Long = (WM_USER + 51)
Public Const EM_EXLIMITTEXT As Long = (WM_USER + 53)
Public Const EM_EXLINEFROMCHAR As Long = (WM_USER + 54)
Public Const EM_EXSETSEL As Long = (WM_USER + 55)
Public Const EM_FINDTEXT As Long = (WM_USER + 56)
Public Const EM_FINDTEXTEX As Long = (WM_USER + 79)
Public Const EM_FINDTEXTEXW As Long = (WM_USER + 124)
Public Const EM_FINDTEXTW As Long = (WM_USER + 123)
Public Const EM_FINDWORDBREAK As Long = (WM_USER + 76)
Public Const EM_FMTLINES As Long = &HC8
Public Const EM_FORMATRANGE As Long = (WM_USER + 57)
Public Const EM_GETAUTOURLDETECT As Long = (WM_USER + 92)
Public Const EM_GETBIDIOPTIONS As Long = (WM_USER + 201)
Public Const EM_GETCHARFORMAT As Long = (WM_USER + 58)
Public Const EM_GETEDITSTYLE As Long = (WM_USER + 205)
Public Const EM_GETEVENTMASK As Long = (WM_USER + 59)
Public Const EM_GETFIRSTVISIBLELINE As Long = &HCE
Public Const EM_GETHANDLE As Long = &HBD
Public Const EM_GETIMECOLOR As Long = (WM_USER + 105)
Public Const EM_GETIMECOMPMODE As Long = (WM_USER + 122)
Public Const EM_GETIMEMODEBIAS As Long = (WM_USER + 127)
Public Const EM_GETIMEOPTIONS As Long = (WM_USER + 107)
Public Const EM_GETLANGOPTIONS As Long = (WM_USER + 121)
Public Const EM_GETIMESTATUS As Long = &HD9
Public Const EM_GETLINE As Long = &HC4
Public Const EM_GETLINECOUNT As Long = &HBA
Public Const EM_GETMODIFY As Long = &HB8
Public Const EM_GETMARGINS As Long = &HD4
Public Const EM_GETOLEINTERFACE As Long = (WM_USER + 60)
Public Const EM_GETOPTIONS As Long = (WM_USER + 78)
Public Const EM_GETPARAFORMAT As Long = (WM_USER + 61)
Public Const EM_GETPASSWORDCHAR As Long = &HD2
Public Const EM_GETPUNCTUATION As Long = (WM_USER + 101)
Public Const EM_GETRECT As Long = &HB2
Public Const EM_GETREDONAME As Long = (WM_USER + 87)
Public Const EM_GETSCROLLPOS As Long = (WM_USER + 221)
Public Const EM_GETSEL As Long = &HB0
Public Const EM_GETSELTEXT As Long = (WM_USER + 62)
Public Const EM_GETTEXTEX As Long = (WM_USER + 94)
Public Const EM_GETTEXTLENGTHEX As Long = (WM_USER + 95)
Public Const EM_GETTEXTMODE As Long = (WM_USER + 90)
Public Const EM_GETTEXTRANGE As Long = (WM_USER + 75)
Public Const EM_GETTHUMB As Long = &HBE
Public Const EM_GETTYPOGRAPHYOPTIONS As Long = (WM_USER + 203)
Public Const EM_GETUNDONAME As Long = (WM_USER + 86)
Public Const EM_GETWORDBREAKPROC As Long = &HD1
Public Const EM_GETWORDBREAKPROCEX As Long = (WM_USER + 80)
Public Const EM_GETWORDWRAPMODE As Long = (WM_USER + 103)
Public Const EM_GETZOOM As Long = (WM_USER + 224)
Public Const EM_HIDESELECTION As Long = (WM_USER + 63)
Public Const EM_LIMITTEXT As Long = &HC5
Public Const EM_LINEFROMCHAR As Long = &HC9
Public Const EM_LINEINDEX As Long = &HBB
Public Const EM_LINELENGTH As Long = &HC1
Public Const EM_LINESCROLL As Long = &HB6
Public Const EM_OUTLINE As Long = (WM_USER + 220)
Public Const EM_PASTESPECIAL As Long = (WM_USER + 64)
Public Const EM_POSFROMCHAR As Long = (WM_USER + 38)
Public Const EM_RECONVERSION As Long = (WM_USER + 125)
Public Const EM_REDO As Long = (WM_USER + 84)
Public Const EM_REPLACESEL As Long = &HC2
Public Const EM_REQUESTRESIZE As Long = (WM_USER + 65)
Public Const EM_SCROLL As Long = &HB5
Public Const EM_SCROLLCARET As Long = &HB7
Public Const EM_SELECTIONTYPE As Long = (WM_USER + 66)
Public Const EM_SETBIDIOPTIONS As Long = (WM_USER + 200)
Public Const EM_SETBKGNDCOLOR As Long = (WM_USER + 67)
Public Const EM_SETCHARFORMAT As Long = (WM_USER + 68)
Public Const EM_SETCUEBANNER As Long = (ECM_FIRST + 1)
Public Const EM_SETEDITSTYLE As Long = (WM_USER + 204)
Public Const EM_SETEVENTMASK As Long = (WM_USER + 69)
Public Const EM_SETFONTSIZE As Long = (WM_USER + 223)
Public Const EM_SETHANDLE As Long = &HBC
Public Const EM_SETIMECOLOR As Long = (WM_USER + 104)
Public Const EM_SETIMEMODEBIAS As Long = (WM_USER + 126)
Public Const EM_SETIMEOPTIONS As Long = (WM_USER + 106)
Public Const EM_SETIMESTATUS As Long = &HD8
Public Const EM_SETLANGOPTIONS As Long = (WM_USER + 120)
Public Const EM_SETLIMITTEXT As Long = EM_LIMITTEXT
Public Const EM_SETMARGINS As Long = &HD3
Public Const EM_SETMODIFY As Long = &HB9
Public Const EM_SETOLECALLBACK As Long = (WM_USER + 70)
Public Const EM_SETOPTIONS As Long = (WM_USER + 77)
Public Const EM_SETPALETTE As Long = (WM_USER + 93)
Public Const EM_SETPARAFORMAT As Long = (WM_USER + 71)
Public Const EM_SETPASSWORDCHAR As Long = &HCC
Public Const EM_SETPUNCTUATION As Long = (WM_USER + 100)
Public Const EM_SETREADONLY As Long = &HCF
Public Const EM_SETRECT As Long = &HB3
Public Const EM_SETRECTNP As Long = &HB4
Public Const EM_SETSCROLLPOS As Long = (WM_USER + 222)
Public Const EM_SETSEL As Long = &HB1
Public Const EM_SETTABSTOPS As Long = &HCB
Public Const EM_SETTARGETDEVICE As Long = (WM_USER + 72)
Public Const EM_SETTEXTEX As Long = (WM_USER + 97)
Public Const EM_SETTEXTMODE As Long = (WM_USER + 89)
Public Const EM_SETTYPOGRAPHYOPTIONS As Long = (WM_USER + 202)
Public Const EM_SETUNDOLIMIT As Long = (WM_USER + 82)
Public Const EM_SETWORDBREAKPROC As Long = &HD0
Public Const EM_SETWORDBREAKPROCEX As Long = (WM_USER + 81)
Public Const EM_SETWORDWRAPMODE As Long = (WM_USER + 102)
Public Const EM_SETZOOM As Long = (WM_USER + 225)
Public Const EM_SHOWSCROLLBAR As Long = (WM_USER + 96)
Public Const EM_STOPGROUPTYPING As Long = (WM_USER + 88)
Public Const EM_STREAMIN As Long = (WM_USER + 73)
Public Const EM_STREAMOUT As Long = (WM_USER + 74)
Public Const EM_UNDO As Long = &HC7
USES DBITYPES, DBIPROCS, DBIERRS, DB, WINPROCS, SYSUTILS;
PROCEDURE CHANGELANGDRIVER(DATABASENAME, TABLENAME, LDNAME: STRING);
VAR
TBLEXT: STRING;
DATABASE: TDATABASE;
TBLDESC: CRTBLDESC;
OPTDESC: FLDDESC;
OPTDATA: ARRAY [0..250] OF CHAR;
CUR: HDBICUR;
REC: CFGDESC;
BEGIN
IF (TABLENAME='') OR (LDNAME='') THEN
RAISE EXCEPTION.CREATE('UNKNOWN TABLENAME OR LDNAME');
DATABASE:=SESSION.OPENDATABASE(DATABASENAME);
TRY
IF DATABASE.ISSQLBASED THEN RAISE EXCEPTION.CREATE('FUNCTION
CHANGELANGDRIVER WORKING ONLY WITH DBASE OR PARADOX TABLES');
FILLCHAR(OPTDESC, SIZEOF(OPTDESC), #0);
FILLCHAR(TBLDESC, SIZEOF(TBLDESC), #0);
STRCOPY(OPTDESC.SZNAME, 'LANGDRIVER');
OPTDESC.ILEN:=LENGTH(LDNAME)+1;
WITH TBLDESC DO
BEGIN
STRPCOPY(SZTBLNAME, TABLENAME);
TBLEXT:=UPPERCASE(EXTRACTFILEEXT(TABLENAME));
IF TBLEXT='DBF' THEN STRCOPY(SZTBLTYPE, SZDBASE)
ELSE IF TBLEXT='.DB' THEN STRCOPY(SZTBLTYPE, SZPARADOX)
ELSE BEGIN
ANSITOOEM(STRPCOPY(OPTDATA, DATABASENAME), OPTDATA);
IF DBIOPENCFGINFOLIST(NIL, DBIREADONLY, CFGPERSISTENT,
STRPCOPY(OPTDATA, '\DATABASES\'+STRPAS(OPTDATA)+'\DB INFO\'),
CUR)<>DBIERR_NONE
THEN RAISE EXCEPTION.CREATE('UNKNOWN TABLE TYPE');
TRY
WHILE DBIGETNEXTRECORD(CUR, DBINOLOCK, @REC, NIL)<>DBIERR_EOF DO
IF STRCOMP(REC.SZNODENAME, 'DEFAULT DRIVER')=0 THEN
BEGIN
STRCOPY(SZTBLTYPE, REC.SZVALUE);
BREAK;
END;
FINALLY
CHECK(DBICLOSECURSOR(CUR));
END;
END;
IOPTPARAMS:=1;
PFLDOPTPARAMS:=@OPTDESC;
POPTDATA:=@OPTDATA;
END;
STRPCOPY(OPTDATA, LDNAME);
CHECK(DBIDORESTRUCTURE(DATABASE.HANDLE, 1, @TBLDESC, NIL,
NIL, NIL, FALSE));
FINALLY
SESSION.CLOSEDATABASE(DATABASE);
END;
END;
Примеры использования:
CHANGELANGDRIVER('C:\DELPHI\DEMOS\DATA', 'CLIENTS.DBF', 'DB866RU0');
Viper писал(а):А то что в этом коде используются спецфические для Delphi классы эт ничего? Или их тоже переписать?
VAR LIST:TSTRINGS;
.......
BEGIN
.......
LIST.ADD ('LANGDRIVER=DB866RU0');
.......
SESSION.MODIFYDRIVER('DBASE',LIST);
.......
END;
Нет, можно найти альтернативный метод, выполняющий те же функции. Если это, конечно, не контрол, хотя и тот можно заюзать в VB , если сильно захочется.А то что в этом коде используются спецфические для Delphi классы эт ничего? Или их тоже переписать?
Создается переменная типа TStrings - это просто список строк, далее она должна инициализироваться, но этот кусок кода ты пропустил. Потом в этот список добавляется строка 'LANGDRIVER=DB866RU0'. SESSION, скорее всего, есть аналог Workspase в VBA.ладно, если там нельзя ничего сделать, то может тут мона?
SESSION.MODIFYDRIVER('DBASE',LIST);
вот вот, мне то какраз и нужно реализовать "изменяет языковой драйвер для текущей сессии связи с данными для баз данных типа" только типа Paradox но это неважно ибо DBASE от Paradox недалеко ушло, мне нужно это на VB написать!!! только мне нужно 'LANGDRIVER=ancyrr'Twister писал(а):А... Потом в этот список добавляется строка 'LANGDRIVER=DB866RU0'. SESSION, скорее всего, есть аналог Workspase в VBA.
Код, скорее всего, изменяет языковой драйвер для текущей сессии связи с данными для баз данных типа DBASE. Второй параметр, как уже ясно, имя драйвера. ...
- Код: Выделить всё
SESSION.MODIFYDRIVER('DBASE',LIST);
Сейчас этот форум просматривают: SemrushBot и гости: 2