Jump to content
Sign in to follow this  
Maikey81

Splitbutton dropdown menu not showing under Windows PE

Recommended Posts

Hi,

I've created a custom tool for use in a Windows PE enviroment. Because of the number of buttons in use in de UI, I've planned on using the splitbutton in de UI.

When I test the script under Windows, the button works perfectly, but when the button is tested under Windows PE, de button appears correctly (with dropdown arrow), but no dropdown menu is showing when the button is pressed.

Is there a special requirement for this dropdown menu, that is not available under Windows PE? It's a Windows PE 3.1 (Win Vista/7) enviroment, so I think it should work.

Code for the button:

$doPC = _GUICtrlButton_Create($main, "Computer -> ", 255, 285, 90, 25, $BS_SPLITBUTTON) ;==> Create knop

;==> Code from Autoit site
Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)
    #forceref $hWnd, $Msg, $wParam
    Local Const $BCN_HOTITEMCHANGE = -1249
    Local $tNMBHOTITEM = DllStructCreate("hwnd hWndFrom;int IDFrom;int Code;dword dwFlags", $lParam)
    Local $nNotifyCode = DllStructGetData($tNMBHOTITEM, "Code")
    Local $nID = DllStructGetData($tNMBHOTITEM, "IDFrom")
    Local $hCtrl = DllStructGetData($tNMBHOTITEM, "hWndFrom")
    Local $dwFlags = DllStructGetData($tNMBHOTITEM, "dwFlags")
    Local $sText = ""
    Switch $nNotifyCode
        Case $BCN_DROPDOWN
            _Popup_Menu($hCtrl)
  Case $BN_PUSHED
            _Popup_Menu($hCtrl)
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==> WM_NOTIFY

Func _Popup_Menu($hCtrl)
    Local $hMenu
    Local Enum $idReboot = 1000, $idShutdown, $idInfo
    $hMenu = _GUICtrlMenu_CreatePopup()
    _GUICtrlMenu_InsertMenuItem($hMenu, 0, "Herstarten", $idReboot)
    _GUICtrlMenu_InsertMenuItem($hMenu, 1, "Afsluiten", $idShutdown)
    Switch _GUICtrlMenu_TrackPopupMenu($hMenu, $hCtrl, -1, -1, 1, 1, 2)
        Case $idReboot
;~  Shutdown(6)
   Exit
  Case $idShutdown
;~  Shutdown(13)
   Exit
    EndSwitch
    _GUICtrlMenu_DestroyMenu($hMenu)
EndFunc   ;==> _Popup_Menu
Edited by Maikey81

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By anit
      Hi,
      I am trying to select a value from a drop-down (highlighted in the attached image). There is no control ID associated with the window, so I am unable to use the Control* type functions. There are two values starting with 'C' in the drop-down. I tried fetching the drop-down value by passing Send("{custom}") but it always selects the first occurrence of value starting with 'C'.
      Please suggest how may I resolve this.
      Thanks!
       

    • By littleboy62
      Hello.
       
      For a project of a tool, I have to launch a program.
      This one: Display Properties control (run desk.cpl)
      I have to resize it, so we can see what's necessary.

      I'm getting there.
      The problem is that there is a drop-down menu: so I want to disable it.
      How to do this?

      I already did a test with the notepad. By deactivating the "close" button.
      Here is the code:
       
      Run("Notepad.exe") WinWait("[CLASS:Notepad]") $Hwnd = WinGetHandle("[CLASS:Notepad]") $menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $Hwnd, "int",0) DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF060, "int", 0x0);SC_CLOSE MsgBox(0,'',1) $menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $Hwnd, "int",1) DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF060, "int", 0x0);SC_CLOSE
      I would like to do the same, but with the drop-down menu (with DllCall).
      Is it possible to disable / block (or other) the drop-down menu of a program?

      Thank you for your answers.
      Sincerely,
      Thomas.
    • By UGH
      Autoit team are assbags.    They want to hold out that they are soooo much smarter than everyone else and they really don't want to help anyone with their questions.   In that case then why have a website.   Oh i know, they get their kicks out of laughing at everyone. 
       
       
       
       
       
       
       
    • By zzghost
      Hello,
      I have been reading every tutorial and help document I can find trying to figure out how to capture from a website the content of a dropdown in order to populate it into a GUI with checkboxes to run some code based off of the selections...
      I would like a script to read the options from this form-group and populate a gui. I have all the code written except this part, as of now I have to manually pull this from the site and dump into my code but it changes from time to time so I would like my code to be more flexible...
       
      Hope this makes sense?
    • By kelso
      Hello Guru's,
       
      I'm trying to write an autoit script to select from the dropdown list as you see in the attached picture. 
      I read the help page for _IEFormElementOptionSelect, but I cannot grasp how to correlate that with the source code that I'm seeing. any suggestions?

×
×
  • Create New...