RE: w32engin

new topic     » goto parent     » topic index » view thread      » older message » newer message

> 
> Tyler:
> 
>    I assume that you are setting the coulmn header.
>    I don't think it is a problem with the w32engine.
> 
>    Be sure that you are allowing enough width, the
>    width in cx is given in PIXELS. You could try using
>    fmt and setting the text to left justify. It is
>    hard for me to help you with out seeing a complete
>    code listing. 
> 
> Bernie
> 

Here is a copy of my code (I don't have access to attachments):
<code>
without warning
include w32engin.ew
include dll.e

HWND hLV

--List View Support
global constant 
LVM_FIRST=4096,LVCF_FMT=1,LVCF_WIDTH=2,LVCF_TEXT=4,LVCF_SUBITEM=8,LVM_INSERTCOLUMN=(LVM_FIRST+97)


StList &= { {0,"LV_COLUMN",
    "mask        : uint   : 1 "& 
    "fmt         : int    : 1 "&
    "cx          : int    : 1 "&
    "pszText     : pointer : 1 "&
    "cchTextMax  : int    : 1 "&
    "iSubItem    : int    : 1 "} }

-- Define the Main CallBack Procedure to respond to messages from 
Windows.
function MainProc(HWND hWnd,UINT case,WPARAM wParam, LPARAM lParam)
pointer pCol
atom void
  if case = WM_CREATE then    
    hLV = CreateWindowExA({WS_EX_CLIENTEDGE, sz(WC_LISTVIEWA), NULL,
			OR({WS_VISIBLE,WS_CHILD,WS_BORDER, LVS_REPORT, 
LVS_SHOWSELALWAYS,LVS_SINGLESEL}),
			0, 0, 300, 500,
			hWnd, NULL, NULL, NULL })
    if hLV = NULL then void = MessageBoxA({hWnd, "Error Creating 
ListView!", "asdf", 0}) end if
    
    pCol = struc("LV_COLUMN")
    put(pCol, "mask", OR({LVCF_TEXT,LVCF_WIDTH}))
    put(pCol, "cx", 100)
    put(pCol, "pszText", sz("test"))

    void = SendMessageA({hLV, LVM_INSERTCOLUMN, 0, pCol})
  elsif case = WM_DESTROY then -- Received message to Shutdown.
    PostQuitMessage(0)      -- Tell windows to close the Application.
  else -- Default Built-in Window Procedure will Respond to any other 
messages
    return DefWindowProcA({hWnd,case,wParam,lParam})
  end if
  return 0 -- Euphoria needs to have a function return something.
end function

-- The Main Window.
procedure MainWindow()
RESULT ok
HWND hWnd
WNDCLASS wc
MSG msg
  -- Define the class
  -- Declare the window class structure & initialize the members
  wc = struc({"WNDCLASS",{OR({CS_HREDRAW,CS_VREDRAW}), -- Class and 
Styles
	      -- Tell Windows where to send callback messages for this Class
                    call_back(routine_id("MainProc")), -- Callback 
Procedure
                                                0,0,0, -- Not needed
                       LoadIconA({0,IDI_APPLICATION}), -- Default icon
                           LoadCursorA({0,IDC_ARROW}), -- Default Cursor
                                       COLOR_WINDOW+1, -- Background 
Color
                                           sz("Menu"), -- szpointer Menu 
name
                                  sz("SimpleClass")}}) -- szpointer 
Class name
  -- Register the class that was just defined.
  ok = RegisterClassA(wc)
  --init common controls
  InitCommonControls()
  -- Create an instance of the Registered Class
  hWnd = CreateWindowA({sz("SimpleClass"), -- szpointer Class name
             sz(" Generic Simple Window"), -- szPointer Window Title
                      WS_OVERLAPPEDWINDOW, -- Window style
                          200,100,400,300, -- X, Y, Width, Height
                      0,0,THIS_PROGRAM,0})
  -- Display the window
  ok = ShowWindow({hWnd,SW_SHOWNORMAL})
  -- Paint the client area by sending WM_PAINT to the Window
  ok = UpdateWindow(hWnd)
  -- Declare a message structure.
  msg = struc("MSG")
  -- Create the message loop.
  -- Retrieve a message from the Windows message queue
  --   and copys it to an MSG structure.
  while GetMessageA({msg,0,0,0}) do
    -- Translate any virtual-key messages
    --   to the real keys
    ok = TranslateMessage(msg)
    -- Dispatch the message to the handle
    --   specified in MSG structure
    ok = DispatchMessageA(msg)
  end while
--
end procedure

MainWindow()

</code>

I assume that you have w32eng

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu