All pastes #835415 Raw Edit

Stuff

public text v1 · immutable
#835415 ·published 2007-12-28 21:27 UTC
rendered paste body
  const WS_VISABLE = &h10000000
  const WS_CHILD = &h40000000
  const WS_BORDER = &h00800000
  const WS_TABSTOP = &h00010000
  
  Declare function GetLastError lib "Kernel32"() as integer
  
  Declare Function GetModuleHandleA Lib "Kernel32" ( nothing as Integer ) as Integer
  
  Declare function LoadLibraryA lib "Kernel32" ( lpFileName as cstring ) as integer
  
  declare function CreateWindowExA Lib "User32" (dwExStyle as integer,_
      lpClassName as cstring,_
      lpWindowName as cstring,_
      dwStyle as integer,_
      x as integer,_
      y as integer,_
      nWidth as integer,_
      nHeight as integer,_
      hWndparent as integer,_
      hMenu as integer,_
      hInstance as integer,_
      lpParam as cstring) as integer
  
  dim hwndEdit as integer
  dim hInst as integer
  dim hModule as integer
  dim err as integer
  
  hInst = GetModuleHandleA(0)
  
  err = GetLastError()
  msgBox(str(err))
  
  hModule = LoadLibraryA("Riched20.dll")
  err = GetLastError()
  msgBox(str(err))
  
  hwndEdit = CreateWindowExA(0,"RICHEDIT_CLASS","Type here",_
      WS_VISABLE+WS_CHILD+WS_TABSTOP+WS_BORDER,_
      10,10,100,100,me.Handle,0,hInst,"")
  err = GetLastError()
  msgBox(str(err))
  
  if hwndEdit = 0 then msgBox("Failed")
  beep