Список событий
Данная программа демонстрирует работу всех событий. "Event"
Procedure Callback(WindowID,message,wParam,lParam)
Result = #PB_ProcessPureBasicEvents
Select message
Case #DM_GETDEFID : Text$ = "DM_GetDefID"
Case #DM_SETDEFID : Text$ = "DM_SetDefID"
Case #WM_ACTIVATE : Text$ = "Activate"
Case #WM_ACTIVATEAPP : Text$ = "ActivateApp"
Case #WM_ASKCBFORMATNAME : Text$ = "AskCbFormatName"
Case #WM_CANCELJOURNAL : Text$ = "CancelJournal"
Case #WM_CANCELMODE : Text$ = "CancelMode"
Case #WM_CAPTURECHANGED : Text$ = "CaptureChanged"
Case #WM_CHANGECBCHAIN : Text$ = "ChangeCbChain"
Case #WM_CHAR : Text$ = "Char"
Case #WM_CHILDACTIVATE : Text$ = "ChildActivate"
Case #WM_CLEAR : Text$ = "Clear"
Case #WM_CLOSE : Text$ = "Close"
Case #WM_COMMAND : Text$ = "Command"
Case #WM_COMPACTING : Text$ = "Compacting"
Case #WM_CONTEXTMENU : Text$ = "ContextMenu"
Case #WM_COPY : Text$ = "Copy"
Case #WM_COPYDATA : Text$ = "CopyData"
Case #WM_CREATE : Text$ = "Create"
Case #WM_CTLCOLORDLG : Text$ = "CtlColorDlg"
Case #WM_CTLCOLORMSGBOX : Text$ = "CtlColorMsgBox"
Case #WM_CUT : Text$ = "Cut"
Case #WM_DEADCHAR : Text$ = "DeadChar"
Case #WM_DESTROY : Text$ = "Destroy"
Case #WM_DESTROYCLIPBOARD : Text$ = "DestroyClipboard"
Case #WM_DISPLAYCHANGE : Text$ = "DisplayChange"
Case #WM_DRAWCLIPBOARD : Text$ = "DrawClipboard"
Case #WM_DRAWITEM : Text$ = "DrawItem"
Case #WM_ENABLE : Text$ = "Enable"
Case #WM_ENTERIDLE : Text$ = "EnterIdle"
Case #WM_ENTERMENULOOP : Text$ = "EnterMenuLoop"
Case #WM_ENTERSIZEMOVE : Text$ = "EnterSizeMove"
Case #WM_ERASEBKGND : Text$ = "EraseBkgnd"
Case #WM_EXITMENULOOP : Text$ = "ExitMenuLoop"
Case #WM_EXITSIZEMOVE : Text$ = "ExitSizeMove"
Case #WM_GETDLGCODE : Text$ = "GetDlgCode"
Case #WM_GETHOTKEY : Text$ = "GetHotKey"
Case #WM_GETICON : Text$ = "GetIcon"
Case #WM_GETMINMAXINFO : Text$ = "GetMinMaxInfo"
Case #WM_GETTEXT : Text$ = "GetText"
Case #WM_GETTEXTLENGTH : Text$ = "GetTextLength"
Case #WM_HOTKEY : Text$ = "HotKey"
Case #WM_HSCROLLCLIPBOARD : Text$ = "HScrollClipboard"
Case #WM_ICONERASEBKGND : Text$ = "IconEraseBkgnd"
Case #WM_INITDIALOG : Text$ = "InitDialog"
Case #WM_INITMENU : Text$ = "InitMenu"
Case #WM_INITMENUPOPUP : Text$ = "InitMenuPopup"
Case #WM_INPUTLANGCHANGE : Text$ = "InputLangChange"
Case #WM_INPUTLANGCHANGEREQUEST : Text$ = "InputLangChangeRequest"
Case #WM_KEYDOWN : Text$ = "KeyDown"
Case #WM_KEYUP : Text$ = "KeyUp"
Case #WM_KILLFOCUS : Text$ = "KillFocus"
Case #WM_LBUTTONDBLCLK : Text$ = "LButtonDBlclk"
Case #WM_LBUTTONDOWN : Text$ = "LButtonDown"
Case #WM_LBUTTONUP : Text$ = "LButtonUp"
Case #WM_LBUTTONDBLCLK : Text$ = "LButtonDBlclk"
Case #WM_MBUTTONDOWN : Text$ = "MButtonDown"
Case #WM_MBUTTONUP : Text$ = "MButtonUp"
Case #WM_MEASUREITEM : Text$ = "MeasureItem"
Case #WM_MENUCHAR : Text$ = "MenuChar"
Case #WM_MENUSELECT : Text$ = "MenuSelect"
Case #WM_MOUSEACTIVATE : Text$ = "MouseActivate"
Case #WM_MOUSEMOVE : Text$ = "MouseMove"
Case #WM_MOUSEWHEEL : Text$ = "MouseWheel"
Case #WM_MOVE : Text$ = "Move"
Case #WM_MOVING : Text$ = "Moving"
Case #WM_NCACTIVATE : Text$ = "NcActivate"
Case #WM_NCCALCSIZE : Text$ = "NcCalcSize"
Case #WM_NCCREATE : Text$ = "NcCreate"
Case #WM_NCDESTROY : Text$ = "NcDestroy"
Case #WM_NCHITTEST : Text$ = "NCHITTEST"
Case #WM_NCLBUTTONDBLCLK : Text$ = "NCLButtonDBlclk"
Case #WM_NCLBUTTONDOWN : Text$ = "NCLButtonDown"
Case #WM_NCLBUTTONUP : Text$ = "NCLButtonUp"
Case #WM_NCMBUTTONDBLCLK : Text$ = "NCMButtonDBlclk"
Case #WM_NCMBUTTONDOWN : Text$ = "NCMButtonDown"
Case #WM_NCMBUTTONUP : Text$ = "NCMButtonUp"
Case #WM_NCMOUSEMOVE : Text$ = "NCMouseMove"
Case #WM_NCPAINT : Text$ = "NCPaint"
Case #WM_NCRBUTTONDBLCLK : Text$ = "NCRButtonDBlclk"
Case #WM_NCRBUTTONDOWN : Text$ = "NCRButtonDown"
Case #WM_NCRBUTTONUP : Text$ = "NCRButtonUp"
Case #WM_NEXTDLGCTL : Text$ = "NextDlgCtl"
Case #WM_NOTIFY : Text$ = "Notify"
Case #WM_NOTIFYFORMAT : Text$ = "NotifyFormat"
Case #WM_PAINT : Text$ = "Paint"
Case #WM_PAINTCLIPBOARD : Text$ = "PaintClipboard"
Case #WM_PAINTICON : Text$ = "PaintIcon"
Case #WM_PARENTNOTIFY : Text$ = "ParentNotify"
Case #WM_PASTE : Text$ = "Paste"
Case #WM_POWER : Text$ = "Power"
Case #WM_PRINT : Text$ = "Print"
Case #WM_PRINTCLIENT : Text$ = "PrintClient"
Case #WM_QUERYDRAGICON : Text$ = "QueryDragIcon"
Case #WM_QUERYOPEN : Text$ = "QueryOpen"
Case #WM_QUEUESYNC : Text$ = "QueueSync"
Case #WM_QUIT : Text$ = "Quit"
Case #WM_RENDERALLFORMATS : Text$ = "RenderAllFormats"
Case #WM_RENDERFORMAT : Text$ = "RenderFormat"
Case #WM_RBUTTONDBLCLK : Text$ = "RButtonDBlclk"
Case #WM_RBUTTONDOWN : Text$ = "RButtonDown"
Case #WM_RBUTTONUP : Text$ = "RButtonUp"
Case #WM_SETCURSOR : Text$ = "SetCursor"
Case #WM_SETFOCUS : Text$ = "SetFocus"
Case #WM_SETHOTKEY : Text$ = "SetHotKey"
Case #WM_SETICON : Text$ = "SetIcon"
Case #WM_SETREDRAW : Text$ = "SetRedraw"
Case #WM_SETTEXT : Text$ = "SetText"
Case #WM_SETTINGCHANGE : Text$ = "SettingChange"
Case #WM_SHOWWINDOW : Text$ = "ShowWindow"
Case #WM_SIZE : Text$ = "Size"
Case #WM_SIZECLIPBOARD : Text$ = "SizeClipboard"
Case #WM_SIZING : Text$ = "Sizing"
Case #WM_STYLECHANGED : Text$ = "StyleChanged"
Case #WM_STYLECHANGING : Text$ = "StyleChanging"
Case #WM_SYSCHAR : Text$ = "SysChar"
Case #WM_SYSCOMMAND : Text$ = "SysCommand"
Case #WM_SYSDEADCHAR : Text$ = "SysDeadChar"
Case #WM_SYSKEYDOWN : Text$ = "SysKeyDown"
Case #WM_SYSKEYUP : Text$ = "SysKeyUp"
Case #WM_TIMER : Text$ = "Timer"
Case #WM_USER : Text$ = "User"
Case #WM_USERCHANGED : Text$ = "UserChanged"
Case #WM_VSCROLLCLIPBOARD : Text$ = "VScrollClipboard"
Case #WM_WINDOWPOSCHANGED : Text$ = "WindowPosChanged"
Case #WM_WINDOWPOSCHANGING : Text$ = "WindowPosChanging"
Case #WM_WININICHANGE : Text$ = "WinIniChange"
Default
Debug "Неопределено " + Str(message)
EndSelect
Debug Text$+" "+Str(wParam)+" "+Str(lParam)
ProcedureReturn Result
EndProcedure
If OpenWindow(0,0,0,500,500,"Test",#PB_Window_ScreenCentered|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget)
hwnd = WindowID(0)
SetWindowCallback(@Callback())
If CreateGadgetList(hwnd)
EditorGadget(0,20,20,360,360)
EndIf
If CreateMenu(0,hwnd)
MenuTitle("Test")
MenuItem(0,"Test")
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf