Eine kleine Spielerei mit einer Messagebox und einem Hook.
Vielleicht kann's ja jemand gebrauchen .
http://www.postimage.org/image.php?v=aVxNjwr
Code
$H Windows.ph
$H Messages.ph
'#############################
'Messagebox-Konstanten
DEF &IDOK 1
DEF &IDCANCEL 2
DEF &IDABORT 3
DEF &IDRETRY 4
DEF &IDIGNORE 5
DEF &IDYES 6
DEF &IDNO 7
DEF &IDICON 20
DEF &IDPROMPT $FFFF
DEF &IDSTATIC $CAFE
'#############################
Struct CWPSTRUCT = lParam&,wParam&,message&,hwnd&
Struct Rect = left&,top&,right&,bottom&
Declare Hook&,OldProc&
Declare B&,B1&
Proc MB
Parameters wnd&,msg&,wparam&,lparam&
Declare Result&
select msg&
Caseof ~WM_INITDIALOG
Var Rect# = New(Rect)
~GetWindowRect(wnd&,Rect#)
~Movewindow(wnd&,Rect#.left&,rect#.top&,width(wnd&)+12,Height(wnd&)+40,1)
B& = Create("CheckBox",wnd&,"Diese Meldung nicht wieder anzeigen",0,height(wnd&)-18,width(wnd&),18)
SendMessage(B&,~WM_SETFONT,~GetStockObject(~ANSI_VAR_FONT),1)
SendMessage(~GetDlgItem(wnd&,&IDICON),~STM_SETIMAGE,~IMAGE_ICON,~LoadIcon(%hInstance,"EIMER"))
Result& = 1
Caseof ~WM_COMMAND
If lparam& = b&
If Getcheck(B&)
B1& = 1
Endif
Endif
Caseof ~WM_NCDESTROY
~UnhookWindowsHookEx(Hook&)
Result& = 1
Endselect
Result& = ~CallWindowProc(OldProc&,wnd&,msg&,wparam&,lparam&)
Return Result&
Endproc
Proc SetHook
Parameters nCode&, wParam&, lParam&
Select nCode&
Caseof ~HC_ACTION
Var pw# = New(CWPSTRUCT)
pw# = lparam&
If pw#.message& = ~WM_INITDIALOG
OldProc& = ~SetWindowlong(pw#.hwnd&,~GWL_WNDPROC,ProcAddr("MB",4))
Endif
EndSelect
Return ~CallNextHookEx(Hook&, nCode&, wParam&, lParam&)
EndProc
Proc PRF_Messagebox
Set("Fastmode",1)
Parameters body$, title$, flags&
Declare Result&
Flags& = Flags& | ~MB_ICONQUESTION
Hook& = ~SetWindowsHookEx(~WH_CALLWNDPROC, ProcAddr("SetHook",3), 0,~GetCurrentThreadId())
Result& = MessageBox(title$,body$, flags&)
Set("Fastmode",0)
Return Result&
EndProc
cls
Print PRF_Messagebox("Titel","Wirklich löschen ? ",~MB_YESNO)
Print IF(B1&=1,"Nicht wieder anzeigen","wieder anzeigen")
Waitinput
Alles anzeigen