关于转转问题! ( 积分: 50 )

  • 主题发起人 主题发起人 sunshinebbs
  • 开始时间 开始时间
S

sunshinebbs

Unregistered / Unconfirmed
GUEST, unregistred user!
我有4个Tedit<br>edit1.text := '131638'; //句柄<br>edit2.text := 'WM_LBUTTONDOWN'; //msg<br>edit3.text := '0'; //WPARAM<br>edit4.text := '0'; //LPARAM<br>如何转换到如下合法格式:<br>SendMessage(edit1.Text, edit2.Text, edit3.text,edit4.Text);
 
我有4个Tedit<br>edit1.text := '131638'; //句柄<br>edit2.text := 'WM_LBUTTONDOWN'; //msg<br>edit3.text := '0'; //WPARAM<br>edit4.text := '0'; //LPARAM<br>如何转换到如下合法格式:<br>SendMessage(edit1.Text, edit2.Text, edit3.text,edit4.Text);
 
不知你是不是这个意思<br>var WM:UINT;<br>begin<br> &nbsp;if edit2.text='WM_LBUTTONDOWN' then WM:=WM_LBUTTONDOWN;<br> &nbsp;if edit2.text='WM_RBUTTONDOWN' then WM:=WM_RBUTTONDOWN;<br> &nbsp;SendMessage(StrToInt(edit1.Text), WM, StrToInt(edit3.text),StrToInt(edit4.Text));<br>end;
 
plenilune168 大虾,正是这个意思,但能不能直接转换'WM_LBUTTONDOWN' <br>而不用判断if edit2.text='WM_LBUTTONDOWN',有这样的函数的吗?<br>edit3.text 用strtoint转换等
 
没有现成的,要自己写:<br>function StrToWinMessage(s:string):integer;<br>begin<br> &nbsp;if s='WM_MOUSEFIRST' then Result:=$0200;<br> &nbsp;if s='WM_MOUSEMOVE' &nbsp;then Result:=$0200;<br> &nbsp;if s='WM_LBUTTONDOWN' then Result:=$0201;<br> &nbsp;if s='WM_LBUTTONUP' then Result:=$0202;<br> &nbsp;if s='WM_LBUTTONDBLCLK' then Result:=$0203;<br> &nbsp;if s='WM_RBUTTONDOWN' then Result:=$0204;<br> &nbsp;if s='WM_RBUTTONUP' then Result:=$0205;<br> &nbsp;if s='WM_RBUTTONDBLCLK' then Result:=$0206;<br> &nbsp;if s='WM_MBUTTONDOWN' then Result:=$0207;<br> &nbsp;if s='WM_MBUTTONUP' then Result:=$0208;<br> &nbsp;if s='WM_MBUTTONDBLCLK' then Result:=$0209;<br> &nbsp;if s='WM_MOUSEWHEEL' then Result:=$020A;<br> &nbsp;if s='WM_MOUSELAST' then Result:=$020A;<br>end;
 
//---------------------------------Str转换Cardinal------------------------------<br><br>function StrToCardinal(str: string): cardinal;<br>begin<br> &nbsp;if str = 'BM_CLICK' then Result := BM_CLICK;<br> &nbsp;if str = 'BM_GETCHECK' then Result := BM_GETCHECK;<br> &nbsp;if str = 'BM_GETIMAGE' then Result := BM_GETIMAGE;<br> &nbsp;if str = 'BM_GETSTATE' then Result := BM_GETSTATE;<br> &nbsp;if str = 'BM_SETCHECK' then Result := BM_SETCHECK;<br> &nbsp;if str = 'BM_SETIMAGE' then Result := BM_SETIMAGE;<br> &nbsp;if str = 'BM_SETSTATE' then Result := BM_SETSTATE;<br> &nbsp;if str = 'BM_SETSTYLE' then Result := BM_SETSTYLE;<br> &nbsp;if str = 'CB_ADDSTRING' then Result := CB_ADDSTRING;<br> &nbsp;if str = 'CB_DELETESTRING' then Result := CB_DELETESTRING;<br> &nbsp;if str = 'CB_DIR' then Result := CB_DIR;<br> &nbsp;if str = 'CB_FINDSTRING' then Result := CB_FINDSTRING;<br> &nbsp;if str = 'CB_FINDSTRINGEXACT' then Result := CB_FINDSTRINGEXACT;<br> &nbsp;if str = 'CB_GETCOUNT' then Result := CB_GETCOUNT;<br> &nbsp;if str = 'CB_GETCURSEL' then Result := CB_GETCURSEL;<br> &nbsp;if str = 'CB_GETDROPPEDCONTROLRECT' then Result := CB_GETDROPPEDCONTROLRECT;<br> &nbsp;if str = 'CB_GETDROPPEDSTATE' then Result := CB_GETDROPPEDSTATE;<br> &nbsp;if str = 'CB_GETDROPPEDWIDTH' then Result := CB_GETDROPPEDWIDTH;<br> &nbsp;if str = 'CB_GETEDITSEL' then Result := CB_GETEDITSEL;<br> &nbsp;if str = 'CB_GETEXTENDEDUI' then Result := CB_GETEXTENDEDUI;<br> &nbsp;if str = 'CB_GETHORIZONTALEXTENT' then Result := CB_GETHORIZONTALEXTENT;<br> &nbsp;if str = 'CB_GETITEMDATA' then Result := CB_GETITEMDATA;<br> &nbsp;if str = 'CB_GETITEMHEIGHT' then Result := CB_GETITEMHEIGHT;<br> &nbsp;if str = 'CB_GETLBTEXT' then Result := CB_GETLBTEXT;<br> &nbsp;if str = 'CB_GETLBTEXTLEN' then Result := CB_GETLBTEXTLEN;<br> &nbsp;if str = 'CB_GETLOCALE' then Result := CB_GETLOCALE;<br> &nbsp;if str = 'CB_GETTOPINDEX' then Result := CB_GETTOPINDEX;<br> &nbsp;if str = 'CB_INITSTORAGE' then Result := CB_INITSTORAGE;<br> &nbsp;if str = 'CB_INSERTSTRING' then Result := CB_INSERTSTRING;<br> &nbsp;if str = 'CB_LIMITTEXT' then Result := CB_LIMITTEXT;<br> &nbsp;if str = 'CB_MSGMAX' then Result := CB_MSGMAX;<br> &nbsp;if str = 'CB_RESETCONTENT' then Result := CB_RESETCONTENT;<br> &nbsp;if str = 'CB_SELECTSTRING' then Result := CB_SELECTSTRING;<br> &nbsp;if str = 'CB_SETCURSEL' then Result := CB_SETCURSEL;<br> &nbsp;if str = 'CB_SETDROPPEDWIDTH' then Result := CB_SETDROPPEDWIDTH;<br> &nbsp;if str = 'CB_SETEDITSEL' then Result := CB_SETEDITSEL;<br> &nbsp;if str = 'CB_SETEXTENDEDUI' then Result := CB_SETEXTENDEDUI;<br> &nbsp;if str = 'CB_SETHORIZONTALEXTENT' then Result := CB_SETHORIZONTALEXTENT;<br> &nbsp;if str = 'CB_SETITEMDATA' then Result := CB_SETITEMDATA;<br> &nbsp;if str = 'CB_SETITEMHEIGHT' then Result := CB_SETITEMHEIGHT;<br> &nbsp;if str = 'CB_SETLOCALE' then Result := CB_SETLOCALE;<br> &nbsp;if str = 'CB_SETTOPINDEX' then Result := CB_SETTOPINDEX;<br> &nbsp;if str = 'CB_SHOWDROPDOWN' then Result := CB_SHOWDROPDOWN;<br> &nbsp;if str = 'DM_GETDEFID' then Result := DM_GETDEFID;<br> &nbsp;if str = 'DM_REPOSITION' then Result := DM_REPOSITION;<br> &nbsp;if str = 'DM_SETDEFID' then Result := DM_SETDEFID;<br> &nbsp;if str = 'EM_CANUNDO' then Result := EM_CANUNDO;<br> &nbsp;if str = 'EM_CHARFROMPOS' then Result := EM_CHARFROMPOS;<br> &nbsp;if str = 'EM_EMPTYUNDOBUFFER' then Result := EM_EMPTYUNDOBUFFER;<br> &nbsp;if str = 'EM_FMTLINES' then Result := EM_FMTLINES;<br> &nbsp;if str = 'EM_GETFIRSTVISIBLELINE' then Result := EM_GETFIRSTVISIBLELINE;<br> &nbsp;if str = 'EM_GETHANDLE' then Result := EM_GETHANDLE;<br> &nbsp;if str = 'EM_GETLIMITTEXT' then Result := EM_GETLIMITTEXT;<br> &nbsp;if str = 'EM_GETLINE' then Result := EM_GETLINE;<br> &nbsp;if str = 'EM_GETLINECOUNT' then Result := EM_GETLINECOUNT;<br> &nbsp;if str = 'EM_GETMARGINS' then Result := EM_GETMARGINS;<br> &nbsp;if str = 'EM_GETMODIFY' then Result := EM_GETMODIFY;<br> &nbsp;if str = 'EM_GETPASSWORDCHAR' then Result := EM_GETPASSWORDCHAR;<br> &nbsp;if str = 'EM_GETRECT' then Result := EM_GETRECT;<br> &nbsp;if str = 'EM_GETSEL' then Result := EM_GETSEL;<br> &nbsp;if str = 'EM_GETTHUMB' then Result := EM_GETTHUMB;<br> &nbsp;if str = 'EM_GETWORDBREAKPROC' then Result := EM_GETWORDBREAKPROC;<br> &nbsp;if str = 'EM_LIMITTEXT' then Result := EM_LIMITTEXT;<br> &nbsp;if str = 'EM_LINEFROMCHAR' then Result := EM_LINEFROMCHAR;<br> &nbsp;if str = 'EM_LINEINDEX' then Result := EM_LINEINDEX;<br> &nbsp;if str = 'EM_LINELENGTH' then Result := EM_LINELENGTH;<br> &nbsp;if str = 'EM_LINESCROLL' then Result := EM_LINESCROLL;<br> &nbsp;if str = 'EM_POSFROMCHAR' then Result := EM_POSFROMCHAR;<br> &nbsp;if str = 'EM_REPLACESEL' then Result := EM_REPLACESEL;<br> &nbsp;if str = 'EM_SCROLL' then Result := EM_SCROLL;<br> &nbsp;if str = 'EM_SCROLLCARET' then Result := EM_SCROLLCARET;<br> &nbsp;if str = 'EM_SETHANDLE' then Result := EM_SETHANDLE;<br> &nbsp;if str = 'EM_SETLIMITTEXT' then Result := EM_SETLIMITTEXT;<br> &nbsp;if str = 'EM_SETMARGINS' then Result := EM_SETMARGINS;<br> &nbsp;if str = 'EM_SETMODIFY' then Result := EM_SETMODIFY;<br> &nbsp;if str = 'EM_SETPASSWORDCHAR' then Result := EM_SETPASSWORDCHAR;<br> &nbsp;if str = 'EM_SETREADONLY' then Result := EM_SETREADONLY;<br> &nbsp;if str = 'EM_SETRECT' then Result := EM_SETRECT;<br> &nbsp;if str = 'EM_SETRECTNP' then Result := EM_SETRECTNP;<br> &nbsp;if str = 'EM_SETSEL' then Result := EM_SETSEL;<br> &nbsp;if str = 'EM_SETTABSTOPS' then Result := EM_SETTABSTOPS;<br> &nbsp;if str = 'EM_SETWORDBREAKPROC' then Result := EM_SETWORDBREAKPROC;<br> &nbsp;if str = 'EM_UNDO' then Result := EM_UNDO;<br> &nbsp;if str = 'LB_ADDFILE' then Result := LB_ADDFILE;<br> &nbsp;if str = 'LB_ADDSTRING' then Result := LB_ADDSTRING;<br> &nbsp;if str = 'LB_DELETESTRING' then Result := LB_DELETESTRING;<br> &nbsp;if str = 'LB_DIR' then Result := LB_DIR;<br> &nbsp;if str = 'LB_FINDSTRING' then Result := LB_FINDSTRING;<br> &nbsp;if str = 'LB_FINDSTRINGEXACT' then Result := LB_FINDSTRINGEXACT;<br> &nbsp;if str = 'LB_GETANCHORINDEX' then Result := LB_GETANCHORINDEX;<br> &nbsp;if str = 'LB_GETCARETINDEX' then Result := LB_GETCARETINDEX;<br> &nbsp;if str = 'LB_GETCOUNT' then Result := LB_GETCOUNT;<br> &nbsp;if str = 'LB_GETCURSEL' then Result := LB_GETCURSEL;<br> &nbsp;if str = 'LB_GETHORIZONTALEXTENT' then Result := LB_GETHORIZONTALEXTENT;<br> &nbsp;if str = 'LB_GETITEMDATA' then Result := LB_GETITEMDATA;<br> &nbsp;if str = 'LB_GETITEMHEIGHT' then Result := LB_GETITEMHEIGHT;<br> &nbsp;if str = 'LB_GETITEMRECT' then Result := LB_GETITEMRECT;<br> &nbsp;if str = 'LB_GETLOCALE' then Result := LB_GETLOCALE;<br> &nbsp;if str = 'LB_GETSEL' then Result := LB_GETSEL;<br> &nbsp;if str = 'LB_GETSELCOUNT' then Result := LB_GETSELCOUNT;<br> &nbsp;if str = 'LB_GETSELITEMS' then Result := LB_GETSELITEMS;<br> &nbsp;if str = 'LB_GETTEXT' then Result := LB_GETTEXT;<br> &nbsp;if str = 'LB_GETTEXTLEN' then Result := LB_GETTEXTLEN;<br> &nbsp;if str = 'LB_GETTOPINDEX' then Result := LB_GETTOPINDEX;<br> &nbsp;if str = 'LB_INITSTORAGE' then Result := LB_INITSTORAGE;<br> &nbsp;if str = 'LB_INSERTSTRING' then Result := LB_INSERTSTRING;<br> &nbsp;if str = 'LB_ITEMFROMPOINT' then Result := LB_ITEMFROMPOINT;<br> &nbsp;if str = 'LB_MSGMAX' then Result := LB_MSGMAX;<br> &nbsp;if str = 'LB_RESETCONTENT' then Result := LB_RESETCONTENT;<br> &nbsp;if str = 'LB_SELECTSTRING' then Result := LB_SELECTSTRING;<br> &nbsp;if str = 'LB_SELITEMRANGE' then Result := LB_SELITEMRANGE;<br> &nbsp;if str = 'LB_SELITEMRANGEEX' then Result := LB_SELITEMRANGEEX;<br> &nbsp;if str = 'LB_SETANCHORINDEX' then Result := LB_SETANCHORINDEX;<br> &nbsp;if str = 'LB_SETCARETINDEX' then Result := LB_SETCARETINDEX;<br> &nbsp;if str = 'LB_SETCOLUMNWIDTH' then Result := LB_SETCOLUMNWIDTH;<br> &nbsp;if str = 'LB_SETCOUNT' then Result := LB_SETCOUNT;<br> &nbsp;if str = 'LB_SETCURSEL' then Result := LB_SETCURSEL;<br> &nbsp;if str = 'LB_SETHORIZONTALEXTENT' then Result := LB_SETHORIZONTALEXTENT;<br> &nbsp;if str = 'LB_SETITEMDATA' then Result := LB_SETITEMDATA;<br> &nbsp;if str = 'LB_SETITEMHEIGHT' then Result := LB_SETITEMHEIGHT;<br> &nbsp;if str = 'LB_SETLOCALE' then Result := LB_SETLOCALE;<br> &nbsp;if str = 'LB_SETSEL' then Result := LB_SETSEL;<br> &nbsp;if str = 'LB_SETTABSTOPS' then Result := LB_SETTABSTOPS;<br> &nbsp;if str = 'LB_SETTOPINDEX' then Result := LB_SETTOPINDEX;<br> &nbsp;if str = 'SBM_ENABLE_ARROWS' then Result := SBM_ENABLE_ARROWS;<br> &nbsp;if str = 'SBM_GETPOS' then Result := SBM_GETPOS;<br> &nbsp;if str = 'SBM_GETRANGE' then Result := SBM_GETRANGE;<br> &nbsp;if str = 'SBM_GETSCROLLINFO' then Result := SBM_GETSCROLLINFO;<br> &nbsp;if str = 'SBM_SETPOS' then Result := SBM_SETPOS;<br> &nbsp;if str = 'SBM_SETRANGE' then Result := SBM_SETRANGE;<br> &nbsp;if str = 'SBM_SETRANGEREDRAW' then Result := SBM_SETRANGEREDRAW;<br> &nbsp;if str = 'SBM_SETSCROLLINFO' then Result := SBM_SETSCROLLINFO;<br> &nbsp;if str = 'STM_GETICON' then Result := STM_GETICON;<br> &nbsp;if str = 'STM_GETIMAGE' then Result := STM_GETIMAGE;<br> &nbsp;if str = 'STM_MSGMAX' then Result := STM_MSGMAX;<br> &nbsp;if str = 'STM_SETICON' then Result := STM_SETICON;<br> &nbsp;if str = 'STM_SETIMAGE' then Result := STM_SETIMAGE;<br> &nbsp;if str = 'WM_ACTIVATE' then Result := WM_ACTIVATE;<br> &nbsp;if str = 'WM_ACTIVATEAPP' then Result := WM_ACTIVATEAPP;<br> &nbsp;if str = 'WM_APP' then Result := WM_APP;<br> &nbsp;if str = 'WM_ASKCBFORMATNAME' then Result := WM_ASKCBFORMATNAME;<br> &nbsp;if str = 'WM_CANCELJOURNAL' then Result := WM_CANCELJOURNAL;<br> &nbsp;if str = 'WM_CANCELMODE' then Result := WM_CANCELMODE;<br> &nbsp;if str = 'WM_CAPTURECHANGED' then Result := WM_CAPTURECHANGED;<br> &nbsp;if str = 'WM_CHANGECBCHAIN' then Result := WM_CHANGECBCHAIN;<br> &nbsp;if str = 'WM_CHAR' then Result := WM_CHAR;<br> &nbsp;if str = 'WM_CHARTOITEM' then Result := WM_CHARTOITEM;<br> &nbsp;if str = 'WM_CHILDACTIVATE' then Result := WM_CHILDACTIVATE;<br> &nbsp;if str = 'WM_CLEAR' then Result := WM_CLEAR;<br> &nbsp;if str = 'WM_CLOSE' then Result := WM_CLOSE;<br> &nbsp;if str = 'WM_COALESCE_FIRST' then Result := WM_COALESCE_FIRST;<br> &nbsp;if str = 'WM_COALESCE_LAST' then Result := WM_COALESCE_LAST;<br> &nbsp;if str = 'WM_COMMAND' then Result := WM_COMMAND;<br> &nbsp;if str = 'WM_COMMNOTIFY' then Result := WM_COMMNOTIFY;<br> &nbsp;if str = 'WM_COMPACTING' then Result := WM_COMPACTING;<br> &nbsp;if str = 'WM_COMPAREITEM' then Result := WM_COMPAREITEM;<br> &nbsp;if str = 'WM_CONTEXTMENU' then Result := WM_CONTEXTMENU;<br> &nbsp;if str = 'WM_COPY' then Result := WM_COPY;<br> &nbsp;if str = 'WM_COPYDATA' then Result := WM_COPYDATA;<br> &nbsp;if str = 'WM_CREATE' then Result := WM_CREATE;<br> &nbsp;if str = 'WM_CTLCOLOR' then Result := WM_CTLCOLOR;<br> &nbsp;if str = 'WM_CTLCOLORBTN' then Result := WM_CTLCOLORBTN;<br> &nbsp;if str = 'WM_CTLCOLORDLG' then Result := WM_CTLCOLORDLG;<br> &nbsp;if str = 'WM_CTLCOLOREDIT' then Result := WM_CTLCOLOREDIT;<br> &nbsp;if str = 'WM_CTLCOLORLISTBOX' then Result := WM_CTLCOLORLISTBOX;<br> &nbsp;if str = 'WM_CTLCOLORMSGBOX' then Result := WM_CTLCOLORMSGBOX;<br> &nbsp;if str = 'WM_CTLCOLORSCROLLBAR' then Result := WM_CTLCOLORSCROLLBAR;<br> &nbsp;if str = 'WM_CTLCOLORSTATIC' then Result := WM_CTLCOLORSTATIC;<br> &nbsp;if str = 'WM_CUT' then Result := WM_CUT;<br> &nbsp;if str = 'WM_DDE_ACK' then Result := WM_DDE_ACK;<br> &nbsp;if str = 'WM_DDE_ADVISE' then Result := WM_DDE_ADVISE;<br> &nbsp;if str = 'WM_DDE_DATA' then Result := WM_DDE_DATA;<br> &nbsp;if str = 'WM_DDE_EXECUTE' then Result := WM_DDE_EXECUTE;<br> &nbsp;if str = 'WM_DDE_FIRST' then Result := WM_DDE_FIRST;<br> &nbsp;if str = 'WM_DDE_INITIATE' then Result := WM_DDE_INITIATE;<br> &nbsp;if str = 'WM_DDE_LAST' then Result := WM_DDE_LAST;<br> &nbsp;if str = 'WM_DDE_POKE' then Result := WM_DDE_POKE;<br> &nbsp;if str = 'WM_DDE_REQUEST' then Result := WM_DDE_REQUEST;<br> &nbsp;if str = 'WM_DDE_TERMINATE' then Result := WM_DDE_TERMINATE;<br> &nbsp;if str = 'WM_DDE_UNADVISE' then Result := WM_DDE_UNADVISE;<br> &nbsp;if str = 'WM_DEADCHAR' then Result := WM_DEADCHAR;<br> &nbsp;if str = 'WM_DELETEITEM' then Result := WM_DELETEITEM;<br> &nbsp;if str = 'WM_DESTROY' then Result := WM_DESTROY;<br> &nbsp;if str = 'WM_DESTROYCLIPBOARD' then Result := WM_DESTROYCLIPBOARD;<br> &nbsp;if str = 'WM_DEVICECHANGE' then Result := WM_DEVICECHANGE;<br> &nbsp;if str = 'WM_DEVMODECHANGE' then Result := WM_DEVMODECHANGE;<br> &nbsp;if str = 'WM_DISPLAYCHANGE' then Result := WM_DISPLAYCHANGE;<br> &nbsp;if str = 'WM_DRAWCLIPBOARD' then Result := WM_DRAWCLIPBOARD;<br> &nbsp;if str = 'WM_DRAWITEM' then Result := WM_DRAWITEM;<br> &nbsp;if str = 'WM_DROPFILES' then Result := WM_DROPFILES;<br> &nbsp;if str = 'WM_ENABLE' then Result := WM_ENABLE;<br> &nbsp;if str = 'WM_ENDSESSION' then Result := WM_ENDSESSION;<br> &nbsp;if str = 'WM_ENTERIDLE' then Result := WM_ENTERIDLE;<br> &nbsp;if str = 'WM_ENTERMENULOOP' then Result := WM_ENTERMENULOOP;<br> &nbsp;if str = 'WM_ENTERSIZEMOVE' then Result := WM_ENTERSIZEMOVE;<br> &nbsp;if str = 'WM_ERASEBKGND' then Result := WM_ERASEBKGND;<br> &nbsp;if str = 'WM_EXITMENULOOP' then Result := WM_EXITMENULOOP;<br> &nbsp;if str = 'WM_EXITSIZEMOVE' then Result := WM_EXITSIZEMOVE;<br> &nbsp;if str = 'WM_FONTCHANGE' then Result := WM_FONTCHANGE;<br> &nbsp;if str = 'WM_GETDLGCODE' then Result := WM_GETDLGCODE;<br> &nbsp;if str = 'WM_GETFONT' then Result := WM_GETFONT;<br> &nbsp;if str = 'WM_GETHOTKEY' then Result := WM_GETHOTKEY;<br> &nbsp;if str = 'WM_GETICON' then Result := WM_GETICON;<br> &nbsp;if str = 'WM_GETMINMAXINFO' then Result := WM_GETMINMAXINFO;<br> &nbsp;if str = 'WM_GETTEXT' then Result := WM_GETTEXT;<br> &nbsp;if str = 'WM_GETTEXTLENGTH' then Result := WM_GETTEXTLENGTH;<br> &nbsp;if str = 'WM_HANDHELDFIRST' then Result := WM_HANDHELDFIRST;<br> &nbsp;if str = 'WM_HANDHELDLAST' then Result := WM_HANDHELDLAST;<br> &nbsp;if str = 'WM_HELP' then Result := WM_HELP;<br> &nbsp;if str = 'WM_HOTKEY' then Result := WM_HOTKEY;<br> &nbsp;if str = 'WM_HSCROLL' then Result := WM_HSCROLL;<br> &nbsp;if str = 'WM_HSCROLLCLIPBOARD' then Result := WM_HSCROLLCLIPBOARD;<br> &nbsp;if str = 'WM_ICONERASEBKGND' then Result := WM_ICONERASEBKGND;<br> &nbsp;if str = 'WM_IME_CHAR' then Result := WM_IME_CHAR;<br> &nbsp;if str = 'WM_IME_COMPOSITION' then Result := WM_IME_COMPOSITION;<br> &nbsp;if str = 'WM_IME_COMPOSITIONFULL' then Result := WM_IME_COMPOSITIONFULL;<br> &nbsp;if str = 'WM_IME_CONTROL' then Result := WM_IME_CONTROL;<br> &nbsp;if str = 'WM_IME_ENDCOMPOSITION' then Result := WM_IME_ENDCOMPOSITION;<br> &nbsp;if str = 'WM_IME_KEYDOWN' then Result := WM_IME_KEYDOWN;<br> &nbsp;if str = 'WM_IME_KEYLAST' then Result := WM_IME_KEYLAST;<br> &nbsp;if str = 'WM_IME_KEYUP' then Result := WM_IME_KEYUP;<br> &nbsp;if str = 'WM_IME_NOTIFY' then Result := WM_IME_NOTIFY;<br> &nbsp;if str = 'WM_IME_SELECT' then Result := WM_IME_SELECT;<br> &nbsp;if str = 'WM_IME_SETCONTEXT' then Result := WM_IME_SETCONTEXT;<br> &nbsp;if str = 'WM_IME_STARTCOMPOSITION' then Result := WM_IME_STARTCOMPOSITION;<br> &nbsp;if str = 'WM_INITDIALOG' then Result := WM_INITDIALOG;<br> &nbsp;if str = 'WM_INITMENU' then Result := WM_INITMENU;<br> &nbsp;if str = 'WM_INITMENUPOPUP' then Result := WM_INITMENUPOPUP;<br> &nbsp;if str = 'WM_INPUTLANGCHANGE' then Result := WM_INPUTLANGCHANGE;<br> &nbsp;if str = 'WM_INPUTLANGCHANGEREQUEST' then Result := WM_INPUTLANGCHANGEREQUEST;<br> &nbsp;if str = 'WM_KEYDOWN' then Result := WM_KEYDOWN;<br> &nbsp;if str = 'WM_KEYFIRST' then Result := WM_KEYFIRST;<br> &nbsp;if str = 'WM_KEYLAST' then Result := WM_KEYLAST;<br> &nbsp;if str = 'WM_KEYUP' then Result := WM_KEYUP;<br> &nbsp;if str = 'WM_KILLFOCUS' then Result := WM_KILLFOCUS;<br> &nbsp;if str = 'WM_LBUTTONDBLCLK' then Result := WM_LBUTTONDBLCLK;<br> &nbsp;if str = 'WM_LBUTTONDOWN' then Result := WM_LBUTTONDOWN;<br> &nbsp;if str = 'WM_LBUTTONUP' then Result := WM_LBUTTONUP;<br> &nbsp;if str = 'WM_MBUTTONDBLCLK' then Result := WM_MBUTTONDBLCLK;<br> &nbsp;if str = 'WM_MBUTTONDOWN' then Result := WM_MBUTTONDOWN;<br> &nbsp;if str = 'WM_MBUTTONUP' then Result := WM_MBUTTONUP;<br> &nbsp;if str = 'WM_MDIACTIVATE' then Result := WM_MDIACTIVATE;<br> &nbsp;if str = 'WM_MDICASCADE' then Result := WM_MDICASCADE;<br> &nbsp;if str = 'WM_MDICREATE' then Result := WM_MDICREATE;<br> &nbsp;if str = 'WM_MDIDESTROY' then Result := WM_MDIDESTROY;<br> &nbsp;if str = 'WM_MDIGETACTIVE' then Result := WM_MDIGETACTIVE;<br> &nbsp;if str = 'WM_MDIICONARRANGE' then Result := WM_MDIICONARRANGE;<br> &nbsp;if str = 'WM_MDIMAXIMIZE' then Result := WM_MDIMAXIMIZE;<br> &nbsp;if str = 'WM_MDINEXT' then Result := WM_MDINEXT;<br> &nbsp;if str = 'WM_MDIREFRESHMENU' then Result := WM_MDIREFRESHMENU;<br> &nbsp;if str = 'WM_MDIRESTORE' then Result := WM_MDIRESTORE;<br> &nbsp;if str = 'WM_MDISETMENU' then Result := WM_MDISETMENU;<br> &nbsp;if str = 'WM_MDITILE' then Result := WM_MDITILE;<br> &nbsp;if str = 'WM_MEASUREITEM' then Result := WM_MEASUREITEM;<br> &nbsp;if str = 'WM_MENUCHAR' then Result := WM_MENUCHAR;<br> &nbsp;if str = 'WM_MENUSELECT' then Result := WM_MENUSELECT;<br> &nbsp;if str = 'WM_MOUSEACTIVATE' then Result := WM_MOUSEACTIVATE;<br> &nbsp;if str = 'WM_MOUSEFIRST' then Result := WM_MOUSEFIRST;<br> &nbsp;if str = 'WM_MOUSEHOVER' then Result := WM_MOUSEHOVER;<br> &nbsp;if str = 'WM_MOUSELAST' then Result := WM_MOUSELAST;<br> &nbsp;if str = 'WM_MOUSELEAVE' then Result := WM_MOUSELEAVE;<br> &nbsp;if str = 'WM_MOUSEMOVE' then Result := WM_MOUSEMOVE;<br> &nbsp;if str = 'WM_MOUSEWHEEL' then Result := WM_MOUSEWHEEL;<br> &nbsp;if str = 'WM_MOVE' then Result := WM_MOVE;<br> &nbsp;if str = 'WM_MOVING' then Result := WM_MOVING;<br> &nbsp;if str = 'WM_NCACTIVATE' then Result := WM_NCACTIVATE;<br> &nbsp;if str = 'WM_NCCALCSIZE' then Result := WM_NCCALCSIZE;<br> &nbsp;if str = 'WM_NCCREATE' then Result := WM_NCCREATE;<br> &nbsp;if str = 'WM_NCDESTROY' then Result := WM_NCDESTROY;<br> &nbsp;if str = 'WM_NCHITTEST' then Result := WM_NCHITTEST;<br> &nbsp;if str = 'WM_NCLBUTTONDBLCLK' then Result := WM_NCLBUTTONDBLCLK;<br> &nbsp;if str = 'WM_NCLBUTTONDOWN' then Result := WM_NCLBUTTONDOWN;<br> &nbsp;if str = 'WM_NCLBUTTONUP' then Result := WM_NCLBUTTONUP;<br> &nbsp;if str = 'WM_NCMBUTTONDBLCLK' then Result := WM_NCMBUTTONDBLCLK;<br> &nbsp;if str = 'WM_NCMBUTTONDOWN' then Result := WM_NCMBUTTONDOWN;<br> &nbsp;if str = 'WM_NCMBUTTONUP' then Result := WM_NCMBUTTONUP;<br> &nbsp;if str = 'WM_NCMOUSEMOVE' then Result := WM_NCMOUSEMOVE;<br> &nbsp;if str = 'WM_NCPAINT' then Result := WM_NCPAINT;<br> &nbsp;if str = 'WM_NCRBUTTONDBLCLK' then Result := WM_NCRBUTTONDBLCLK;<br> &nbsp;if str = 'WM_NCRBUTTONDOWN' then Result := WM_NCRBUTTONDOWN;<br> &nbsp;if str = 'WM_NCRBUTTONUP' then Result := WM_NCRBUTTONUP;<br> &nbsp;if str = 'WM_NEXTDLGCTL' then Result := WM_NEXTDLGCTL;<br> &nbsp;if str = 'WM_NEXTMENU' then Result := WM_NEXTMENU;<br> &nbsp;if str = 'WM_NOTIFY' then Result := WM_NOTIFY;<br> &nbsp;if str = 'WM_NOTIFYFORMAT' then Result := WM_NOTIFYFORMAT;<br> &nbsp;if str = 'WM_NULL' then Result := WM_NULL;<br> &nbsp;if str = 'WM_PAINT' then Result := WM_PAINT;<br> &nbsp;if str = 'WM_PAINTCLIPBOARD' then Result := WM_PAINTCLIPBOARD;<br> &nbsp;if str = 'WM_PAINTICON' then Result := WM_PAINTICON;<br> &nbsp;if str = 'WM_PALETTECHANGED' then Result := WM_PALETTECHANGED;<br> &nbsp;if str = 'WM_PALETTEISCHANGING' then Result := WM_PALETTEISCHANGING;<br> &nbsp;if str = 'WM_PARENTNOTIFY' then Result := WM_PARENTNOTIFY;<br> &nbsp;if str = 'WM_PASTE' then Result := WM_PASTE;<br> &nbsp;if str = 'WM_PENWINFIRST' then Result := WM_PENWINFIRST;<br> &nbsp;if str = 'WM_PENWINLAST' then Result := WM_PENWINLAST;<br> &nbsp;if str = 'WM_POWER' then Result := WM_POWER;<br> &nbsp;if str = 'WM_POWERBROADCAST' then Result := WM_POWERBROADCAST;<br> &nbsp;if str = 'WM_PRINT' then Result := WM_PRINT;<br> &nbsp;if str = 'WM_PRINTCLIENT' then Result := WM_PRINTCLIENT;<br> &nbsp;if str = 'WM_QUERYDRAGICON' then Result := WM_QUERYDRAGICON;<br> &nbsp;if str = 'WM_QUERYENDSESSION' then Result := WM_QUERYENDSESSION;<br> &nbsp;if str = 'WM_QUERYNEWPALETTE' then Result := WM_QUERYNEWPALETTE;<br> &nbsp;if str = 'WM_QUERYOPEN' then Result := WM_QUERYOPEN;<br> &nbsp;if str = 'WM_QUEUESYNC' then Result := WM_QUEUESYNC;<br> &nbsp;if str = 'WM_QUIT' then Result := WM_QUIT;<br> &nbsp;if str = 'WM_RBUTTONDBLCLK' then Result := WM_RBUTTONDBLCLK;<br> &nbsp;if str = 'WM_RBUTTONDOWN' then Result := WM_RBUTTONDOWN;<br> &nbsp;if str = 'WM_RBUTTONUP' then Result := WM_RBUTTONUP;<br> &nbsp;if str = 'WM_RENDERALLFORMATS' then Result := WM_RENDERALLFORMATS;<br> &nbsp;if str = 'WM_RENDERFORMAT' then Result := WM_RENDERFORMAT;<br> &nbsp;if str = 'WM_SETCURSOR' then Result := WM_SETCURSOR;<br> &nbsp;if str = 'WM_SETFOCUS' then Result := WM_SETFOCUS;<br> &nbsp;if str = 'WM_SETFONT' then Result := WM_SETFONT;<br> &nbsp;if str = 'WM_SETHOTKEY' then Result := WM_SETHOTKEY;<br> &nbsp;if str = 'WM_SETICON' then Result := WM_SETICON;<br> &nbsp;if str = 'WM_SETREDRAW' then Result := WM_SETREDRAW;<br> &nbsp;if str = 'WM_SETTEXT' then Result := WM_SETTEXT;<br> &nbsp;if str = 'WM_SETTINGCHANGE' then Result := WM_SETTINGCHANGE;<br> &nbsp;if str = 'WM_SHOWWINDOW' then Result := WM_SHOWWINDOW;<br> &nbsp;if str = 'WM_SIZE' then Result := WM_SIZE;<br> &nbsp;if str = 'WM_SIZECLIPBOARD' then Result := WM_SIZECLIPBOARD;<br> &nbsp;if str = 'WM_SIZING' then Result := WM_SIZING;<br> &nbsp;if str = 'WM_SPOOLERSTATUS' then Result := WM_SPOOLERSTATUS;<br> &nbsp;if str = 'WM_STYLECHANGED' then Result := WM_STYLECHANGED;<br> &nbsp;if str = 'WM_STYLECHANGING' then Result := WM_STYLECHANGING;<br> &nbsp;if str = 'WM_SYSCHAR' then Result := WM_SYSCHAR;<br> &nbsp;if str = 'WM_SYSCOLORCHANGE' then Result := WM_SYSCOLORCHANGE;<br> &nbsp;if str = 'WM_SYSCOMMAND' then Result := WM_SYSCOMMAND;<br> &nbsp;if str = 'WM_SYSDEADCHAR' then Result := WM_SYSDEADCHAR;<br> &nbsp;if str = 'WM_SYSKEYDOWN' then Result := WM_SYSKEYDOWN;<br> &nbsp;if str = 'WM_SYSKEYUP' then Result := WM_SYSKEYUP;<br> &nbsp;if str = 'WM_SYSTEMERROR' then Result := WM_SYSTEMERROR;<br> &nbsp;if str = 'WM_TCARD' then Result := WM_TCARD;<br> &nbsp;if str = 'WM_TIMECHANGE' then Result := WM_TIMECHANGE;<br> &nbsp;if str = 'WM_TIMER' then Result := WM_TIMER;<br> &nbsp;if str = 'WM_UNDO' then Result := WM_UNDO;<br> &nbsp;if str = 'WM_USER' then Result := WM_USER;<br> &nbsp;if str = 'WM_USERCHANGED' then Result := WM_USERCHANGED;<br> &nbsp;if str = 'WM_VKEYTOITEM' then Result := WM_VKEYTOITEM;<br> &nbsp;if str = 'WM_VSCROLL' then Result := WM_VSCROLL;<br> &nbsp;if str = 'WM_VSCROLLCLIPBOARD' then Result := WM_VSCROLLCLIPBOARD;<br> &nbsp;if str = 'WM_WINDOWPOSCHANGED' then Result := WM_WINDOWPOSCHANGED;<br> &nbsp;if str = 'WM_WINDOWPOSCHANGING' then Result := WM_WINDOWPOSCHANGING;<br> &nbsp;if str = 'WM_WININICHANGE' then Result := WM_WININICHANGE;<br>end;<br><br>运行后出现错误:<br>[Warning] Unit1.pas(625): Return value of function 'Tmainform.StrToCardinal' might be undefined
 
接受答案
 
后退
顶部