- Код: Выделить всё
#COMPILER PBWIN 9
#COMPILE EXE
#DIM ALL
GLOBAL hDlg AS DWORD
GLOBAL hThread AS DWORD
FUNCTION PBMAIN () AS LONG
DIALOG NEW 0, "Трололо",,, 156, 118, %DS_CENTER OR %WS_CAPTION OR %WS_SYSMENU OR %WS_MINIMIZEBOX, 0 TO hDlg
CONTROL ADD TEXTBOX, hDlg, 100, "пиу пиу пиу пиу", 16, 24, 124, 13, %WS_CHILD OR %ES_AUTOHSCROLL OR %WS_TABSTOP, %WS_EX_CLIENTEDGE
CONTROL ADD BUTTON, hDlg, 1, "ОЛОЛО", 16, 90, 55, 15, %BS_PUSHBUTTON OR %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP
CONTROL ADD BUTTON, hDlg, 2, "ЖЪРЧИК", 85, 90, 55, 15, %BS_PUSHBUTTON OR %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP
DIALOG SHOW MODAL hDlg, CALL WndProc
END FUNCTION
CALLBACK FUNCTION WndProc () AS LONG
SELECT CASE CBMSG
CASE %WM_COMMAND
SELECT CASE CBCTL
CASE 1
IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
CONTROL DISABLE hDlg, 1
CONTROL DISABLE hDlg, 2
CONTROL DISABLE hDlg, 100
THREAD CREATE mThread(hDlg) TO hThread
END IF
CASE 2
DIALOG END CB.HNDL, 0
END SELECT
END SELECT
END FUNCTION
FUNCTION mThread(BYVAL hDlg AS DWORD) AS LONG
LOCAL i AS LONG 'дщсфд ш фы дщтп е_ный пи_дец!!111111
LOCAL hRes AS LONG
FOR i = 0 TO 100000000
' пиу пиу пиу
NEXT i
CONTROL ENABLE hDlg, 1
CONTROL ENABLE hDlg, 2
CONTROL ENABLE hDlg, 100
CONTROL SET FOCUS hDlg, 1 ' НЕ РАБОТАЕТ
THREAD CLOSE hThread TO hRes
END FUNCTION