RE: Common Dialogs

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

The code ak- at inbox.as posted seems to work great! I wish I could find his/her name so I could thank them. If you're reading the list, well, thank you. -=Csasidy=- euman at bellsouth.net wrote: > And to think I've been doing it like this for sometime now..... > > Makes me want to revert back to win32lib > ,, > ,, > ,, > ,, > naw..hehe > > global function getDrives() > sequence drive,Drives,DrivesReady,info > atom bit > integer DriveLetter > > retv=c_func(hGetLogicalDrives,{}) > Drives={} > DrivesReady={} > bit=1 > for k=1 to 26 do > if and_bits(bit,retv) then > DriveLetter=k+64 > drive=DriveLetter&":\\" > Drives=append(Drives,drive) > end if > bit=bit*2 > end for > return Drives > end function > > global sequence drives > drives = getDrives() -- check for drives > > integer Serial, Dtype_str, Dtype > sequence Drive_ids Drive_ids = {} -- get volume name and serial # > sequence Drive_type Drive_type = {} -- type of drive > > for i = 1 to length(drives) do > > Dtype_str = allocate_string2(drives[i]) > Dtype = c_func(xGetDriveType, {Dtype_str}) > Drive_ids = append(Drive_ids, getVolSerial(drives[i])) > Drive_type = append(Drive_type, Dtype) > free(Dtype_str) > > end for > > atom TreeView1 > TreeView1 = 0 > > global function WndProc(atom hwnd, atom iMsg, atom wParam, atom lParam) > > if iMsg = WM_CREATE then > > TreeView1 = MakeTreeView(hwnd, "TreeView1", 175, 190, 175, 150) > > c_proc(ShowWindow,{TreeView1, 1}) > > for i = 1 to length(drives) do > > if length(Drive_ids[i][1]) > 0 then > iParent = allocate_string2(Drive_ids[i][1] & " " & drives[i]) > else > iParent = allocate_string2(drives[i]) > end if > > poke4( tvstruct + TVINSERTSTRUCTITEM_pszText,iParent) > poke4( tvstruct + TVINSERTSTRUCTITEM_iImage,Drive_type[i]-2) > poke4( tvstruct + > TVINSERTSTRUCTITEM_iSelectedImage,Drive_type[i]-2) > hParent = c_func(SendMessage,{TreeView1,TVM_INSERTITEM, 0, > tvstruct}) > free(iParent) > > end for > > elsif iMsg = WM_NOTIFY then > > id = peek4s(lParam + NMHDR_hwndFrom) > > elsif id = TreeView1 then > > iMsg = peek4s(lParam + NMHDR_code) > > if iMsg = TVN_SELCHANGED then --NM_CLICK then -- TreeView > > count = c_func(SendMessage,{id, TVM_GETCOUNT, 0, 0}) > > item = c_func(SendMessage,{id,TVM_GETNEXTITEM, 0, > TVGN_ROOT}) > poke4(tvitem + tvitem_hItem,item) > > poke4(tvitem + tvitem_mask,TVIF_TEXT) > poke4(tvitem + tvitem_stateMask, TVIS_SELECTED) > txtbuff = allocate(256) > poke4(tvitem + tvitem_pszText,txtbuff) > poke4(tvitem + tvitem_cchTextMax,256) > > junk = c_func(SendMessage,{id, TVM_GETITEM, 0, tvitem}) > > for i = 1 to count do > cmd = peek4s(tvitem + tvitem_state ) > if and_bits(cmd, TVIS_SELECTED) then > exit > end if <snip>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu