Jump to content
Sign in to follow this  
turbox

Help with SelectFile

Recommended Posts

turbox

Is There any way except control* to use the data of that activex

i tried guictrlread but nothing

Does someone has any idea?

$fname = "Form1"
$Form1 = GUICreate($fname, 633, 447, 193, 125)
$Obj1 = ObjCreate("CompatUI.SelectFile.1")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 56, 56, 486, 93)

(And no fileopendialog)

Edited by vakis

Share this post


Link to post
Share on other sites
kjactive

Hallo Vakis

; ===========================================
; Simple example to embed CompatUI.dll objects
; Selectfile example
; By Kåre Johansson 2008
; ===========================================
$GUI = GUICreate('Title', 633, 447, 193, 125)
$Obj = ObjCreate("CompatUI.SelectFile.1")
if Not Isobj($Obj) Then; check component state
  ConsoleWrite('Could not open com object' & @CRLF)
exit
EndIf
$Obj_ctrl = GUICtrlCreateObj($Obj, 56, 56, 486,23); Height is fixed to a maximum at 23
$Obj_Event = ObjEvent($Obj,"_UIEvent_"); role out an event handle
GUISetState()
With $Obj; Create a component pool to initiate component
  .BrowseTitle = 'My Title'
  .BrowseInitialDirectory = 'C:\Windows\'
  .BrowseFilter = '*.Exe'
  .FileName = 'C:\Windows\notepad.exe'
EndWith

While 1
Switch GUIGetMsg()
  Case 0
  Case -3
   ExitLoop
EndSwitch
WEnd
  ConsoleWrite($Obj.FileName & @CRLF); get the selected file
$Obj = 0; free component
Exit

; Only two events available to this object
Func _UIEvent_StateChanged($Long)
  ConsoleWrite('Evets - state changed:' & $Long & @CRLF)
EndFunc

Func _UIEvent_SelectionComplete()
  ConsoleWrite('Evets - SelectionComplete' & @CRLF)
EndFunc

Simple as that - The component holds 4 objects where Selectfile is one of the easy ones, read more at link:

http://www.myplugins.info/guids/typeinfo/t...7A-6A3EA9B42A87}

Hope this helps

Kjactive ;)

Edited by kjactive

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×