Seite 1 von 1

Simples Beispiel per COM Windows-Dialoge anzuzeigen

Verfasst: 25.03.2007 02:21
von ts-soft

Code: Alles auswählen

; Simple Example for use shell.application object
; Autor: ts-soft
; Requires PB4.xx
; 25.03.2007

Procedure CreateShellObject()
  Protected obj.l, hResult.l

  CoInitialize_(#Null)
  hResult = CoCreateInstance_(?CLSID_Shell_Application, 0, 1, ?IID_IShellDispatch, @obj)

  If Not hResult
    ProcedureReturn obj
  Else
    ProcedureReturn #False
  EndIf

  DataSection
    CLSID_Shell_Application:  ; {13709620-C279-11CE-A49E-444553540000}
    Data.l $13709620
    Data.w $C279,$11CE
    Data.b $A4,$9E,$44,$45,$53,$54,$0,$0
    IID_IShellDispatch:  ; {D8F015C0-C278-11CE-A49E-444553540000}
    Data.l $D8F015C0
    Data.w $C278,$11CE
    Data.b $A4,$9E,$44,$45,$53,$54,$0,$0
  EndDataSection
EndProcedure

Procedure ReleaseShellObject(obj.l)
  Protected object.IUnknown = obj
  object\Release()
EndProcedure

Define.IShellDispatch shell

shell = CreateShellObject()
If shell
  shell\MinimizeAll()       ; alle Fenster minimieren
  shell\Help()              ; Windows Hilfe aufrufen
  shell\UndoMinimizeALL()   ; minimieren rückgängig machen
  shell\ShutdownWindows()   ; Computer ausschalten Dialog
  shell\SetTime()           ; Uhrzeit setzen
  shell\FileRun()           ; Ausführen Dialog

  ReleaseShellObject(shell)
EndIf
Weitere Methoden finder Ihr im Interface (Werkzeug: Structureanzeiger)

Verfasst: 27.03.2007 12:02
von flype
danke tssoft :allright:

Verfasst: 27.03.2007 13:33
von flype
(very sorry in english)

i think there's should be much more includes in this pack.
if you are agree, i will send you some includes i would like to see your in includepack.

i understood that the includes must respect a standard (EnableExplicit and so...) which is perfect as it is also the way i work.

Verfasst: 27.03.2007 21:48
von ts-soft
flype hat geschrieben: i think there's should be much more includes in this pack.
if you are agree, i will send you some includes i would like to see your in includepack.
Ok, thanks
You can send me the links as PM or in this thread:
http://www.purebasic.fr/german/viewtopi ... ncludepack
or in the thread in english-forum
http://www.purebasic.fr/english/viewtop ... ncludepack

Greetings .. Thomas