English
Source / code snippets

Crash Registerwindowmessage Taskbar Taskbarcreated Trayicon

 
One very cooles example ( [...]  ) of Andreas Miethe, that shows How one right optimal

monitors, whether one one TrayIcon new produce ought to:
CompileMarkSeparation
 $H Windows.ph
'Diese Meldung wird auch von Windows versendet wenn das Tray-Fenster
'neu angelegt wird, also bei Start oder Explorer-Crash
Var TaskbarCreated& = ~RegisterWindowMessage("TaskbarCreated")
Var Hicon& = create("hIcon","A")
WindowStyle 539
CLS
Var Ende& = 0
'Meldung als Usermessage anlegen
Usermessages TaskbarCreated&
'Timer für die Überwachung setzen
Settimer 1000

WhileNot ende&

    WaitInput

    If %uMessage = TaskbarCreated&

        'Taskbarcreated ist angekommen
        'entweder von Windows oder vom Programm selber
        TrayIcon("Add", %hWnd, 1, hIcon&, "TrayIcon 11")
        Print "Tray-Icon angelegt"

    EndIf

    If %wmtimer

        If ~Findwindow("Shell_TrayWnd","")

            'wenn das Tray-Fenster vorhanden ist dann Meldung absetzen
            SendMessage(%hwnd,TaskbarCreated&,0,0)
            'Der Timer wird nur bei Programmstart benötigt
            killtimer

        EndIf

    EndIf

    If %key = 2

        Ende& = 1

    EndIf

EndWhile

TrayIcon("Delete", %hWnd, 1)
End
 
02/09/13  
 




Andreas
Miethe


in the Context same yet something.
around the To testing must the Explorer new launched go.

the goes so :
CompileMarkSeparation
Proc KillProcess

    Var Kernel& = Importdll("Kernel32.dll","")
    Def &TH32CS_SNAPPROCESS 2
    STRUCT PROCESSENTRY32 = \
    dwSize&,\
    cntUsage&,\
    th32ProcessID&,\
    th32DefaultHeapID&,\
    th32ModuleID&,\
    cntThreads&,\
    th32ParentProcessID&,\
    pcPriClassBase&,\
    dwFlags&,\
    szExeFile$(~MAX_PATH)
    PARAMETERS Filename$
    Var TH& = CreateToolhelp32Snapshot(&TH32CS_SNAPPROCESS,0)
    Var PE# = New(PROCESSENTRY32)
    Var PID& = 0
    Var phandle& = 0
    PE#.dwSize& = Sizeof(PE#)
    Process32First(th&,PE#)

    While Process32Next(th&,PE#)

        If Upper$(PE#.szExeFile$) = Upper$(Filename$)

            Pid& = PE#.th32ProcessID&
            pHandle& = OpenProcess($400 | $10 | 1,0,PID&)
            TerminateProcess(pHandle&,0)
            CloseHandle(pHandle&)
            Break

        EndIf

    EndWhile

    Dispose PE#
    CloseHandle(th&)
    Freedll Kernel&

EndProc

KillProcess("expl
xe")
 
XProfan X2
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
02/09/13  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

8.072 Views

Untitledvor 0 min.
Georg Teles10/27/24
H.Brill08/03/24
p.specht11/20/21
Uwe Lang11/20/21
More...

Themeninformationen

this Topic has 2 subscriber:

iF (1x)
Andreas Miethe (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie