Guidance
指路人
g.yi.org
software / rapidq / examples / gui / Edit & Richedit / Win32API RichEdit / API_RichEdit_Program.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'=======================================================
' Type Object
' Class Api_RichEdit
'=======================================================

     DECLARE FUNCTION LoadLibrary LIB "KERNEL32" ALIAS "LoadLibraryA" _
      (LibFileName AS STRING) AS LONG
     DECLARE FUNCTION FreeLibrary LIB "KERNEL32" ALIAS "FreeLibrary" _
      (hInst AS LONG) AS LONG

     DECLARE FUNCTION CreateWindowEx LIB "USER32" ALIAS "CreateWindowExA" _
      (ExStyle&, ClassName$, WindowName$, Style&, X&, Y&, _
      Width&, Height&, WndParent&, hMenu&, hInstance&, Param&) AS LONG

     DIM hInst AS LONG

     $DEFINE HWND INTEGER

     CONST WS_EX_CLIENTEDGE = &H200 ' Just some of the many API constants
     CONST WS_CHILD = &H40000000
     CONST WS_VISIBLE = &H10000000
     CONST WS_BORDER = &H800000
     CONST ES_LEFT = 0
     CONST ES_AUTOHSCROLL = &H80
     CONST ES_MULTILINE = &H4

     CONST WM_COMMAND = &H111

     DECLARE FUNCTION GetModuleHandle LIB "KERNEL32" ALIAS "GetModuleHandleA" _
      (ModuleName AS STRING) AS LONG

     DECLARE FUNCTION SetWindowText LIB "USER32" ALIAS "SetWindowTextA" _
      (Hwnd AS INTEGER, Text AS STRING) AS LONG

     DECLARE SUB FormWndProc (Handle AS INTEGER, uMsg AS LONG, wParam AS LONG,lParam AS LONG)


     hInst = LoadLibrary("RICHED32.DLL")

     DIM Form AS QFORM
     Form.Center
     Form.Width = 640
     Form.Height =480

     DIM EditHandle AS HWND
     DIM ButtonHandle AS HWND

     EditHandle = CreateWindowEx( _
      WS_EX_CLIENTEDGE, "RichEdit", "RichEdit Program", _
      WS_CHILD OR WS_VISIBLE OR WS_BORDER OR ES_LEFT OR _
      ES_AUTOHSCROLL OR ES_MULTILINE, _
      10,10,500,425, _
      _ '- X (Left) Y (Top) Width Height
      Form.Handle, _
      _ '- hWndParent HWND
      5,            GetModuleHandle("API_RichEdid.EXE"),       1       )
' hMenu HMENU      hInstance HANDLE                 lpParam LPSTR

     Form.CAPTION = "Api RichEdit"
'Form.WndProc = FormWndProc
     Form.SHOWMODAL

'SendMessage(Memo1.Handle, EM_LINESCROLL, 0, Memo1.Lines.Count-1);


     SUB FormWndProc (Handle AS INTEGER, uMsg AS DWORD, wParam AS LONG, lParam AS LONG)

'IF uMsg = WM_COMMAND THEN''
'	IF lParam = 0 THEN''
'		IF (wParam AND &HFF) = IDM_CLEAR THEN
'			SetWindowText EditHandle(wParam SHR 8), ""
'		END IF
'	ELSE
'	SELECT CASE (wParam AND &HFFFF)
'	CASE IS = 1 AND (wParam SHR 16) = BN_CLICKED '-- Button 1 clicked
'		SendMessage(Handle, WM_COMMAND, &H0100 OR IDM_CLEAR, 0)
'	END SELECT
'	END IF
'END IF

     END SUB
掌柜推荐
 
 
¥1,380.00 ·
 
 
¥1,450.00 ·
 
 
¥477.00 ·
 
 
¥264.00 ·
 
 
¥1,280.00 ·
 
 
¥489.00 ·
© Mon 2024-11-25  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-05-02 21:47:12