Seite 2 von 2

Verfasst: 14.04.2008 18:17
von jear
Auch schon älteren Datums und irgendwann und irgendwo hier beschrieben, mein Knecht Donc.

Als Desktop-Symbol (muss man selbst spendieren) lauert er und ist sofort zu Diensten, wenn man ihn braucht.

Im Win-Explorer irgendeine oder mehrere Dateien markieren und auf das Symbol ziehen. Ein Kling zur Quittung zeigt an, dass nun die vollen Pfad- und Dateinamen der Objekte im Clipboard stehen und leicht in Dokumente oder Quellen eingesetzt werden können.

Code: Alles auswählen

;/ JR's DONC : Dragged Object Names to Clipboard
;/ 070527

Define.s on, objects
Define.l idx, ndo, quit, hwnd

#Dir = -2
#BufferLength = 1000
#MEM_DROPFILES = 10
*Buffer = AllocateMemory(#BufferLength)

;/ Drag and Drop auf das Desktop-Symbol
ndo = CountProgramParameters()
If ndo
  While ndo > 0
    on = ProgramParameter()
    If FileSize(on) = #Dir : PathAddBackslash_(on) : EndIf
    objects + on + #CRLF$
    ndo - 1
  Wend
  PlaySound_("SystemAsterisk",0, #SND_ALIAS|#SND_NODEFAULT|#SND_NOWAIT|#SND_ASYNC) : Delay(200)
  SetClipboardText(objects)
  End
EndIf

;/ Drag and Drop auf das aufgerufene Fenster
hwnd = OpenWindow(0, 0, 0, 110, 0 , "JR's DONC", #PB_Window_BorderLess | #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If hwnd
  DragAcceptFiles_(hwnd, 1)
  Repeat
    Event= WaitWindowEvent()
    Select Event
      Case #PB_Event_CloseWindow
        quit = 1 
      Case #WM_DROPFILES
        *DropHandle = EventwParam() 
        If *DropHandle
          ndo = DragQueryFile_ (*DropHandle, $FFFFFFFF, *Buffer, #BufferLength)
          If ndo
            idx = 0
            While ndo
              DragQueryFile_(*DropHandle, idx, *Buffer, #BufferLength) 
              on = PeekS(*Buffer)
              If FileSize(on) = #Dir : PathAddBackslash_(on) : EndIf 
              objects + on + #CRLF$  
              ndo - 1 : idx + 1
            Wend
            DragFinish_(*DropHandle)
            SetClipboardText(objects)
            PlaySound_("SystemAsterisk",0, #SND_ALIAS|#SND_NODEFAULT|#SND_NOWAIT|#SND_ASYNC) : Delay(200) 
            quit = 1
          EndIf
        EndIf
    EndSelect
  Until quit = 1
EndIf

End

Verfasst: 15.04.2008 14:38
von 7x7
Das ist was für mich! :allright:

Verfasst: 17.04.2008 20:48
von neotoma
Bei mir ist auch mein eigener Program-Launcher Rapido! täglich im Einsatz,
und hat sich schon vielfach bewährt. (auch wenn er noch ein paar macken hat...)


Mike

Verfasst: 18.04.2008 19:14
von Farodin
bei mir kommt momentan Täglich mein Geburtstagschecker zum Einsatz,dass ist ein kleines Tool,welches aus einer - über ein anderes Programm aktualisierbaren - liste Geburtstage samt namen ausliest und im Falle eines solchen Bescheid gibt. Entsatnden ist das ganze,weil Trillian keine Erinnerungsfunktion in der Richtung hat und ich seeehr vergesslich bin^^

Hier mal der Code (Icon müsste der,ders gebrauchen kann sich selber suchen/basteln)(benötigt die SysTrayIconEx-Userlib):

Code: Alles auswählen

DataSection 
ico: IncludeBinary "bday.ico" 
EndDataSection 

CatchImage(0,?ico)

Procedure CreateShortcut(Path.s, Link.s, WorkingDir.s = "", Argument.s = "", ShowCommand.l = #SW_SHOWNORMAL, Description.s = "", HotKey.l = #Null, IconFile.s = "|", IconIndex.l = 0)
  Protected psl.IShellLinkA, ppf.IPersistFile, mem.s, hres.l, Result.l
  If IconFile = "|"
    IconFile = Path
  EndIf
  If Not WorkingDir
    WorkingDir = GetPathPart(Path)
  EndIf
  CoInitialize_(0)
  If CoCreateInstance_(?CLSID_ShellLink, 0, 1, ?IID_IShellLink, @psl) = 0
    Set_ShellLink_preferences:
    psl\SetPath(@Path)
    psl\SetArguments(@Argument)
    psl\SetWorkingDirectory(@WorkingDir)
    psl\SetDescription(@Description)
    psl\SetShowCmd(ShowCommand)
    psl\SetHotkey(HotKey)
    psl\SetIconLocation(@IconFile, IconIndex)
    ShellLink_SAVE:
    If psl\QueryInterface(?IID_IPersistFile, @ppf) = 0
      mem.s = Space(1000)
      MultiByteToWideChar_(#CP_ACP, 0, Link, -1, mem, 1000)
      hres = ppf\Save(@mem, #True)
      Result = 1
      ppf\Release()
    EndIf
    psl\Release()
  EndIf
  CoUninitialize_()
  ProcedureReturn Result
  DataSection
    CLSID_ShellLink:
    Data.l $00021401
    Data.w $0000, $0000
    Data.b $C0, $00, $00, $00, $00, $00, $00, $46
    IID_IShellLink:
    Data.l $000214EE
    Data.w $0000, $0000
    Data.b $C0, $00, $00, $00, $00, $00, $00, $46
    IID_IPersistFile:
    Data.l $0000010B
    Data.w $0000, $0000
    Data.b $C0, $00, $00, $00, $00, $00, $00, $46
  EndDataSection
EndProcedure


Procedure.s SystemFolder(Index.w) ; Ermittelt die URL der durchnumerierten Windows-Verzeichnisse.
  Protected *itemid.ITEMIDLIST, location.s
  If SHGetSpecialFolderLocation_(0, Index, @*itemid) = #NOERROR 
    location = Space(#MAX_PATH) 
    If SHGetPathFromIDList_(*itemid, @location) 
      ProcedureReturn location
    EndIf 
  EndIf 
EndProcedure


Procedure CheckDate()
If ReadFile(0,GetHomeDirectory() + "bdays.bdd")
  While Eof(0) = 0
    String.s = ReadString(0)
    Pos = FindString(String,FormatDate("%dd/%mm",Date()), 1)
    
    If Pos
      bday.s =  Right(String, Len(String) - Pos)
      name.s = Left(String, Pos - 3)
      byear.s = Right(String, Len(String) - (Pos+5))
      age = Val(FormatDate("%yyyy",Date())) - Val(byear)
      MessageRequester("Geburtstag",name + " wird heute " + Str(age) + " Jahre alt",16)
    EndIf
  Wend
  messaged = 1
Else
  MessageRequester("Fehler!","'" + GetHomeDirectory() + "bdays.bdd' existiert nicht!",16)
EndIf
SysTrayIconBalloonEx(0, WindowID(0), "Hinweis", "Ende der Datei erreicht(, keine Geburtstage heute) :-)", 1000)
EndProcedure



*MemoryID = AllocateMemory(Len(FormatDate("%dd/%mm",Date())))
If OpenFile(0,GetHomeDirectory() + "check.bcf")
  If ReadString(0) <> "1"
    CreateShortcut(ProgramFilename(), SystemFolder(7) + "\Birthdaychecker.lnk", "", "", #SW_SHOWNORMAL, "Der Geburtstagschecker^^", 0)
    WriteString(0,"1")
  EndIf
EndIf



OpenWindow(0,0,0,310,90,"Geburtstagschecker",#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_Invisible)
AddSysTrayIcon(0,WindowID(0),ImageID(0))
SysTrayIconToolTip(0,"Geburtstagschecker^^")
  CreatePopupMenu(0) 
  MenuItem(1,"Überprüfe jetzt")
  MenuBar()
  MenuItem(2,"Beenden")


CreateThread(@CheckDate(),0)


Repeat
  EventID = WaitWindowEvent()
  If EventID = #PB_Event_SysTray 
    If EventType() = #PB_EventType_RightClick 
        DisplayPopupMenu(0,WindowID(0)) 
    ElseIf EventType() = #PB_EventType_LeftDoubleClick
      CheckDate()
    EndIf
  EndIf
  If EventID = #PB_Event_Menu 
    Select EventMenu()
      Case 1
        CheckDate()
      Case 2
        End
    EndSelect
  EndIf
  If FormatDate("%ii:%ss",Date()) = "00:00"
    CheckDate()
  EndIf
Until EventID = #PB_Event_CloseWindow
und der Code zum Hinzufügeprogramm:

Code: Alles auswählen

OpenWindow(0,0,0,310,200,"Geburtstagslister",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
CreateGadgetList(WindowID(0))
  DateGadget(0,5,55,200,20,"%dd/%mm/%yyyy",0)
  ButtonGadget(1,210,15,100,30,"Absenden")
  StringGadget(3,5,15,200,20,"Default Name")
  Frame3DGadget(4,1,1,209,40,"Name")
  Frame3DGadget(5,1,41,209,40,"Datum")
  EditorGadget(6,5,100,300,90,#PB_Editor_ReadOnly)
  Frame3DGadget(7,1,85,309,110,"Momentan gespeicherte Geburtstage")
  ButtonGadget(8,210,55,100,30,"Löschen")
  If OpenFile(0,GetHomeDirectory() + "bdays.bdd")
    Debug GetHomeDirectory()
    Debug "boing"
    SetGadgetText(6,"")
    While Eof(0) = 0
      SetGadgetText(6,GetGadgetText(6) + ReadString(0) + Chr(10))
    Wend
  EndIf

Repeat
  EventID = WaitWindowEvent()
  If EventID = #PB_Event_Gadget
    If EventGadget() = 1
      If GetGadgetText(3) <> ""
        If OpenFile(0,GetHomeDirectory() + "bdays.bdd")
          Debug GetHomeDirectory()
          Debug "boing"
          FileSeek(0,Lof(0))
          WriteString(0,GetGadgetText(3) + ": ")
          WriteStringN(0,GetGadgetText(0))
          CloseFile(0)
        EndIf
      Else
        MessageRequester("Fehler!","Kein Name angegeben!",16)
      EndIf
    If OpenFile(0,GetHomeDirectory() + "bdays.bdd")
      SetGadgetText(6,"")
      While Eof(0) = 0
        SetGadgetText(6,GetGadgetText(6) + ReadString(0) + Chr(10))
      Wend
    EndIf
    EndIf
    If EventGadget() = 8
      CreateFile(0,GetHomeDirectory() + "bdays.bdd")
      If OpenFile(0,GetHomeDirectory() + "bdays.bdd")
      SetGadgetText(6,"")
      While Eof(0) = 0
        SetGadgetText(6,GetGadgetText(6) + ReadString(0) + Chr(10))
      Wend
    EndIf
    EndIf
  EndIf
Until EventID = #PB_Event_CloseWindow

Verfasst: 18.04.2008 19:39
von unix
lol ohne das topic zu lesen hab ich was ähnliches entwickelt :lol:

aber sieht nice aus! :allright: