Maza Faka

Advanced Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору ViSiToR Цитата: Ты будешь смеяться, но и она не работает Цитата: Ты бы проверил на каком месте проблема, ведь если она не работает, то нужно разработчикам доложить, чтобы поправили. | А незнаю в каком месте она не работает (Мой вариант меня вполне устраивает) Цитата: Такой вариант у тебя работает? | Конечно работает, ведь там используется функция OpenMutex, а вот этот огород вроде бы не нужен: Код: Local Const $MUTEX_ALL_ACCESS = 0x1F0001 Local Const $SECURITY_DESCRIPTOR_REVISION = 1 Local $handle, $lastError, $pSecurityAttributes = 0 If BitAND($iFlag, 2) Then ; The size of SECURITY_DESCRIPTOR is 20 bytes. We just ; need a block of memory the right size, we aren't going to ; access any members directly so it's not important what ; the members are, just that the total size is correct. Local $structSecurityDescriptor = DllStructCreate("dword[5]") Local $pSecurityDescriptor = DllStructGetPtr($structSecurityDescriptor) ; Initialize the security descriptor. Local $aRet = DllCall("advapi32.dll", "int", "InitializeSecurityDescriptor", _ "ptr", $pSecurityDescriptor, "dword", $SECURITY_DESCRIPTOR_REVISION) If Not @error And $aRet[0] Then ; Add the NULL DACL specifying access to everybody. $aRet = DllCall("advapi32.dll", "int", "SetSecurityDescriptorDacl", _ "ptr", $pSecurityDescriptor, "int", 1, "ptr", 0, "int", 0) If Not @error And $aRet[0] Then ; Create a SECURITY_ATTRIBUTES structure. Local $structSecurityAttributes = DllStructCreate("dword;ptr;int") ; Assign the members. DllStructSetData($structSecurityAttributes, 1, DllStructGetSize($structSecurityAttributes)) DllStructSetData($structSecurityAttributes, 2, $pSecurityDescriptor) DllStructSetData($structSecurityAttributes, 3, 0) ; Everything went okay so update our pointer to point to our structure. $pSecurityAttributes = DllStructGetPtr($structSecurityAttributes) EndIf EndIf EndIf | Zloy_Gelud Цитата: чтобы не было панельки (?) с кнопоками свернуть, развернуть, закрыть, ну и конечно чтоб GUI (проект) можно было перемещать | Варианты: 1. Код: #include <GuiConstants.au3> #include <WindowsConstants.au3> $hGui = GUICreate("Test", 300, 200, -1, -1, $WS_POPUP) GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam) Local $iProc $iProc = DllCall("user32.dll", "int", "DefWindowProc", "hwnd", $hWnd, "int", $Msg, "wparam", $wParam, "lparam", $lParam) $iProc = $iProc[0] If $iProc = $HTCLIENT Then Return $HTCAPTION Return $GUI_RUNDEFMSG EndFunc | 2. Код: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MenuConstants.au3> #include <WinAPI.au3> $GUI = GUICreate('dd',-1,-1,-1,-1,BitOR($WS_POPUPWINDOW, $WS_THICKFRAME), BitOR($WS_EX_CLIENTEDGE, $WS_EX_TOOLWINDOW)) GUICtrlCreateLabel("Label",10,10,100,200) GUICtrlSetBkColor(-1,0x999999) GUICtrlCreateButton("Btn",10,220,50,25) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_PRIMARYDOWN _SendMessage($GUI, $WM_SYSCOMMAND, BitOR($SC_MOVE, $HTCAPTION), 0) EndSelect WEnd | 3. Код: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MenuConstants.au3> #include <WinAPI.au3> $GUI = GUICreate('dd',-1,-1,-1,-1,BitOR($WS_POPUPWINDOW, $WS_THICKFRAME), BitOR($WS_EX_CLIENTEDGE, $WS_EX_TOOLWINDOW)) GUICtrlCreateLabel("Label",10,10,100,200) GUICtrlSetBkColor(-1,0x999999) GUICtrlCreateButton("Btn",10,220,50,25) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_PRIMARYDOWN _SendMessage($GUI, $WM_SYSCOMMAND, BitOR($SC_MOVE, $HTCAPTION), 0) EndSelect WEnd | Цитата: При наведении на Label появлялся прямоугольник (имеющий определенную толщину границы и цвет) | Код: #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> Global $Draw = False Global $aCurPos $hGUI = GUICreate("My GUI", 300, 200) $pic = GUICtrlCreatePic(@WindowsDir & "\Web\Wallpaper\Windows XP.jpg", 0, 0, 300, 200) GUICtrlSetState(-1, $GUI_DISABLE) $button = GUICtrlCreateLabel("Test", 100, 65, 100, 25, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState() FrameRect1(GUICtrlGetHandle($button), 0xFFFFFF) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $button MsgBox(0, "Info", "Button pressed", 0, $hGUI) EndSwitch $aCurPos = GUIGetCursorInfo() If IsArray($aCurPos) Then If ($aCurPos[4] = $button) And ($Draw = False) Then $Draw = True GUICtrlSetColor($button, 0xFF0000) GUICtrlSetFont($button, 10, 800) FrameRect1(GUICtrlGetHandle($button), 0x0000FF) ElseIf ($aCurPos[4] <> $button) And ($Draw = True) Then $Draw = False GUICtrlSetColor($button, 0) GUICtrlSetFont($button, Default, Default) FrameRect1(GUICtrlGetHandle($button), 0xFFFFFF) EndIf EndIf WEnd Func FrameRect1($hWnd, $sColor) Local $hDC = _WinAPI_GetDC($hWnd) Local $tRect = _WinAPI_GetClientRect($hWnd) Local $hBrush = _WinAPI_CreateSolidBrush($sColor) DllCall("user32.dll", "int", "FrameRect", "hwnd", $hDC, "ptr", DllStructGetPtr($tRect), "hwnd", $hBrush) _WinAPI_ReleaseDC($hWnd, $hDC) _WinAPI_DeleteObject($hBrush) EndFunc | |