Jump to content

Search the Community

Showing results for tags 'context'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 12 results

  1. I have several context menus that's been built using _GUICtrlMenu_CreatePopup() and _GUICtrlMenu_AddMenuItem(). When using _GUICtrlMenu_CreatePopup() it returns the identifier of the clicked item, sure. But it blocks the main loop while the menu is open. When using _GUICtrlMenu_CreatePopup($MNS_MODELESS) it returns immediately (of course), but I cannot figure out how/where to read the item that was clicked. Is there a Windows Message (WM) somewhere that is triggered? I've spend an entire day trying to figure out how to do this, but I'm not getting anywhere. My google fu is depleted (I must have tried like hundreds of script variations today), I'm about to smash my keyboard and just go to bed, and abandon the entire endeavor of making pretty menus and go back to using Koda and forget about using menu icons, colors, etc. Anyone wanna help me out with how to read the clicked item? Before I smash my keyboard, please... Example script here: #include <GuiMenu.au3> #include <WinAPIError.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> GUIRegisterMsg($WM_CONTEXTMENU, "_WM_CONTEXTMENU") Global $idMenuItem = 10000, $counter = 0 Global $hGUI = GUICreate("Menu test", 400, 300) Global $hListview = GUICtrlCreateListView("", 2, 2, 396, 200) GUISetState(@SW_SHOW) ;~ Global $hMenuContext = _GUICtrlMenu_CreatePopup() Global $hMenuContext = _GUICtrlMenu_CreatePopup($MNS_MODELESS) _GUICtrlMenu_AddMenuItem($hMenuContext, "Menu item", $idMenuItem) Global $hTimer = TimerInit() Do If TimerDiff($hTimer)>200 Then $counter += 1 ConsoleWrite($counter & " " ) $hTimer = TimerInit() EndIf Until GUIGetMsg() = $GUI_EVENT_CLOSE Exit Func _WM_CONTEXTMENU($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Switch $wParam Case GUICtrlGetHandle($hListview) ConsoleWrite( @CRLF & "_GUICtrlMenu_TrackPopupMenu = " & _GUICtrlMenu_TrackPopupMenu($hMenuContext, $wParam, -1, -1, 1, 1, 2) & @CRLF) EndSwitch EndFunc
  2. hi dears, i have a question please am now working for an audio player for the blind users and i added an option to open a file from the right click context menu. but here there is a small problem, i hope that you can help me to find a solution for it. the problem is as follow : when i added the problem into the context menu it work with successfuly if the user select just one file. but if the user selected more then one file, here the problem a multiple sections of the program will open. my question is : how i can detect the multiple selection from the context menu? i know that it so hard, but i know also that you are harder than it for that dears please try to give me an solution for that problem. thanks in advance
  3. Hello my friends Can we create a single context menu on more than one item? For example, a context menu includes standardized options on more than one control, such as buttons or check boxes to Create a context menu on one item am using this function GUICtrlCreateContextMenu ($ HWND) How to link it with more than one element please? or if we can't do that, please give me a solution so i tried to add an context menus to all the controls but the script will be long, for that if their are any solutions i hope to give it to me thanks in advanced
  4. Hi, when I call a MsgBox function I can use a "$MB_SERVICE_NOTIFICATION" flag so it will be displayed "on the current active desktop, even if there is no user logged on to the computer.". That works just great. Is there a way to do the same to Autoit GUI Form so it will be visible on desktop even if running from system account and user is not logged?
  5. Hello all I have a question please this a question is about the context menu When i create a list box Or combo box if i create a context menu for this list When i press the application key or the shortcut shift + f10 the menu options is appear normally but When i create a List view if i create a context menu for this list When i press the application key or the shortcut shift + f10 the menu options isn't appear But the right mouse button works normally I need a solution please because I deal with the screen readers users Unfortunately They can not use the mouse to navigate So I have to find a solution to activate keyboard shortcuts am waiting for your help
  6. Hi, i'm looking for a way to get the text of selected item from a popup menu here is my script, it works fine for non-Explorer.exe window (tested on SciTE on both context menu and menubar menu), but fails on displayed menu on Desktop... Local $hDLL, $hWinEventProc, $hHook Local $LastMenuItem[5] ;Save last menu item propieties Local $EVENT_Min = 0x0006 ;An MSAA event indicating that a pop-up menu was displayed. Local $EVENT_Max = 0x0007 ;An MSAA event indicating that a pop-up menu was closed. Local $hWinEventProc = DllCallbackRegister("_WinEventProc", "none", "hwnd;int;hwnd;long;long;int;int") If Not @error Then OnAutoItExitRegister("OnAutoItExit") Else MsgBox(16 + 262144, "Error", "DllCallbackRegister(_WinEventProc) did not succeed.") Exit EndIf $hHook = _SetWinEventHook($EVENT_Min, $EVENT_Max) If @error Then MsgBox(16 + 262144, "Error", "_SetWinEventHook() did not succeed.") Exit EndIf While True Sleep(250) ;function that get last menu item propieties _PopupMenuItem() WEnd Func _WinEventProc($hHook, $iEvent, $hWnd, $idObject, $idChild, $iEventThread, $iEventTime) Switch $iEvent Case 6 ConsoleWrite("(i) pop-up menu was displayed..."&@CRLF) Case 7 _SelectedMenuItem() ConsoleWrite("(i) pop-up menu was closed..."&@CRLF) EndSwitch EndFunc ;==>_WinEventProc Func _SetWinEventHook($iEventMin, $iEventMax) Local $aRet Local Const $WINEVENT_OUTOFCONTEXT = 0x0 Local Const $WINEVENT_SKIPOWNPROCESS = 0x2 $aRet = DllCall("User32.dll", "hwnd", "SetWinEventHook", _ "uint", $iEventMin, _ "uint", $iEventMax, _ "hwnd", 0, _ "ptr", DllCallbackGetPtr($hWinEventProc), _ "int", 0, _ "int", 0, _ "uint", BitOR($WINEVENT_OUTOFCONTEXT, $WINEVENT_SKIPOWNPROCESS)) If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SetWinEventHook Func OnAutoItExit() If $hWinEventProc Then DllCallbackFree($hWinEventProc) If $hHook Then DllCall("User32.dll", "int", "UnhookWinEvent", "hwnd", $hHook) EndFunc ;==>OnAutoItExit Func _PopupMenuItem() Local $aRect, $hMenu = False, $MenuItem[9] Local $hDesktop = _WinAPI_GetDesktopWindow() Local $hChild = _WinAPI_GetWindow( $hDesktop, 5 ), $i = 0 Local $hWindow = WinGetHandle("[ACTIVE]") Local $hChild = _WinAPI_GetWindow($hDesktop, 5) Local $i = 0 While $hChild And $i < 5 If _WinAPI_GetClassName( $hChild ) = "#32768" Then $hMenu = _SendMessage( $hChild, 0x01E1 ) ExitLoop EndIf $hChild = _WinAPI_GetWindow( $hChild, 2 ) $i += 1 WEnd If $hMenu Then Local $iCount = _GUICtrlMenu_GetItemCount($hMenu), $sText For $i = 0 To $iCount - 1 If $i = _GUICtrlMenu_MenuItemFromPoint($hWindow, $hMenu) Then If _GUICtrlMenu_GetItemEnabled($hMenu, $i) Then $MenuItem[0] = $hWindow $MenuItem[1] = $hMenu $MenuItem[2] = $i $MenuItem[3] = _GUICtrlMenu_GetItemText($hMenu, $i ) $MenuItem[4] = _GUICtrlMenu_GetItemRectEx($hWindow, $hMenu, $i) If $LastMenuItem[0] <> $MenuItem[0] Or $LastMenuItem[1] <> $MenuItem[1] Or $LastMenuItem[2] <> $MenuItem[2] Then $LastMenuItem = $MenuItem ConsoleWrite("* mouse over item: "&$LastMenuItem[3]&@CRLF) EndIf EndIf ExitLoop EndIf Next EndIf EndFunc Func _SelectedMenuItem() Local $tPOINT = _WinAPI_GetMousePos() ConsoleWrite("(i) last mouse position: "&DllStructGetData($tPoint, "X")&":"&DllStructGetData($tPoint, "Y")&@CRLF) If _WinAPI_PtInRect($LastMenuItem[4], $tPOINT) Then ConsoleWrite("-> selected item: "&$LastMenuItem[3]&@CRLF) Else ConsoleWrite("(i) last menu item position Rect: "&DllStructGetData($LastMenuItem[4], "Left")&">"&DllStructGetData($LastMenuItem[4], "Right")&":"&DllStructGetData($LastMenuItem[4], "Top")&"V"&DllStructGetData($LastMenuItem[4], "Bottom")&@CRLF) EndIf EndFunc ; Functions From Include Directory Func _WinAPI_GetWindow($hWnd, $iCmd) Local $aResult = DllCall("user32.dll", "hwnd", "GetWindow", "hwnd", $hWnd, "uint", $iCmd) If @error Then Return SetError(@error, @extended, 0) Return $aResult[0] EndFunc Func _WinAPI_GetClassName($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Local $aResult = DllCall("user32.dll", "int", "GetClassNameW", "hwnd", $hWnd, "wstr", "", "int", 4096) If @error Or Not $aResult[0] Then Return SetError(@error, @extended, '') Return SetExtended($aResult[0], $aResult[2]) EndFunc Func _GUICtrlMenu_GetItemCount($hMenu) Local $aResult = DllCall("user32.dll", "int", "GetMenuItemCount", "handle", $hMenu) If @error Then Return SetError(@error, @extended, -1) Return $aResult[0] EndFunc Func _SendMessage($hWnd, $iMsg, $wParam = 0, $lParam = 0, $iReturn = 0, $wParamType = "wparam", $lParamType = "lparam", $sReturnType = "lresult") Local $aResult = DllCall("user32.dll", $sReturnType, "SendMessageW", "hwnd", $hWnd, "uint", $iMsg, $wParamType, $wParam, $lParamType, $lParam) If @error Then Return SetError(@error, @extended, "") If $iReturn >= 0 And $iReturn <= 4 Then Return $aResult[$iReturn] Return $aResult EndFunc Func _GUICtrlMenu_GetItemRectEx($hWnd, $hMenu, $iItem) Local $tRECT = DllStructCreate("struct;long Left;long Top;long Right;long Bottom;endstruct") Local $aResult = DllCall("user32.dll", "bool", "GetMenuItemRect", "hwnd", $hWnd, "handle", $hMenu, "uint", $iItem, "struct*", $tRECT) If @error Then Return SetError(@error, @extended, 0) Return SetExtended($aResult[0], $tRECT) EndFunc Func _GUICtrlMenu_GetItemText($hMenu, $iItem, $bByPos = True) Local $iByPos = 0 If $bByPos Then $iByPos = 0x00000400 Local $aResult = DllCall("user32.dll", "int", "GetMenuStringW", "handle", $hMenu, "uint", $iItem, "wstr", "", "int", 4096, "uint", $iByPos) If @error Then Return SetError(@error, @extended, 0) Return SetExtended($aResult[0], $aResult[3]) EndFunc Func _GUICtrlMenu_GetItemInfo($hMenu, $iItem, $bByPos = True) Local $tInfo = DllStructCreate("uint Size;uint Mask;uint Type;uint State;uint ID;handle SubMenu;handle BmpChecked;handle BmpUnchecked;" & _ "ulong_ptr ItemData;ptr TypeData;uint CCH;handle BmpItem") DllStructSetData($tInfo, "Size", DllStructGetSize($tInfo)) DllStructSetData($tInfo, "Mask", 0x0000003F) Local $aResult = DllCall("user32.dll", "bool", "GetMenuItemInfo", "handle", $hMenu, "uint", $iItem, "bool", $bByPos, "struct*", $tInfo) If @error Then Return SetError(@error, @extended, 0) Return SetExtended($aResult[0], $tInfo) EndFunc Func _GUICtrlMenu_GetItemStateEx($hMenu, $iItem, $bByPos = True) Local $tInfo = _GUICtrlMenu_GetItemInfo($hMenu, $iItem, $bByPos) Return DllStructGetData($tInfo, "State") EndFunc Func _GUICtrlMenu_GetItemEnabled($hMenu, $iItem, $bByPos = True) Return BitAND(_GUICtrlMenu_GetItemStateEx($hMenu, $iItem, $bByPos), 0x00000002) = 0 EndFunc Func _GUICtrlMenu_MenuItemFromPoint($hWnd, $hMenu, $iX = -1, $iY = -1) If $iX = -1 Then $iX = _WinAPI_GetMousePosX() If $iY = -1 Then $iY = _WinAPI_GetMousePosY() Local $aResult = DllCall("user32.dll", "int", "MenuItemFromPoint", "hwnd", $hWnd, "handle", $hMenu, "int", $iX, "int", $iY) If @error Then Return SetError(@error, @extended, -1) Return $aResult[0] EndFunc Func _WinAPI_GetMousePosX($bToClient = False, $hWnd = 0) Local $tPoint = _WinAPI_GetMousePos($bToClient, $hWnd) If @error Then Return SetError(@error, @extended, 0) Return DllStructGetData($tPoint, "X") EndFunc Func _WinAPI_GetMousePosY($bToClient = False, $hWnd = 0) Local $tPoint = _WinAPI_GetMousePos($bToClient, $hWnd) If @error Then Return SetError(@error, @extended, 0) Return DllStructGetData($tPoint, "Y") EndFunc Func _WinAPI_PtInRect(ByRef $tRECT, ByRef $tPoint) Local $aResult = DllCall("user32.dll", "bool", "PtInRect", "struct*", $tRECT, "struct", $tPoint) If @error Then Return SetError(@error, @extended, False) Return $aResult[0] EndFunc Func _WinAPI_GetMousePos($bToClient = False, $hWnd = 0) Local $iMode = Opt("MouseCoordMode",1) Local $aPos = MouseGetPos() Opt("MouseCoordMode", $iMode) Local $tPoint = DllStructCreate("struct;long X;long Y;endstruct") DllStructSetData($tPoint, "X", $aPos[0]) DllStructSetData($tPoint, "Y", $aPos[1]) If $bToClient And Not _WinAPI_ScreenToClient($hWnd, $tPoint) Then Return SetError(@error + 20, @extended, 0) Return $tPoint EndFunc Func _WinAPI_ScreenToClient($hWnd, ByRef $tPoint) Local $aResult = DllCall("user32.dll", "bool", "ScreenToClient", "hwnd", $hWnd, "struct*", $tPoint) If @error Then Return SetError(@error, @extended, False) Return $aResult[0] EndFunc Func _WinAPI_GetDesktopWindow() Local $aResult = DllCall("user32.dll", "hwnd", "GetDesktopWindow") If @error Then Return SetError(@error, @extended, 0) Return $aResult[0] EndFunc Cause of the problem: _WinAPI_PtInRect fails on Explorer.exe windows because _GUICtrlMenu_GetItemRectEx returns relative rectangle bounds to the menu (i think) where always X1 = 0. Any suggestions to make this script works on all menus? Thanks
  7. Hi! So what I need is a context menu like that from explorer when you right click on desktop. But i don't know if that is possible. I searched a little and I found nothing, maybe you guys have any ideas ? I mean something like that : But...I know how do that from the GUIcreateblahblah side...now the problem is that I want to do that without GUI! Like: if _IsPressed( "02", "user32.dll" ) then _Context(..) endif Please help!
  8. Hello! So I want a context menu in my bigger program, but I don't really know how to do it realtime so it won't cause program "lag". What i want to do is to select item, and then pops out context menu and then if I select option it will do smt. Please help! Btw I started with this... #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 314, 233, 192, 124) $ListView1 = GUICtrlCreateListView("Test|_Test", 14, 26, 154, 188) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $ListViewArray[100] Local $OptionsArray[100] ;~ Local $contextmenu = GUICtrlCreateContextMenu($ListView1_0) ;~ Local $newsubmenu = GUICtrlCreateMenu("FUN", $contextmenu) ;~ $opt1 = GUICtrlCreateMenuItem("op1", $newsubmenu) For $i = 0 To 6 If $ListViewArray[$i] == "" Then $ListViewArray[$i] = GUICtrlCreateListViewItem( "test" & $i & "|" & "test" & $i * 2, $ListView1 ) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch For $item In $ListViewArray If $item <> "" And GUICtrlRead( GUICtrlRead( $ListView1 ) ) == GUICtrlRead( $item ) Then $contextmenu = GUICtrlCreateContextMenu($item) $submenu = GUICtrlCreateMenu("FUNCS", $contextmenu) $option1 = GUICtrlCreateMenuItem("op1", $submenu) EndIf Next Sleep(10) WEnd
  9. I want to create a user context menu that's different for .au3 files than it is for .js files but I cannot get the "if" part to work. I tried modifying the SciTEUser.properties file with these lines: user.context.menu=||xxx Def|1138|xxx Ref|1139|xxx Del| if $Language = "au3" user.context.menu=||$(au3) Def|1138|$(Language) Ref|1139|AU3 Del| if $Language - "cpp" user.context.menu=||$(au3) Def|1138|$(Language) Ref|1139|AU3 Del| But this doesn't work. I always see the first menu (xxx) when I right click in either the .au3 file or the .js file.
  10. Mak Context Entry Creator v1.2 Mak Context Entry Creator ver 1.2 Change Log: Added My Computer, Recycle Bin, XBMC and Skype. Fixed Some bugs. Now delete registry key directly from MCEC. New Style. ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ »MCEC v1.1 Link >here. MCEC new key remove option allow you to directly delete the un-necessary link. To delete click on the link say, "MCEC". Click on MCEC and then click "delete" button. Please Note: Do not delete "Display" and "Personalize" and "any other default key". If you like this application please comment and share with your friend. And if you like to help me yo're welcome. Windows XP users, Please let me know the registry key for Desktop Background so that it can support Windows XP and Windows Vista. Supports Windows 7, Checked on Win 7 HB and Ultimate. »» Download MCEC »» mcec.zip ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
  11. Mak Context Entry Creator +|=========================================|+ Mak Context Entry Creator is a small autoit compiled tool which allow user to create a executable shortcut at their desktop right click. The main purpose of this software is to make desktop clean and minimal. Majority of user link their useful shortcuts to their desktop and also at their taskbar. Desktop shortcut looks somewhat dirty so i created an app which let you to be minimal but also without compromising the favorite or useful shortcut. Mak Context Entry creator adds your favorite or useful software to your right click by creating a registry key. You can add as many shortcut you want but it takes some CPU memory too. So by using this software your desktop remain minimal, hide your desktop shortcut or remove them. Open your shortcut using right click. How to Use? The application itself open with administrator privilege. Click on Select Path button and choose your executable path. The first text field display the executable name as it is, so in same cases you have to edit the name. The second text-field display the executable path(don't edit it). After then click Create Context Menu. You can also use auto-built features, these are Add Registry, Add CP. Also included the Services.msc. The only drawback of this application is that you can not delete the registry value using this application, but you can use the registry editing tutorial given in the read me file. Also a backup file is also given. If you like this application please comment and share with your friend. And if you like to help me yo're welcome. This is my first application here and first GUI application i created. Mak Context Entry Creator v1.1.7z
  12. Hello everybody! Just to demonstrate how to use a combobox like a context menu, maybe that's not very helpful... Sample: Download: ComboBoxContextMenu.au3 Hope you enjoy! Regards, João Carlos.
×
×
  • Create New...